[MPlayer-users] mencoder muxing problem
Javier Diaz
javier at cofradia.org
Sat Jan 3 15:07:22 CET 2009
Hi there
I'm using MEncoder 2:1.0~rc2 on ubuntu 8.10
I'm trying to convert an h264/ogg .mkv video into an xvid/mp3 .avi,
according to mkvinfo my video is 2 minutes 59 seconds long, has a resolution
of 1264 x 608, and has 25 frames per second,....
------------------------------------------------------------------------------------------------------------------------
$ mkvinfo file.mkv
+ EBML head
|+ Doc type: matroska
|+ Doc type version: 1
|+ Doc type read version: 1
+ Segment, size 50524893
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 64)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libebml v0.7.7 + libmatroska v0.8.1
| + Writing application: mkvmerge v2.2.0 ('Turn It On Again') built on Jul
1 2008 15:44:46
| + Duration: 179.557s (00:02:59.557000000)
| + Date: Sat Dec 20 09:04:24 2008 UTC
| + Segment UID: 0x57 0x8c 0x5b 0x4c 0xfa 0x77 0xfd 0x2b 0x9b 0xda 0xa1 0xb7
0xf2 0x46 0xa0 0x7a
|+ Segment tracks
| + A track
| + Track number: 1
| + Track UID: 4284839605
| + Track type: video
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 0
| + MinCache: 1
| + Timecode scale: 1.000000
| + Max BlockAddition ID: 0
| + Codec ID: V_MPEG4/ISO/AVC
| + Codec decode all: 1
| + CodecPrivate, length 39
| + Default duration: 40.000ms (25.000 fps for a video track)
| + Language: und
| + Video track
| + Pixel width: 1264
| + Pixel height: 608
| + Interlaced: 0
| + Display width: 1264
| + Display height: 608
| + A track
| + Track number: 2
| + Track UID: 1045744996
| + Track type: audio
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 1
| + MinCache: 0
| + Timecode scale: 1.000000
| + Max BlockAddition ID: 0
| + Codec ID: A_VORBIS
| + Codec decode all: 1
| + CodecPrivate, length 4303
| + Language: und
| + Audio track
| + Sampling frequency: 48000.000000
| + Channels: 2
|+ Attachments
| + Attached
| + File name: tags file
| + Mime type: RFC3023
| + File data, size: 185
| + File UID: 1887744106
| + File description: This video has been downloaded from Vuze.com using
Azureus
|+ Cues (subentries will be skipped)
|+ EbmlVoid (size: 59)
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 59)
|+ Cluster
------------------------------------------------------------------------------------------------------------------------
So, the next step should be to...
------------------------------------------------------------------------------------------------------------------------
$ mencoder file.mkv -oac mp3lame -ovc xvid -xvidencopts pass=1 -o file.avi
MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model: 43,
Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0x302f301
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_VORBIS), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1264x608 24bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x31637661 size:1264x608 fps:25.00 ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->192000)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis decoder)
==========================================================================
xvid: using library version 1.1.2 (build xvid-1.1.2)
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
MP3 audio selected.
VDec: vo config request - 1264 x 608 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.08:1 - prescaling to correct movie aspect.
videocodec: XviD (1264x608 fourcc=44495658 [XVID])
xvid: par=0/0 (vga11), displayed=1264x608, sampled=1264x608
xvid: 2Pass Rate Control -- 1st pass
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.048s.
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.048s.
Pos: 0.0s 3f ( 0%) 0.00fps Trem: 1min 23mb A-V:0.008 [0:0]
.
.
.
Pos: 161.3s 4481f (99%) 18.25fps Trem: 0min 109mb A-V:0.080 [5434:247]
Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.048s.
Video stream: 5432.140 kbit/s (679017 B/s) size: 109593426 bytes 161.400
secs 4481 frames
Audio stream: 247.035 kbit/s (30879 B/s) size: 4997280 bytes 161.832
secs
------------------------------------------------------------------------------------------------------------------------
It finished but sent me lots of Skipping frame! and some duplicate frame(s)
warings
Problem here is that the resulting file is shorter than the original .mkv,
it is 2 minutes 41 seconds long while the original is 2 minutes 59 seconds
long, when I play it, the video track goes a little bit faster than the
audio track, when the file reaches the end, the video track finishes but the
audio is truncated, it seems to be a muxing problem, maybe I'm missing some
option
The next thing I did, was to encode each track by extracting them from the
original mkv file....
------------------------------------------------------------------------------------------------------------------------
$ mkvextract tracks file.mkv 1:video_track.h264 2:audio_track.ogg
Extracting track 1 with the CodecID 'V_MPEG4/ISO/AVC' to the file
'video_track.h264'. Container format: AVC/h.264 elementary stream
Extracting track 2 with the CodecID 'A_VORBIS' to the file
'audio_track.ogg'. Container format: Ogg (Vorbis in Ogg)
progress: 100%
$ mencoder video_track.h264 -ovc xvid -xvidencopts pass=1 -o video.avi
MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model: 43,
Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0x2cfe59e
H264-ES file format detected.
FPS seems to be: 25.000000
[V] filefmt:30 fourcc:0x10000005 size:0x0 fps:25.00 ftime:=0.0400
xvid: using library version 1.1.2 (build xvid-1.1.2)
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
VDec: vo config request - 1264 x 608 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: XviD (1264x608 fourcc=44495658 [XVID])
xvid: par=0/0 (vga11), displayed=1264x608, sampled=1264x608
xvid: 2Pass Rate Control -- 1st pass
Writing header...
ODML: vprp aspect is 16384:7880.
Writing header...
ODML: vprp aspect is 16384:7880.
Pos: 0.0s 3f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0]
.
.
.
Pos: 179.1s 4481f (99%) 19.31fps Trem: 0min 112mb A-V:0.000 [5258:0]
Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:7880.
Video stream: 5256.182 kbit/s (657022 B/s) size: 117738481 bytes 179.200
secs 4481 frames
------------------------------------------------------------------------------------------------------------------------
No Skipping frame! warnings
The resulting avi file looks fine, it's 1264 x 608, XVID MPEG-4, 25 frames
per second, 2 minutes 59 seconds long
The file audio_track.ogg I extracted with mkvextract is also 2 minutes 59
seconds long
Looks like I can't just copy the audio track
------------------------------------------------------------------------------------------------------------------------
$ mencoder file.mkv -oac copy -ovc xvid -xvidencopts pass=1 -o
video_oggcopy.avi
MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model: 43,
Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0x302f301
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_VORBIS), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1264x608 24bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x31637661 size:1264x608 fps:25.00 ftime:=0.0400
xvid: using library version 1.1.2 (build xvid-1.1.2)
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio format 0x73627276 is incompatible with '-oac copy', please try '-oac
pcm' instead or use '-fafmttag' to override it.
Exiting...
------------------------------------------------------------------------------------------------------------------------
So I tryed a different encoder, this time faac
------------------------------------------------------------------------------------------------------------------------
$ mencoder file.mkv -oac faac -ovc xvid -xvidencopts pass=1 -o video_acc.avi
MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model: 43,
Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0x302f301
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_VORBIS), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1264x608 24bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x31637661 size:1264x608 fps:25.00 ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->192000)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis decoder)
==========================================================================
xvid: using library version 1.1.2 (build xvid-1.1.2)
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
VDec: vo config request - 1264 x 608 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.08:1 - prescaling to correct movie aspect.
videocodec: XviD (1264x608 fourcc=44495658 [XVID])
xvid: par=0/0 (vga11), displayed=1264x608, sampled=1264x608
xvid: 2Pass Rate Control -- 1st pass
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.043s.
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.043s.
Pos: 0.0s 3f ( 0%) 0.00fps Trem: 1min 16mb A-V:0.008 [0:0]
.
.
.
Pos: 161.3s 4481f (99%) 19.07fps Trem: 0min 107mb A-V:0.080 [5434:136]
Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.043s.
Video stream: 5432.140 kbit/s (679017 B/s) size: 109593426 bytes 161.400
secs 4481 frames
Audio stream: 136.240 kbit/s (17029 B/s) size: 2756043 bytes 161.835
secs
------------------------------------------------------------------------------------------------------------------------
Just like before lots of Skipping frame! warnings
The resulting file is also short, 2 minutes 41 seconds and has no audio
track, also looks like I don't have some library related to the facc encoder
(how can I very this?)
So I turned the -noskip flag on and went back to mp3lame......
------------------------------------------------------------------------------------------------------------------------
$ mencoder -noskip file.mkv -oac mp3lame -ovc xvid -xvidencopts pass=1 -o
video_noskip.avi
MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model: 43,
Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0x302f301
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_VORBIS), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1264x608 24bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x31637661 size:1264x608 fps:25.00 ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->192000)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis decoder)
==========================================================================
xvid: using library version 1.1.2 (build xvid-1.1.2)
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
MP3 audio selected.
VDec: vo config request - 1264 x 608 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.08:1 - prescaling to correct movie aspect.
videocodec: XviD (1264x608 fourcc=44495658 [XVID])
xvid: par=0/0 (vga11), displayed=1264x608, sampled=1264x608
xvid: 2Pass Rate Control -- 1st pass
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.048s.
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.048s.
Pos: 0.7s 22f ( 0%) 16.69fps Trem: 4min 66mb A-V:0.084 [0:231]
.
.
.
Pos: 154.3s 4481f (99%) 20.32fps Trem: 0min 107mb A-V:0.080 [5565:246]
Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:7880.
Setting audio delay to 0.048s.
Video stream: 5562.777 kbit/s (695347 B/s) size: 107361599 bytes 154.400
secs 4481 frames
Audio stream: 246.461 kbit/s (30807 B/s) size: 4769760 bytes 154.824
secs
------------------------------------------------------------------------------------------------------------------------
Also lots of Skipping frame! warnings and the resulting file got even
shorter, this time 2 minutes 34 seconds long
I also used -noencodedups but did't see any difference compared with my
first try.
Don't know what else to do
More information about the MPlayer-users
mailing list