[MEncoder-users] x264 adds video time to endpos
Sylvain Sauvage
Sylvain.L.Sauvage at free.fr
Tue Jun 22 19:07:22 CEST 2010
Hi all,
x264 seems to always add 2.0s of video with the -endpos option.
As an example, if src.avi is a 30s long video (could be mpeg,
live video (v4l, dvb)... ; could be shorter or longer (9000s)),
the following command:
mencoder -endpos 20 -o res.avi -oac copy -ovc x264 src.avi
results in a 22s video, 20s audio file.
With -endpos 30 or no -endpos, the result is 30s video, 29s
audio.
With -ovc xvid or copy, no problem.
I tried -oac copy, mp3lame or faac: same thing.
I tried playing with options and filters to no avail.
Whatever the length I ask, x264 adds exactly 2.0s of video, so I
don’t think it’s related to keyint or any other interval.
As video and audio lengths don’t match, this obviously results
in an A-V desynchronization (more, an irregular one: 0s at the
beginning, 2.0s at the end, that can’t be repaired with a simple
-delay).
Here is an example of mencoder’s output:
MPlayer SVN-r31309 (C) 2000-2010 MPlayer Team
success: format: 0 data: 0x0 - 0x75e3fb6
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO: [FFV1] 720x576 24bpp 25.000 fps 31891.7 kbps (3893.0 kbyte/s)
[V] filefmt:3 fourcc:0x31564646 size:720x576 fps:25.000 ftime:=0.0400
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 32000 Hz, 2 ch, s16le, 1024.0 kbit/100.00% (ratio: 128000->128000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffv1] vfm: ffmpeg (FFV1 (lossless codec))
==========================================================================
MP3 audio selected.
Movie-Aspect is undefined - no prescaling applied.
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
x264 [info]: profile High, level 3.0
Pos: 0.0s 22f ( 2%) 0.00fps Trem: 0min 0mb A-V:0.082 [0:0]
Skipping frame!
Writing header...0f ( 5%) 38.70fps Trem: 0min 0mb A-V:0.069 [0:0]
ODML: vprp aspect is 16384:13107.
Setting audio delay to 0.072s.
Writing header...
ODML: vprp aspect is 16384:13107.
Setting audio delay to 0.072s.
Pos: 20.0s 551f (72%) 40.16fps Trem: 0min 3mb A-V:0.070 [940:188]]
Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:13107.
Setting audio delay to 0.072s.
Video stream: 898.487 kbit/s (112310 B/s) size: 2470838 bytes 22.000 secs 551 frames
Audio stream: 188.777 kbit/s (23597 B/s) size: 472320 bytes 20.016 secs
The problem seems to be the pos seeking, not the result: 551
frames is 22s (at 25fps) but there is a Pos: at 20.0s/551f...
So, am I missing something? Is this a bug or is there an option
to handle this?
Thanks,
--
Sylvain Sauvage
More information about the MEncoder-users
mailing list