Hello,
I'm trying to rip my DVDs into mkv file using only free codec. To confirm the stereotype of the linux user, I want to do it in command line. I've found mencoder which seems to be exactly what I need.
So I extract the video file :
mplayer -dvd-device /dev/hda -dumpstream dvd://1 -dumpfile myfile.vob
I've already extracted the two audio channel and subtitles I wanted and now I want to do the audio.
As I read on the net x264 seems to be a nice codec. I've read the Mplayer's manuel and made this command line
mencoder myfile.vob -o myfile.avi -ovc x264 -x264encopts subq=1:frameref=1:vpass=1 -nosound
here is the output
thank youCode:$ mencoder myfile.vob -o myfile.avi -ovc x264 -x264encopts subq=1:frameref=1:vpass=1 -nosound MPlayer SVN-r29809 (C) 2000-2009 MPlayer Team Option x264encopts: Unknown suboption vpass success: format: 0 data: 0x0 - 0x6f113000 MPEG-PS file format detected. VIDEO: MPEG2 720x576 (aspect 3) 25.000 fps 7000.0 kbps (875.0 kbyte/s) [V] filefmt:2 fourcc:0x10000002 size:720x576 fps:25.000 ftime:=0.0400 Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 0 ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat -1 Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2) ========================================================================== Movie-Aspect is 1.78:1 - prescaling to correct movie aspect. FATAL: Cannot initialize video driver. Exiting...
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 6 of 6
Thread
-
-
try mp4 instead of avi for the output
"Quality is cool, but don't forget... Content is King!" -
thank you for your answer but it doesn't change anything
I think I've found
mencoder video.vob -o video.avi -ovc x264 -x264encopts subq=1:frameref=1:pass=1:threads=auto -nosound
instead of
mencoder video.vob -o video.avi -ovc x264 -x264encopts subq=1:frameref=1:vpass=1:threads=auto -nosound
What's the difference ? With some commands I see that "pass" is used, "vpass" with others...
About the extension : does it really matter what I write ?
Because "-o video.avi" or "-o video.mp4" or even "-o video.abcd" seems to produce the same file
edit : ok now let's do the second pass
mencoder video.vob -o video.avi -ovc x264 -x264encopts subq=6:frameref=15ass=2:threads=auto -nosound
doesn't work either
Code:$ mencoder video.vob -o video.avi -ovc x264 -x264encopts subq=6:frameref=15:pass=2:threads=auto -nosound MPlayer SVN-r29809 (C) 2000-2009 MPlayer Team success: format: 0 data: 0x0 - 0x71426800 MPEG-PS file format detected. VIDEO: MPEG2 720x576 (aspect 3) 25.000 fps 7000.0 kbps (875.0 kbyte/s) [V] filefmt:2 fourcc:0x10000002 size:720x576 fps:25.000 ftime:=0.0400 Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 0 ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat -1 Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2) ========================================================================== Movie-Aspect is 1.78:1 - prescaling to correct movie aspect. x264 [info]: using SAR=64/45 x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 x264 [error]: constant rate-factor is incompatible with 2pass. x264_encoder_open failed. FATAL: Cannot initialize video driver. Exiting...
-
Originally Posted by n2turtles
2-pass encoding is one of several methods of controlling the average bitrate of the output file to be a specific value, or fairly close to it. You would want to do this if you're trying to produce a file of a specific size. ie. I know that my video file is 2700 seconds (45 minutes) long. If I want to produce a file that's about 350MiB in size, I'll have about 1062 kiB per second to spend on encoding both the audio and video. If I'm encoding the audio using 128kiB/s MP3, then that would leave me with 934kiB/s for encoding the video. In practice, you'd probably fudge that value slightly down to allow for the overheads of the container format and the index if present. The advantages of this is that you get files of a somewhat predictable size. On the downside, it can be difficult to predict the visual quality level of the encoded video. Depending on the bitrate specified, you may end up with poor quality for high motion video, or wasted bandwidth for low motion video. Note also that 2-pass encoding is just one of several methods for trying to achieve a predictable average bitrate. Other methods are constant bitrate encoding and 1-pass average bitrate encoding. 2-pass ABR usually does a better job in terms of quality as it has statistics from the first pass which allow it to make better choices on where to spend it's bit budget.
Constant rate factor encoding is a method of encoding the file with the goal of producing files with a predictable level of visual quality. It does this by managing the quantizer parameters for different frames in such a way as to produce a consistent quality level. The rate factor is a parameter that gives the encoder some idea of what level of quality is desired. A crf of 20 generally gives very high quality encodes. Higher numbers give reduced quality with 50 being the lowest quality possible. I'm currently working with a crf of 22 for near-DVD-quality video which seems to be working fairly well. A lower CRF will generally produce a larger file and a higher CRF will produce a smaller file, but it's impractical to the point of being virtually impossible to predict the final average bitrate or filesize with any degree of accuracy until the encode is completed. That said, I'm usually pleasantly surprised to find that it's much smaller than I probably would have selected myself and the video quality of H264 video at such low bitrates is still superb.
As for what's going on with your command line, you've not specified a bit rate but you're trying to use a mode of operation where the whole point is to control the average bitrate to be close to some specified value. My guess is that in the absence of any bitrate being specified, the encoder defaults to CRF mode with some sane value for the constant rate factor. CRF is a single pass encoding mode, so specifying pass=2 makes no sense, hence the error message. You're going to have to either specify a bitrate to use 2 pass encoding or else stick with CRF and then you only need 1 pass. -
Originally Posted by n2turtlesCode:
-of lavf -lavfopts format=mp4
Code:-of lavf -lavfopts format=matroska
That said, I wouldn't recommend it producing MKV or MP4 from mencoder. libavformat support in mencoder has been flakey at times and does not always produce files that will work in a wide variety of players. If you really want MP4 format files, I'd use ffmpeg, but that doesn't have some of the other features of mencoder, so it all depends. AVI may not be the most modern container format, but for a great many things it is more than sufficient.
Is there any specific reason why you want MKV files? From your initial post, it sounds like you're just trying to rip your DVD collection onto some kind of media server/video jukebox in which case, almost any container format is probably sufficient. If mencoder is going to be your transcoder of choice and you have no other requirements for the files, I'd stick with AVI format. -
Originally Posted by n2turtles
Similar Threads
-
MenCoder Command lines
By PsyDonias in forum Video ConversionReplies: 22Last Post: 19th Apr 2013, 07:59 -
Vob2mpeg pro command line doesn't work.
By Versiless in forum SVCD2DVD & VOB2MPGReplies: 0Last Post: 20th Feb 2012, 07:16 -
Mencoder doesn't work when called from PHP
By ApplePro in forum Video ConversionReplies: 0Last Post: 18th Jan 2008, 18:01 -
Mencoder 2-pass Command Line to flv
By mrready in forum Video ConversionReplies: 1Last Post: 16th Dec 2007, 03:25 -
Mencoder 2-pass Command Line to flv
By mrready in forum ffmpegX general discussionReplies: 2Last Post: 15th Dec 2007, 11:49