VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. I have been searching for a converter from DiVX to MPEG2 for linux, as i want to rip my DiVX collection back to DVD.

    I have been unable to find anything. Anyone know of one?

    Thx
    Quote Quote  
  2. I have found the best way to go about converting formats is to start with MPlayer and messing with the -vo and -ao flags. Also, -dumpaudio helps too. I have converted a few DiVX (AVI) to MPEG1 and MPEG2 suitable for either VCD or SVCD using two methods.

    The first (extremely slow) way: Get the MJPEG tools from http://mjpeg.sourceforge.net/. I highly recommend moving the DiVX you want to convert into a temporary directory and working there. In the temp directory create a FIFO file using the command
    Code:
    mkfifo stream.yuv
    This is needed because MPlayer outputs to "stream.yuv" and not a pipe suitable for the MJPEG tools. Now you want to start the MPlayer command like so:
    Code:
    mplayer -vo yuv4mpeg -ao null example.avi
    Now you need to start the MJPEG conversion process. You might need to mess with this since you are creating DVDs and not SVCD, but the process should be similar.
    Code:
    cat stream.yuv | yuvscaler -O SVCD | mpeg2enc -f 4 -s -r 16 -o video.mpg
    You can tweak the parameters for quality/speed. Now you should have a MPEG2 stream in "video.mpg". What needs done now is to convert the audio track(s) into a suitable format and multiplex them into a final MPEG. I suggest executing MPlayer on the DiVX and looking at the audio stream. It is likely an acceptable format (unless it is perhaps Ogg Vorbis). You most likely do not want to reencode the audio to avoid loss of quality. If the format is suitable, simply run mplayer -dumpaudio example.avi. For multiplexing you have two options that I know of. "mplex" which comes with MJPEG tools, or "tcmplex" which comes with the Transcode tools (google transcode). Either should work, but if you have sync issues with mplex and it exits from errors try using tcmplex. tcmplex will continue on with errors, though the result might not play correctly or might have fast forward/reverse issues. Make sure you use the correct mode with tcmplex (-m) or mplex (-f), otherwise you will surely get sync errors.

    Now that you have a MPEG2 it is up to you to figure out how to get it on a DVD. I have zero experience in DVD writing. You might want to try using vcdimager and create a DVD-SVCD.

    The second method of conversion (and extremely faster) is using FFmpeg (http://ffmpeg.sourceforge.net/). A word of warning: the MPEG files produced by ffmpeg are "funny," in that many utilities such as mplex/tcmplex/vcdimager do not like them. But it is soooo much faster. And the quality is great too. Since the MPEG files are weird, you must get another utility called "mpgtx" (google mpgtx). This is a wonderful utility that _can_ work on the funny MPEG files produced by ffmpeg. What you do is demultiplex the funny MPEG using mpgtx with the "-d" flag. The resulting video.m1v file works fine with mplex and tcmplex. Now you simply multiplex with mplex/tcmplex into the final MPEG2. Also, ffmpeg has no simple mode selection like yuvscaler, etc. You have to specify the exact parameters for (S)VCD, etc. Look at the DVD section on vcdhelp.com to see valid formats. I made a lovely coaster by not doing this

    I hope this helps. I'm still learning the ropes in Linux video, but I have figured out a few things here and there. Keep in mind that almost anything MPlayer can read can be converted to a format suitable for many DVD players (i.e. MPEG stream with Ogg Vorbis audio track(s), etc.)
    Quote Quote  
  3. I almost forgot... ffmpeg only encodes to MPEG-1. The section DVD on vcdhelp.com says MPEG-1 is okay. You might get bigger file sizes or lower quality with MPEG-1 over MPEG-2. You either spend a number of hours to days with MJPEG tools and MPEG-2, or use the faster ffmpeg with MPEG-1. I'd just make a small sample of each and compare quality/size and speed if that matters to you.
    Quote Quote  
  4. Member
    Join Date
    Aug 2002
    Location
    Devnter, The Netherlands
    Search Comp PM
    Small Tip:

    If you are going to try ffmpeg, then use the cvs version (0.4.6).
    It has the -vcd option and using that you get a less "funny" mpeg
    Vcdimager has less problems with mpeg files created with ffmpeg using that option
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!