[MPlayer-users] Mencoder audio pass messes up video pass
Sumant S.R. Oemrawsingh
sumant.oemrawsingh at wolmail.nl
Sat Jul 5 03:02:33 CEST 2003
Hi,
I have a problem with mencoder in three-pass encoding. mencoder commands and
output of the commands are also provided.
When first encoding audio (with ovc frameno), this seems to go completely
wrong (every frame is `skipped'), but playing the resulting frameno.avi
appears to work and sounds perfect.[1]
Then, the in the first video pass (with oac copy), mencoder does not seem to
'progress', as, again, it appears to be skipping every frame, and Pos: does
not seem to increase (always stays 0.0 seconds). After this run, it tells me
the videobitrate is not a number.[2]
Third pass (second video) then fails, probably because divx2pass.log is messed
up (empty); mencoder segfaults.[3]
However, when I completely skip the first (audio) pass and directly encode
the video first (with oac copy), the dvd is nicely encoded. But then I have
a52 (AC3) audio, which takes a bit too much space, which I'd rather spend on
audio.[4,5]
To quickly generate the output, I decided to simply start encoding somewhere
for 5 seconds. It gives the same output, but is shorter and takes much less
time. Additionally, I cut away some of the output, to shorten this message
somewhat :)
I'm sorry for the long mail, but I see no other way to get my point across.
It seems as if frameno.avi is not saving framenumbers and mencoder can't
match the audio frame to the video frame? I don't know anything about the
inner workings of mencoder, but this is what I would guess from these
problems... Anyway, mplayer can play both the dvd itself and the frameno.avi
audio-only file, but mencoder cannot copy from this file (or messes up
somehow). Any ideas?
Thank you in advance,
Sumant Oemrawsingh
[1] First pass: encoding audio
mencoder -dvd 3 -oac mp3lame -lameopts br=128:abr -ss 3382 -endpos 5 \
-ovc frameno -o frameno.avi
----- OUTPUT -----
MEncoder 0.90rc5-2.95.3 (C) 2000-2003 Arpad Gereoffy (see DOCS)
CPU: Advanced Micro Devices Athlon 4 PM Palomino/Athlon MP Multiprocessor/Athlon XP eXtreme Performance (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Reading /home/nero/.mplayer/codecs.conf: can't open '/home/nero/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: 50 audio & 136 video codecs
File not found: 'frameno.avi'
Reading config file /home/nero/.mplayer/mencoder: No such file or directory
font: can't open file: /home/nero/.mplayer/font/font.desc
Font /usr/local/share/mplayer/font/font.desc loaded successfully! (206 chars)
Reading disc structure, please wait...
There are 3 titles on this DVD.
There are 8 chapters in this DVD title.
There are 1 angles in this DVD title.
DVD successfully opened.
success: format: 0 data: 0x0 - 0xF192E000
MPEG-PS file format detected.
VIDEO: MPEG2 720x576 (aspect 2) 25.00 fps 8600.0 kbps (1075.0 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x576 fps:25.00 ftime:=0.0400
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
AC3: 2.0 (stereo) 48000 Hz 192.0 kbit/s
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 24000->192000 (192.0 kbit)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)
==========================================================================
MP3 audio selected
Building audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
Writing AVI header...
Pos: 0.0s 1f (89%) 1fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.1s 3f (89%) 2fps Trem: 0min 0mb A-V:0.008 [0:0]
Skipping frame!
Pos: 0.1s 5f (89%) 3fps Trem: 0min 0mb A-V:0.016 [0:0]
Skipping frame!
Pos: 0.2s 7f (89%) 5fps Trem: 0min 0mb A-V:0.024 [0:0]
Skipping frame!
Pos: 0.2s 9f (89%) 6fps Trem: 0min 0mb A-V:0.032 [0:0]
Skipping frame!
Pos: 0.2s 11f (89%) 8fps Trem: 0min 0mb A-V:0.040 [0:0]
Skipping frame!
Pos: 0.3s 13f (89%) 9fps Trem: 0min 0mb A-V:0.048 [0:0]
Skipping frame!
Pos: 0.3s 15f (89%) 10fps Trem: 0min 0mb A-V:0.056 [0:0]
<Cut by me>
Skipping frame!
Pos: 4.8s 245f (89%) 116fps Trem: 0min 0mb A-V:0.043 [0:114]
Skipping frame!
Pos: 4.8s 247f (89%) 117fps Trem: 0min 0mb A-V:0.039 [0:114]
Skipping frame!
Pos: 4.9s 249f (89%) 118fps Trem: 0min 0mb A-V:0.041 [0:114]
Skipping frame!
Pos: 4.9s 251f (89%) 119fps Trem: 0min 0mb A-V:0.039 [0:114]
Writing AVI index...
Fixing AVI header...
Video stream: 0.800 kbit/s (100 bps) size: 492 bytes 4.920 secs 251 frames
Audio stream: 114.062 kbit/s (14257 bps) size: 76992 bytes 5.400 secs
----- END OF OUTPUT -----
[2] Second pass: enoding video first pass
mencoder -dvd 3 -sws 2 -oac copy -ovc lavc -o movie.avi -ss 3382 -endpos 5 \
-lavcopts vcodec=mpeg4:v4mv:vhq:vbitrate=752:vpass=1
----- OUTPUT -----
MEncoder 0.90rc5-2.95.3 (C) 2000-2003 Arpad Gereoffy (see DOCS)
CPU: Advanced Micro Devices Athlon 4 PM Palomino/Athlon MP Multiprocessor/Athlon XP eXtreme Performance (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Reading /home/nero/.mplayer/codecs.conf: can't open '/home/nero/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: 50 audio & 136 video codecs
AVI file format detected.
VIDEO: [FrNo] 720x576 24bpp 25.00 fps 0.8 kbps ( 0.1 kbyte/s)
Using pass3 control file: frameno.avi
Reading config file /home/nero/.mplayer/mencoder: No such file or directory
font: can't open file: /home/nero/.mplayer/font/font.desc
Font /usr/local/share/mplayer/font/font.desc loaded successfully! (206 chars)
Reading disc structure, please wait...
There are 3 titles on this DVD.
There are 8 chapters in this DVD title.
There are 1 angles in this DVD title.
DVD successfully opened.
success: format: 0 data: 0x0 - 0xF192E000
MPEG-PS file format detected.
VIDEO: MPEG2 720x576 (aspect 2) 25.00 fps 8600.0 kbps (1075.0 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x576 fps:25.00 ftime:=0.0400
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer2&3 finished, tables done
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 16000->192000 (128.0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening video filter: [expand=-1:-1:-1:-1:1]
Expand: -1 x -1, -1 ; -1 (-1=autodetect) osd: 1
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 576 (preferred csp: Mpeg PES)
Could not find matching colorspace - retrying with -vop scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder v2.0
libmpeg2: Using MMXEXT for IDCT transform
libmpeg2: Using MMXEXT for motion compensation
VDec: vo config request - 720 x 576 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
videocodec: libavcodec (720x576 fourcc=58564944 [DIVX])
High quality encoding selected (non real time)!
Selected video codec: [mpeg12] vfm:libmpeg2 (MPEG 1 or 2 (libmpeg2))
==========================================================================
audiocodec: framecopy (format=55 chans=2 rate=48000 bits=0 bps=14258 sample=0)
Writing AVI header...
Pos: 0.0s 1f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 3f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 5f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 7f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 9f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 11f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 13f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 15f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 17f (89%) 0fps Trem: 0min 0mb A-V:0.000 [0:0]
<Cut by me>
Skipping frame!
Pos: 0.0s 245f (89%) 240fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 247f (89%) 241fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 249f (89%) 242fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 251f (89%) 243fps Trem: 0min 0mb A-V:0.000 [0:0]
Writing AVI index...
Fixing AVI header...
Video stream: nan kbit/s (-2147483648 bps) size: 0 bytes 0.000 secs 251 frames
Audio stream: 115.810 kbit/s (14476 bps) size: 7296 bytes 0.504 secs
----- END OF OUTPUT -----
[3] Third pass: encoding video second pass
mencoder -dvd 3 -sws 2 -oac copy -ovc lavc -o movie.avi -ss 3382 -endpos 5 \
-lavcopts vcodec=mpeg4:v4mv:vhq:vbitrate=752:vpass=2
----- OUTPUT -----
MEncoder 0.90rc5-2.95.3 (C) 2000-2003 Arpad Gereoffy (see DOCS)
CPU: Advanced Micro Devices Athlon 4 PM Palomino/Athlon MP Multiprocessor/Athlon XP eXtreme Performance (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Reading /home/nero/.mplayer/codecs.conf: can't open '/home/nero/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: 50 audio & 136 video codecs
AVI file format detected.
VIDEO: [FrNo] 720x576 24bpp 25.00 fps 0.8 kbps ( 0.1 kbyte/s)
Using pass3 control file: frameno.avi
Reading config file /home/nero/.mplayer/mencoder: No such file or directory
font: can't open file: /home/nero/.mplayer/font/font.desc
Font /usr/local/share/mplayer/font/font.desc loaded successfully! (206 chars)
Reading disc structure, please wait...
There are 3 titles on this DVD.
There are 8 chapters in this DVD title.
There are 1 angles in this DVD title.
DVD successfully opened.
success: format: 0 data: 0x0 - 0xF192E000
MPEG-PS file format detected.
VIDEO: MPEG2 720x576 (aspect 2) 25.00 fps 8600.0 kbps (1075.0 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x576 fps:25.00 ftime:=0.0400
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer2&3 finished, tables done
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 16000->192000 (128.0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening video filter: [expand=-1:-1:-1:-1:1]
Expand: -1 x -1, -1 ; -1 (-1=autodetect) osd: 1
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 576 (preferred csp: Mpeg PES)
Could not find matching colorspace - retrying with -vop scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder v2.0
libmpeg2: Using MMXEXT for IDCT transform
libmpeg2: Using MMXEXT for motion compensation
VDec: vo config request - 720 x 576 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
2pass failed: reading from filename=divx2pass.log
FATAL: Cannot initialize video driver.
videocodec: libavcodec (720x576 fourcc=58564944 [DIVX])
High quality encoding selected (non real time)!
VDecoder init failed :(
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmpeg12] vfm:ffmpeg (FFmpeg MPEG 1/2)
==========================================================================
audiocodec: framecopy (format=55 chans=2 rate=48000 bits=0 bps=14258 sample=0)
Writing AVI header...
VDec: vo config request - 720 x 576 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
2pass failed: reading from filename=divx2pass.log
FATAL: Cannot initialize video driver.
videocodec: libavcodec (720x576 fourcc=58564944 [DIVX])
High quality encoding selected (non real time)!
init_vo failed
Pos: 0.0s 1f (89%) 1fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 3f (89%) 2fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 5f (89%) 4fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 7f (89%) 5fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 9f (89%) 6fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 11f (89%) 8fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 13f (89%) 9fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 15f (89%) 11fps Trem: 0min 0mb A-V:0.000 [0:0]
<Cut by me>
Skipping frame!
Pos: 0.0s 244f (89%) 109fps Trem: 0min 0mb A-V:0.000 [0:0]
get_buffer() failed (0 3 0 0x4113e030)
Pos: 0.0s 245f (89%) 110fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 246f (89%) 110fps Trem: 0min 0mb A-V:0.000 [0:0]
get_buffer() failed (0 1 0 0x4113e030)
Pos: 0.0s 247f (89%) 110fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 249f (89%) 111fps Trem: 0min 0mb A-V:0.000 [0:0]
Skipping frame!
Pos: 0.0s 250f (89%) 112fps Trem: 0min 0mb A-V:0.000 [0:0]
get_buffer() failed (0 3 0 0x4113e030)
Pos: 0.0s 251f (89%) 112fps Trem: 0min 0mb A-V:0.000 [0:0]
Segmentation Fault
----- END OF OUTPUT -----
[4] Second pass WITHOUT first pass (frameno.avi doesn't exist). Commandline
is the same as [2]. Normal output (3 skipped frames at the beginning, but
this happens more often), no one wants to see this, right? :)
[5] Third pass WITHOUT first pass (frameno.avi doesn't exist). Commandline
is the same as [3]. Same as [4], normal output (and the 3 skipped frames).
Nothing to see here, please move along :)
--
Sumant S. R. Oemrawsingh
Sumant.Oemrawsingh at WolMail.NL
More information about the MPlayer-users
mailing list