[MEncoder-users] Accuracy of the -endpos option

belcampo belcampo at zonnet.nl
Mon Jun 28 22:32:24 CEST 2010


Josef Wolf wrote:
> On Mon, Jun 28, 2010 at 04:38:29PM +0200, belcampo wrote:
>> Josef Wolf wrote:
>>> Hello,
>>>
>>> I have troubles with the accuracy of the -endpos option. Most of the time,
>>> I get about 40 to 50 frames too much. When I adjust the value to get the
>>> correct end position, then audio ends about 2 seconds too early.
>> With ffmpeg -vframes ### you can exactly say how many frames you want.
>> The problem with -endpos or -t when using ffmpeg, it uses recording
>> duration, NOT video- or audio-duration but the smallest of them.
> 
> Hmmm... Does mencoder have a counterpart to -vframes? I have gone a long way
> to optimize the codec settings for mencoder and would like to avoid to start
> from scratch when moving to ffmpeg...
If you post your command line settings, maybe it's easy translated to 
ffmpeg, or use the solution explained further.
> 
>>> The problem doesn't seem to be dependant on the source material or the
>>> codec. I had the problem with ljpeg and DV source (which should both be
>>> searchable on a frame-by-frame bassis). Using lavc instead of x264 don'
>>> help either.
>> Is DV source all-keyframes ??
> 
> At least, the -ss option is precise for both, ljpeg and DV. BTW: While I can
> see reasons for -ss to position only on keyframes, I don't see why -endpos
> would require such a restriction.
A movie, which is a container, video-stream and an audio-stream.
Video- and audio-stream are not always, mostly not in sync. In the 
container is info about the delay, in such a way that a player, knows 
what audio-segment belongs to what video-segment. These can, and are, 
sometimes be 1 second apart. As an example video starts at byte-point 0, 
in the audio stream there is a silence of 1 sec. When playing of the 
first frame starts, the corresponding audio ####bytes further in the 
stream is then matched with the video and everything plays well.
Video-duration = Audio-duration, but file-duration is longer. The 
-endpos takes the latest ending-point of audio or video, and adds 
non-wanted stuff as you've noticed.
There's a workaround, by doing it in 2 steps, audio and video apart.
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users



More information about the MEncoder-users mailing list