VideoHelp.com forum archive
http://www.supermediastore.com/



Forum Archive Home -> User guides -> How to convert MKV to AVI or OGM to AVI using mencoder



How to convert MKV to AVI or OGM to AVI using mencoder
Baldrick posted 2005 May 17 07:15
mencoder is very useful for converting between different container formats. It is a command line tool so it is not super easy to use for us lazy newbies. :)

How to convert from OGM to AVI or MKV to AVI with mp3 audio and leave the video source intact.
If the OGM or MKV already has a video that can be stored in AVI like DivX or XviD you only need to copy it. Use gspot to identify the video codec in the ogm,mkv.

How to convert from OGM to AVI or MKV to AVI with mp3 audio and xvid video.
If you want to convert the audio to mp3 and the video to xvid in an avi.


How to convert from OGM to AVI or MKV to AVI with mp3 audio and leave the video source intact.
Download mencoder for windows, http://www1.mplayerhq.hu/MPlayer/releases/win32-beta/MPlayer-mingw32-1.0pre7.zip
Extract all files to a folder on your hd.
Open a Command prompt from Start->Accessories->Command prompt
Type
"C:\Program Files\mplayer\mencoder.exe" "c:\video\video.ogm" -oac mp3lame -ovc copy -o "c:\video\videooutput.avi"


Explanation:

"C:\Program Files\mplayer\mencoder"
The location to the mencoder.exe

"c:\video\video.ogm"
The video ogm or mkv video source

-oac mp3lame
Convert the audio to mp3

-ovc copy
Copy the video, no reconverting

-o "c:\video\videooutput.avi"
Where to output the file and the new video name

Hit enter to start converting


Done!



How to convert from OGM to AVI or MKV to AVI with mp3 audio and xvid video .
Same as above but change the
-ovc copy
to
-ovc xvid -xvidencopts pass=1

so it will be
"C:\Program Files\mplayer\mencoder.exe" "c:\video\video.ogm" -oac mp3lame -ovc xvid -xvidencopts pass=1 -o "c:\video\videooutput.avi"


Explanation:
-ovc xvid -xvidencopts pass=1
Xvid video codec and one pass encoding
You can also add video bitrate if you like,
-ovc xvid -xvidencopts pass=1 bitrate=1000



Soopafresh posted 2005 May 17 20:25
Nice one ! I love command line utilities. Thanks.


OutlawSpark posted 2005 May 25 01:00
Here are a few questions with this:

How do I use it for a file with multiple audio tracks?

And just how big can the file you are converting can be?

What are the commands that would allow me to launch or save it to a different drive?

Thanks. I always come here for my conversion needs.



Baldrick posted 2005 Jun 15 10:37
:
How do I use it for a file with multiple audio tracks?

No idea, it is probably possible but I haven't done that much mencoding.

:
And just how big can the file you are converting can be?

Adjust the bitrate, use a bitrate calculator to calculate.

:
What are the commands that would allow me to launch or save it to a different drive?

Change the drive letter, like d:\video.avi



celtic_druid posted 2005 Jun 15 20:30
Use -aid # or -alang eng if it is tagged properly to specify which track to convert. The second track you would have to process seperatly like say.
mplayer -ao:pcm:file=track2.wav -vo null -vc dummy -aid 2 input.mkv
To extract the 2nd stream, then use mencoder with -aid 1.

Also use -lameencopts to change lame settings. -oac help for a list of audio compressors (pcm, ac3, etc.). -ovc help for a list of video codecs, including lossless ones.

Check the docs over at mplayerhq for full details.



rwmol posted 2005 Jun 24 22:55
SimpleDivX uses mencoder for conversion. Only problem it converts 6 channel input to stereo. Is it possible to add a config file to the mplayer directory? If so. what would the command line be?


natrap posted 2005 Jul 03 21:44
How do I batch convert a whole lot of files with Mencoder?


Jackler posted 2005 Jul 06 04:43
Hello, im sorry to bother but Im in a hurry to format my computer and am trying to get everything onto disk. Ive an OGM file thats just a bit too big and wont fit on the disk, and found your thread/guide to converting to AVI. I followed your instructions, but to no avail. It comes up saying Cant open output file "c:\video\videooutput.avi"

Heres the log:

C:\Documents and Settings\Molly>"C:\Program Files\mplayer\mencoder.exe" "C:\Docu
ments and Settings\Molly\Desktop\ah.ogm" -oac mp3lame -ovc xvid -xvidencopts pas
s=1 -o "c:\video\videooutput.avi"
MEncoder 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon Willamette (Family: 8, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
File not found: 'frameno.avi'
Failed to open frameno.avi
success: format: 0 data: 0x0 - 0x2bed0c75
[Ogg] stream 0: video (FOURCC XVID), -vid 0
[Ogg] stream 1: audio (format 0x2000), -aid 0
[Ogg] stream 2: subtitles (SRT-like text subtitles), -sid 0
Ogg file format detected.
VIDEO: [XVID] 640x352 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:18 fourcc:0x44495658 size:640x352 fps:23.98 ftime:=0.0417
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
No accelerated IMDCT transform found
[Ogg] Language for -sid 0 is '-slang "English[eng]"'
AC3: 5.1 (3f+2r+lfe) 48000 Hz 448.0 kbit/s
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)
==========================================================================
Cannot open output file 'c:\video\videooutput.avi'.
Exiting...


If you have the time, please tell me if you notice any errors or something ive done wrong. I appreciate your time.



Jackler posted 2005 Jul 09 16:50
*bump*


Baldrick posted 2005 Jul 10 04:18
does the c:\video folder exists?? if not create it first or use some other folder.


Jackler posted 2005 Jul 10 04:50
ya, I set up a c:\video folder, hell I even tried putting the video.ogm and videooutput.avi in there, maybe for something to overwrite, but didnt work at all.


Jackler posted 2005 Jul 14 06:05
*bump*


vn33 posted 2005 Jul 24 13:49
thankyou
this works a lot better than Video Cleaner



Meaghan posted 2005 Aug 12 19:36
Thanks for the help in converting my mkv files into avis.
.
..
...
I just have one little glitch. The subtitles were lost in the conversion. Is there anyway to keep the subtitles during the change over?

Thanks.



celtic_druid posted 2005 Aug 12 23:09
mplayer can demux subtitles by using say the -dumpsrtsub if they are textsubs or -dumpsub for vobsubs. See mplayer man for full details/options. Not sure if mencoder can mux subs to avi though and even if it could, external subs are more compatible anyway.

Could also just demux the subs using mkvextract.



Meaghan posted 2005 Aug 13 15:31
Fabulous . .. thanks


go_yy posted 2005 Sep 30 11:09
hi... i got prob wit mencoder.... i try to follow ur instruction to copy subtitles and i had this prob as shown below..

C:\Documents and Settings\Used>"Desktop\mplayer\mencoder.exe" "c:\Program Files\
BitComet\Downloads\school rumble1-2\[WF-KAA]_School_Rumble_02.DVD(XviD.AAC)[55F0
8DB6].mkv" -oac mp3lame -ovc xvid -xvidencopts pass=1 -dumpsub -o "c:\Documents
and Settings\Used\Desktop\test.avi"
MEncoder 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 7)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
File not found: 'frameno.avi'
Failed to open frameno.avi
dumpsub is not an MEncoder option


can any1 help me???[/b]



chaos_maiden posted 2005 Oct 10 19:21
i am trying to use this method to convert an mkv to avi. the source uses the h264 video codec, and the audio is aac (i have both codecs installed). when i combine the video and audio streams into the avi, there is an error in the output file (frame 568). this glitch is not present in the source files, they play perfectly, while the output file crashes what ever player i use, as well as virtual dub when i attempt to put subtitles in it. does anyone know what might be causing this?


celtic_druid posted 2005 Oct 10 22:32
Copying native AVC to an avi could be the problem. Not really a good idea at any rate. Does the mkv use native AVC or VfW compatibility mode? Also how are you testing playback? With mplayer or something else?


chaos_maiden posted 2005 Oct 10 22:41
the mkv is vfw mode. i'm copying the video stream and converting the audio to lame mp3 (i normally use virtual dub mod, but it doesn't support aac audio). i've tried playing the file in both real player and windows media player, as well as loading the file in virtual dub, all 3 result in a program crash when it gets to that particular frame. in media player, i get an error message saying that there is an assertion error in the C++ runtime library and gives the file path for the h264 codec in ffdshow. is it possibly a problem with ffdshow?


celtic_druid posted 2005 Oct 10 23:52
Try playing it with mplayer.
If the mkv uses VfW for the video (not recommended or spec compliant for AVC) then remuxing to avi should be fine.

What build of ffdshow?



chaos_maiden posted 2005 Oct 11 00:59
it doesn't play in mplayer either. i tried another mkv with the same encoding on the streams and it behaves the same way. i'm using the 9/20/05 build of ffdshow.


chaos_maiden posted 2005 Oct 11 19:47
mencoder also crashes if i try to re-encode the video to xvid during the initial pass, however both the source mkv and the extracted avi stream (i used mkvextractgui for the extraction), which also use the h264 codec, playback with no problems in any player


celtic_druid posted 2005 Oct 11 21:47
Try this build of mplayer/mencoder: http://ffdshow.faireal.net/mirror/mplayer/mplayer2005.10.09.P4.7z


nguyenluthuy posted 2005 Oct 21 04:53
how to add subtitles if i convert a dual file?I have problem with the subfont, please guide me.
thanks in advanced



sakuya_su posted 2006 Jan 16 00:32
try using a new mencoder GUI, which is alltoavi:

http://alltoavi.sourceforge.net

it converts ogm/mkv to avi using subtitle, has batch mode and subtitle/audio selection



KIJIN posted 2006 Feb 14 03:38
I've been using Mencoder coder for some time now, tho I only use its most basic of commands (ripped from this site :roll: ). Thanks for all the posts, BTW!

So, this may sound stupid, but is lame's mp3 encoder its default audio encoder? Is there any other way to change the audio encode to like, say, good ol' wav.?



sakuya_su posted 2006 Feb 14 04:19
audio codecs are selected using the flag -oac CODEC name, look on the manual of mencoder for a list of codecs


celtic_druid posted 2006 Feb 14 04:19
Default I think from recollection was libavcodec 224k mp2. Now if you don't sepecify an audio codec, I think you will find it asks you to and won't encode.

Sure for PCM (assuming that is what you meant by "good ol' wav") it is just -oac pcm.

Errr, on second thought, I don't think it ever had a default audio encoder. You always had to specify one, just that if you do -oac lavc, you get 224k mp2.



KIJIN posted 2006 Feb 14 06:34
K. Got that part at least.

Hope you guyz don't mind another question. I think (correct me if i'm wrong) that you can imbed subs on the avi file using mencoder. But I keep running into the same problem.

C:\>"c:\mplayer\mencoder.exe" "c:\W1.ogm" -alang 0 -oac mp3lame -sub "c:\W1.srt"
-ovc xvid -xvidencopts pass=1 -o "c:\W1.avi"

It works fine, but then it indicates :

[Ogg] Language for -sid 0 is '-slang "English[eng]"'
[Ogg] Language for -sid 1 is '-slang "English[eng]"'
VDec: vo config request - 640 x 480 (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: XviD (640x480 fourcc=44495658 [XVID])
xvid: par=0/0 (vga11), displayed=640x480, sampled=640x480
xvid: 2Pass Rate Control -- 1st pass
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.

The conversion works. But, no subs still.

I didn't find a /font directory in the mplayer directory. Do you have to DL another specific true type font file for it to work? Or did I use the wrong command?

Sorry to bother ya guyz.



subcomply posted 2006 Feb 17 22:17
KIJIN copy any true type font mine was in the windows font directory into the "mplayer" directory and rename it to subfont. Fixed it for me.


KIJIN posted 2006 Feb 18 08:59
If you you don't mind me asking, what was the exact name of the renamed font? "___.tff" ?


funnybunny posted 2006 Feb 21 01:06
go_yy :
hi... i got prob wit mencoder.... i try to follow ur instruction to copy subtitles and i had this prob as shown below..

C:\Documents and Settings\Used>"Desktop\mplayer\mencoder.exe" "c:\Program Files\
BitComet\Downloads\school rumble1-2\[WF-KAA]_School_Rumble_02.DVD(XviD.AAC)[55F0
8DB6].mkv" -oac mp3lame -ovc xvid -xvidencopts pass=1 -dumpsub -o "c:\Documents
and Settings\Used\Desktop\test.avi"
MEncoder 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 7)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
File not found: 'frameno.avi'
Failed to open frameno.avi
dumpsub is not an MEncoder option


can any1 help me???[/b]


I got a similar problem 2. Here's my code
:
C:\Documents and Settings\Owner>"C:\Program Files \mplayer\mencoder.exe" "c:\video\video.ogm" -oac mp3lame -ovc copy -o "c:\video\videooutput.avi"
MEncoder dev-CVS-051227-13:21-3.4.2 <C> 2000=2005 MPlayer Team
CPU: Intel Pentium 4/Celeron 4 Northwood; Pentium 4 EE/Xeon Prestonia, Gallatin <Family: 15, Stepping: 9>
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 0 SSE: 0 SSE2: 0
compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
89 audio & 203 video codecs
MPlyer was compiled without libmp3lame support.

Exiting... <error parsing cmdline>

C:\Documents and Settings\Owner>


CAn someone please help?



chaos_maiden posted 2006 Apr 03 18:15
Ok, before I get to my own issue: Kijin, if you haven't been able to fix your issue yet, I'd suggest using the method described in this topic: http://forum.videohelp.com/viewtopic.php?t=272736

But anyway, I have a rather nasty mkv file that I'm trying to convert to avi. It has h264 video, which is ugly, but I can deal with that, but the audio format is DTS. I have downloaded the newest version of ffdshow, which has DTS support, but mencoder still won't encode this file. I've also tried extracting the streams and using virtualdub, but mkvextractGUI doesn't support DTS and therefore won't extract the audio stream. Does anyone have any ideas on this?



romm posted 2006 May 07 22:13
any way to reduce the number of frames skipped sometimes? or... make it try not to skip at all.


celtic_druid posted 2006 May 08 04:02
add -noskip. Might not work on all mencoder builds though. Works with mine.


sp1rt posted 2006 Jul 29 21:23
Hi, I must keep AC3... what do i need to write to keep it from being convented to mp3 ??
:
add -noskip
Where ??
:
a52: CRC check failed!  )  12fps Trem:   0min   0mb  A-V:-0.039 [4719:223]
a52: error at resampling
a52: CRC check failed!  )  12fps Trem:   0min   0mb  A-V:-0.052 [4807:224]
What does that mean ??


celtic_druid posted 2006 Jul 30 04:28
To keep a stream just use copy. So for audio -oac copy.


EwanG posted 2006 Sep 05 14:19
Just a tip from someone who has been getting WAY too involved with Mencoder and FFMpeg lately (I have a couple Tivos, a PSP, and like Anime..) - If you have an MKV that you are trying to decode directly with ffmpeg, make sure to get the MKV patch from the maillist and rebuild ffmpeg with that.

Alternately, use mencoder first, and then ffmpeg. As long as you use high quality settings, you will not see that much difference from going through the double-step. In fact, using ffmpeg without mencoder first on many MKV and OGM files will leave you with a somewhat "jerky" video.

If you have more than one audio stream, for ffmpeg you want:
-map 0:0 -map 0:2
if you are using the first video and second audio stream.

For mencoder, however, you'd want:
-aid 1
because mencoder starts counting at 0. In both cases, the argument should be right after the input filename.

Hope this helps other folks as much as this thread has helped me.



flumpf posted 2007 Feb 12 16:25
This created an avi file that will not play on my system.


rosscarlson posted 2007 Mar 01 07:27
Same here. As a test I broke mplayer a few minutes in so I could see if the clip I created would play and look good. It did, looked great and sounded great. So I let it run for a few hours to finish but when it did the resulting file is unplayable. Here's the output from mencoder

---------------------------------------------------------------

C:\mencoder>mencoder.exe Heroes.S01E17.720p.HDTV.x264-CTU.mkv -oac mp3lame -ovc xvid -xvidencopts pa
ss=1 -o heroes.avi
MEncoder 1.0rc1-3.4.2 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 3.20GHz (Family: 15, Model: 3, Stepping: 4)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection.
This codecs.conf is too old and incompatible with this MPlayer release! at line 6
success: format: 0 data: 0x0 - 0x44a42af2
[mkv] Track ID 1: audio (A_AC3), -aid 0, -alang und
[mkv] Track ID 2: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Will play video track 2
Matroska file format detected.
VIDEO: [avc1] 1280x720 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x31637661 size:1280x720 fps:23.98 ftime:=0.0417
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
No accelerated IMDCT transform found
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
xvid: using library version 1.1.0 (build xvid-1.1.0)
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 - 1280 x 720 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
videocodec: XviD (1280x720 fourcc=44495658 [XVID])
xvid: par=0/0 (vga11), displayed=1280x720, sampled=1280x720
xvid: 2Pass Rate Control -- 1st pass
Writing header...
ODML: vprp aspect is 16:9.
Setting audio delay to 0.048s.
Writing header...
ODML: vprp aspect is 16:9.
Setting audio delay to 0.048s.
Pos: 0.0s 3f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.008 [0:0]
1 duplicate frame(s)!
Pos: 0.1s 5f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.017 [0:0]
1 duplicate frame(s)!
Pos: 1.1s 29f ( 0%) 19.92fps Trem: 0min 0mb A-V:0.084 [416:133]
Skipping frame!
Error while decoding frame!0.24fps Trem: 0min 0mb A-V:0.045 [416:133]
ODML: Starting new RIFF chunk at 1023MB. 45min 1516mb A-V:0.010 [4644:170]
Pos:2525.9s 60565f (99%) 7.34fps Trem: 0min 1621mb A-V:-0.002 [5200:172]
Flushing video frames
Writing index...
Writing header...
ODML: vprp aspect is 16:9.
Setting audio delay to 0.048s.

Video stream: 5200.823 kbit/s (650102 B/s) size: 1642149747 bytes 2525.984 secs 60565 frames

Audio stream: 172.063 kbit/s (21507 B/s) size: 54330048 bytes 2526.048 secs

---------------------------------------------------------------

Ideas???

Thanks,

Ross



EwanG posted 2007 Mar 01 08:01
rosscarlson :

This codecs.conf is too old and incompatible with this MPlayer release! at line 6


Probably not a good sign.

:

Pos: 1.1s 29f ( 0%) 19.92fps Trem: 0min 0mb A-V:0.084 [416:133]
Skipping frame!
Error while decoding frame!0.24fps Trem: 0min 0mb A-V:0.045 [416:133]
ODML: Starting new RIFF chunk at 1023MB. 45min 1516mb A-V:0.010 [4644:170]
Pos:2525.9s 60565f (99%) 7.34fps Trem: 0min 1621mb A-V:-0.002 [5200:172]
Flushing video frames
Writing index...
Writing header...
ODML: vprp aspect is 16:9.
Setting audio delay to 0.048s.


Definately not a good sign since it seems to be saying that it dumped everything from frames 416 to 4644...

I'd see if fixing the first option (i.e. make sure you get compatible releases of mencoder and MPlayer) might not fix the second.

FWIW,
Ewan



rosscarlson posted 2007 Mar 01 08:33
D'oh, guess I could look at my own output huh?

Ok, just downloaded the latest release of mplayer/mencoder - running a test now - will post back in a few hours...

Thanks,

Ross



rosscarlson posted 2007 Mar 02 07:11
Well I upgraded to the latest version of mplayer/mencoder but I'm still having no luck. The errors are gone, but with a different file I get the same results. What's odd is if I break it during the encoding it plays fine, it's only when I let it finish that I get a bad file.

I've tried leaving the audio intact and converting it to MP3. What I did realize is that the resulting file will play in the DivX player, just not in WMP. I need it to play in WMP so I can play it through Media Center in Vista. I don't want to install the CCCP on Vista as it is really buggy with just standard DivX/XviD files and crashed Media Center a lot. I've been using FFDShow on my media center box and that has been very stable.

Here's the output I'm getting:

:

C:\mencoder>mencoder.exe Lost.S03E10.720p.HDTV.x264-SAiNTS.mkv -oac mp3lame -ovc xvid -xvidencopts p
ass=1 -o lost.avi
MEncoder 1.0rc1-3.4.2 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 3.20GHz (Family: 15, Model: 3, Stepping: 4)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0x44cc940a
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang und
[mkv] Will play video track 1
Matroska file format detected.
VIDEO: [avc1] 1280x720 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x31637661 size:1280x720 fps:23.98 ftime:=0.0417
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
No accelerated IMDCT transform found
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
xvid: using library version 1.1.0 (build xvid-1.1.0)
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 - 1280 x 720 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
videocodec: XviD (1280x720 fourcc=44495658 [XVID])
xvid: par=0/0 (vga11), displayed=1280x720, sampled=1280x720
xvid: 2Pass Rate Control -- 1st pass
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Writing header...
ODML: vprp aspect is 16:9.
Setting audio delay to 0.048s.
Writing header...
ODML: vprp aspect is 16:9.
Setting audio delay to 0.048s.
Pos: 0.0s 3f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.008 [0:0]
1 duplicate frame(s)!
Pos: 0.1s 5f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.017 [0:0]
1 duplicate frame(s)!
Pos: 1.1s 29f ( 0%) 4.46fps Trem: 0min 0mb A-V:0.084 [4496:168]
Skipping frame!
Error while decoding frame!4.57fps Trem: 0min 0mb A-V:0.045 [4496:168]
Pos: 876.1s 21009f (35%) 5.91fps Trem: 107min 1544mb A-V:0.084 [5044:190]
Skipping frame!
Error while decoding frame!5.91fps Trem: 107min 1544mb A-V:0.046 [5044:190]
ODML: Starting new RIFF chunk at 1023MB. 48min 1480mb A-V:-0.074 [4670:185]
Pos:2544.0s 61001f (99%) 6.68fps Trem: 0min 1503mb A-V:-0.044 [4757:188]
Flushing video frames
Writing index...
Writing header...
ODML: vprp aspect is 16:9.
Setting audio delay to 0.048s.

Video stream: 4757.831 kbit/s (594728 B/s) size: 1513039837 bytes 2544.083 secs 61001 frames

Audio stream: 188.586 kbit/s (23573 B/s) size: 59977152 bytes 2544.288 secs


Any other thoughts would be GREATLY appreciated...

Thanks,

Ross



EwanG posted 2007 Mar 02 09:26
You're specifiying XVID as your video codec. If you want it to play in WMP you are going to need a WMP friendly codec. Not sure if WMP will let you install the free DiVX codec, particularly in Vista.

Personally, I always use mpeg2 since all of my playback devices support that. However you get some rather largish file sizes doing that.

FWIW,
Ewan



rosscarlson posted 2007 Mar 02 09:51
Ewan,

Thanks again for the help, and the quick help at that!

I am purposefully specifying DivX as I have ffdshow installed in Media Center and can play DivX just great, including some 720p DivX files that I have. It's just odd that the resulting file will play if I break the encode but not if I let it finish.

I'll try MPEG next, disk space isn't an issue at all so that would be fine. Do I just use -ovc mpeg (I'll look after I post this...)

Thanks,

Ross



EwanG posted 2007 Mar 02 10:52
Well, "I" run mencoder to get a smooth output from the originating MKV file, and then run ffMPEG to get the final version. So I generally don't try to watch what comes out of mencoder which may or may not relate to the problem you're having. IOW, it's possible I've been having the same problem you're having, but not noticing it because I always run the ffMPEG next, and so only watch the .mpg file.

In my case, I would take the AVI you created with mencoder and then shoot it to ffMPEG with:

"c:\program files\ffmpeg\ffmpeg.exe" -i "myfile.avi" -target ntsc-dvd -acodec mp2 -ab 192 -ac 2 -ar 48000 -b 4096 -r 29.97 -s 720x480 -vcodec mpeg2video "myfile.mpg"

YMMV,
Ewan



rosscarlson posted 2007 Mar 02 11:26
So what command line are you using for part 1? I'm happy to do both if that will work, of course that will take more time to do both but if the resulting file still looks great I'm fine with that...

Again thanks for all the help...

Ross



emmgunn posted 2007 Mar 16 20:12
I'm having trouble with .mkv files with h264 video and ac3 (or mp3 for that matter) audio using mencoder. I try -ovc xvid to convert the video and -oac copy to pass through the audio, and the result in the log file is a "1 duplicate frame(s)" message approximately every half second and eventually a "Too many audio packets in the buffer: (4100 in 2570449 bytes)" message and the process stops. I've tried all sorts of options like -noskip that I've found in my research of this problem, but I still get the duplicate frames. The best I could do was using the -mc 0 option which suppressed all but one "duplicate frames" messages but the end result was the same - the process stopped prematurely. I've included a copy of the log below. This one has me stumped. Any ideas would be appreciated.



MEncoder dev-SVN-rUNKNOWN-4.0.1 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz (Family: 6, Model: 15, Stepping: 6)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

success: format: 0 data: 0x0 - 0x4ac6a83
[mkv] Track ID 1: video (V_MS/VFW/FOURCC), -vid 0
[mkv] Track ID 2: audio (A_MPEG/L3), -aid 0, -alang eng
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [H264] 928x384 12bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x34363248 size:928x384 fps:23.98 ftime:=0.0417
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)
==========================================================================
audiocodec: framecopy (format=55 chans=2 rate=44100 bits=16 B/s=16000 sample-1152)
VDec: vo config request - 928 x 384 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.42:1 - prescaling to correct movie aspect.
videocodec: libavcodec (928x384 fourcc=34504d46 [FMP4])
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Pos: 0.0s 2f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0]
1 duplicate frame(s)!
Pos: 321.7s 7713f (68%) 77.48fps Trem: 0min 52mb A-V:0.000 [804:128]]
Too many audio packets in the buffer: (4100 in 2570449 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Flushing video frames.
Writing index...
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream: 804.716 kbit/s (100589 B/s) size: 32359265 bytes 321.696 secs 7713 frames



rosscarlson posted 2007 Mar 16 21:54
I'm having the EXACT same issue. Same exact situation - same exact results...

Any ideas anyone?



EwanG posted 2007 Mar 16 23:11
rosscarlson :
So what command line are you using for part 1?


Sorry for the delay, I've been out of town. Command line is:

:
"c:\program files\mplayer\mencoder.exe" "Your Video.mkv" -oac mp3lame -ovc xvid -xvidencopts pass=1 -o Your_Video.avi


Hope this helps!



rosscarlson posted 2007 Mar 17 09:18
Yup, that's what I'm using but I'm having the same issues that emmgunn is having. The odd thing is if I break it before the output completes the file plays fine.

What version of mencoder are you using, do you know?



lalitA04 posted 2007 Mar 20 07:40
I want to convert mpeg to avi with mjpeg yuvj420p codec, size 128x104 for my mobile phone but i didnot get any converter with yuvj420p codec please suggest the video converter for this codec I urgently need


Startropic1 posted 2007 Apr 02 23:22
In the guide you say to check the codecs in the mkv by opening the mkv in gspot. Well I did this (gspot v2.70) and gspot does not tell you what codecs are in the mkv. What program can I use to check the codecs in an mkv? :?:


Biglou13 posted 2007 Apr 13 13:08
I sucessfully converted from MKV to AVI. But!, the only player I can view the movie from is gmplayer.

VLC, Media Player Classic, Zoom PLayer Professional all pause when I select the movie


I set audio to MP3.

Any ideas why this is happening?

Thanks,

Louis



jolson posted 2007 Apr 14 14:04
emmgunn :
I'm having trouble with .mkv files with h264 video and ac3 (or mp3 for that matter) audio using mencoder. I try -ovc xvid to convert the video and -oac copy to pass through the audio, and the result in the log file is a "1 duplicate frame(s)" message approximately every half second and eventually a "Too many audio packets in the buffer: (4100 in 2570449 bytes)" message and the process stops.

It seems like your AC3 audio is 5.1, while mencoder thinks it's 128kbps 2-channel audio.

I'm interested in doing exactly the same conversion, but haven't found anything that really works for me...



Bonchick posted 2007 Apr 20 21:12
Hi.
I need somebody's help with mencoder. I'm encoding MKV to AVI files using old version alltoavi batcher with option of manually change comand. What I need is how to encode audio track #2 or if it says only languadge kind.
Here I have a comand:
mencoder "PATH\FILENAME.EXTENSION" -ovc copy -oac lavc -lavcopts acodec=mp3:abitrate=96 -o "PATH\cvt_FILENAME.avi"
What and to where should I add some change?



jester30 posted 2007 May 25 11:51
what command would i use to set the bitrate at 384kbps and the resolution reduced from 1280x720 down to 960x528???

thanks

jesse



kindredphantom posted 2007 Aug 22 11:22
Hi, i have converted a mkv file to avi following the instructions given in the topics first post but when i play the video the audio is out of sync with the video.
Does anyone have any idea how i can fix this? Should i try using a different audio codec?
These are the commands i used to convert.

:
"C:\Documents and Settings\User\Desktop\mplayer\mencoder.exe" "C:\Documents and Settings\User\Desktop\Live.Free.Or.Die.Hard.2007.DVDRip.R5.x264.VoRbis.MatRoska.NhaNc3.mkv" -oac mp3lame -ovc xvid -xvidencopts pass=1 -o "C:\Documents and Settings\User\Desktop\diehard4.avi"



G1ngerNinja posted 2007 Sep 12 15:19
OK for those having problems as I did with a MKV file that has H264/AVC and AC3 audio.

Here's my command that does work but requires the re-encoding of the audio I'm afraid.

mencoder -channels 6 -aid 0 -noskip -mc 0 cdd_x264_hd.mkv -ovc xvid -xvidencopts bitrate=<your bitrate> -oac lavc -lavcopts acodec=ac3:abitrate=<your bitrate> -o test.avi

For the person who asked about picking the right audio track if there is more than 1, well in the above example file I have 2 audio tracks and the "-aid 0" option in the above command picks out the 1st audio track of the 2.

Hopes this helps people out. If so let me know.

Also if anyone can figure out how to get "-oac copy" working without audio sync issues for AC3 I would be glad to know.
And if anyone knows how to get mencoder to use multiple threads for use with several CPU's I have 4 of them that would be nice too.

Cheers
G1ngerNinja

UPDATE:

Well it turns out that the centre audio channel ends up in the rear-right channel. So what I have managed to do instead is this:-
./mencoder -nosound -noskip -mc 0 s-disturbia/ccd_x264_hd.mkv -ovc xvid -xvidencopts bitrate=<your bitrate> -o ccd_x264_hd_1280_vidonly.avi

This gives us the video in xvid format without sound. Then we need to extract the original AC3 audio like this :-
mplayer ccd_x264_hd.mkv -aid 0 -dumpaudio -dumpfile ccd_x264_hd_1280.ac3

Then we need to mux the 2 together, I use AVIDEMUX which works a treat.

So hope this helps people out.



Morrac posted 2008 Feb 12 19:16
I am trying to convert an mkv file to an avi file and I am having trouble with mencoder.

I keep on getting a message that the -oac command does not exist. Is there something that I am missing?



45tripp posted 2008 Feb 12 20:06
do you realistically expect help with the amount of info you provided?

always provide command line used and resulting output.



necrobutcher posted 2008 Jun 10 16:52
sakuya_su :
try using a new mencoder GUI, which is alltoavi:

http://alltoavi.sourceforge.net

it converts ogm/mkv to avi using subtitle, has batch mode and subtitle/audio selection


niiice, lets you select language too. been looking for a free program like that for ages, just one problem and question though.

converted a video, set it to convert it in english... however now all of the sound is ridiculously out of sync. any idea how i remedy this? if i just play it as an MKV file the english audio is fine, but for some reason it went all out of sync while converting.



fijah posted 2008 Sep 24 22:33
I'm using OGG2AVI and the program works great but after burning the new avi file(which played perfectly on VLC Player) I then tried playing it on my dvd player and it wont play the avi file...I've also tried changing the mp3 bit rate both higher and lower....same thing...no luck. Any ideas on how to get this to work? I'm using a Toshiba SD-3990 DVD player. Any help would be greatly appreciated.


Baldrick posted 2008 Sep 25 02:48
fijha: I don't think ogg to avi reconverts to divx/xvid that your dvd player requires. Reconvert using WinFF or alltoavi instead.



Login/Register to our forum to be able to post here.








About   Advertise   Forum Archive   RSS Feeds   Statistics