Page 1 of 1

Wrong Duration for MPEG2 movies

Posted: 09 Apr 2013 10:15
by McDummy
Hi,

I have the following problem: When I record satellite TS streams, use ProjectX or PVAstrumento to demux them, edit the elementary streams with Mpeg2Schnitt, and use mplex (Mjpegtools) or imagomuxer for muxing, vlc shows most of the time a wrong duration (mostly half of the film length) for the resulting mpg movies. The movies themselves play fine.

I know, this seems to be an old problem, but I haven't found a solution so far.

Interestingly, when I use bbmpeg or mplex (Mike Grover) for muxing the same elementary streams, vlc shows the correct duration. Therefore, it seems that this problem could be caused by improper muxing parameters or by errors in the streams that are corrected by some muxers. Unfortunately, I cannot work out why vlc sometimes shows a wrong duration for mplex(Mjpegtools)/imagomuxer but not for bbmpeg/mplex(Grover).

Could someone help me an explain how vlc determines the duration/length of an mpeg2 movie?

If required, I could upload examples of mpeg files created from the same elementary streams with different muxers that show this behavior.

Thanks for your help

McDummy

Re: Wrong Duration for MPEG2 movies

Posted: 09 Apr 2013 12:30
by Jean-Baptiste Kempf
VLC determines duration based on the PCR.

Re: Wrong Duration for MPEG2 movies

Posted: 09 Apr 2013 13:03
by McDummy
Thanks for the short info. Could you give me some more information.

Does VLC just look at the first and the last PCR value and calculates the length from the difference?

I once also encountered the problem with pvastrumento and mplex that the duration is changing constantly while a movie is replayed.

Is there a way to upload my example files (18 Mbytes each) so it can be determined why vlc determines the different durations?

Re: Wrong Duration for MPEG2 movies

Posted: 16 Apr 2013 14:21
by McDummy
Just to prevent a misunderstanding:

I thought that PCR are parts of the MPEG2 transport streams but not contained in MPEG2 Program Streams.

There are no problems with the transport streams I record with my receiver - VLC shows the correct duration for these files. Only when I demux, edit, and then remux the AV data to create mpeg (program stream) files, VLC often shows an incorrect duration.

Re: Wrong Duration for MPEG2 movies

Posted: 16 Apr 2013 15:23
by Jean-Baptiste Kempf
Ah, then no idea.

Re: Wrong Duration for MPEG2 movies

Posted: 18 Apr 2013 12:13
by McDummy
I've just checked some of the problematic files and found that these files contain several system headers. In contrast, the "good" ones have at most one system header (depending on the muxer). Therefore, I wonder if this could cause the problem.

However, that's just a guess. Maybe someone who has more experience could have a look at the problematic files. Is it possible to upload the problematic files to this forum (I haven't found any upload possibilities yet).

McDummy

Re: Wrong Duration for MPEG2 movies

Posted: 18 Apr 2013 15:33
by Jean-Baptiste Kempf
This is probably the issue, indeed.