Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Convert *.MKV to *.AVI

  1. #1
    Join Date
    Mar 2008
    Beans
    104

    Convert *.MKV to *.AVI

    I have a .mkv video file that I'd like to convert it to .avi format. How can I do it?

    Thanks in advance.

  2. #2
    Join Date
    Mar 2008
    Beans
    104

    Re: Convert *.MKV to *.AVI

    No one?

  3. #3
    Join Date
    Apr 2006
    Location
    Canada
    Beans
    68
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Convert *.MKV to *.AVI

    Hi Tasc0,

    Basically the strategy I would try is to dump the compressed video and audio out of the mkv file using mplayer, then mux the video and audio into an avi container using mencoder. Mencoder for me was tough to learn, but in the end it's a great tool. See http://www.mplayerhq.hu/DOCS/HTML/en...ing-guide.html for how to use it.

    In particular, see http://www.mplayerhq.hu/DOCS/HTML/en...d-mpeg4-muxing for the muxing instructions.

    But beware of audio synch issues, which could happen.

    Unfortunately I am not sure of the exact commands you must use. I can give it a try here but it might not work straight away. I'm assuming here the mkv contains mpeg3 audio and h.264 video. Just change the extensions to whatever you are using :

    Code:
    mplayer file.mkv -dumpaudio -dumpfile audio.mp3
    mplayer file.mkv -dumpvideo -dumpfile video.264
    
    mencoder -vf harddup -oac copy -ovc copy -o output_movie.avi -audiofile audio.mp3 video.264
    You may want to try other combinations of filters. I added harddup here because the mencoder doc strongly recommends it, but you could also try without it. Just delete -vf harddup if you don't want to use it.

    Hope it helps

  4. #4
    Join Date
    Nov 2006
    Beans
    1,134

    Re: Convert *.MKV to *.AVI

    The first question to ask here is: Why convert from MKV to AVI?

    If it is because you plan to play back the AVI on a DVD player, then just changing containers won't be sufficient. If the MKV contains streams incompatible with DVD players or even incompatible with AVI in general (e.g. H.264 video + Vorbis audio), you have to transcode them. You also have to transcode if the MKV contains high definition video exceeding 720x480 resolution, because that is the maximum supported by most DVD players. Another reason to transcode is if the MKV contains subtitles that you want to keep with the AVI etc. ... You get the idea.

    First find out what you have (i.e. what's inside the MKV), then find out what you want (DVD player compatibility?). Then we can show you how to get from A to B.

  5. #5
    Join Date
    Mar 2008
    Beans
    104

    Re: Convert *.MKV to *.AVI

    Quote Originally Posted by eye208 View Post
    The first question to ask here is: Why convert from MKV to AVI?

    If it is because you plan to play back the AVI on a DVD player, then just changing containers won't be sufficient. If the MKV contains streams incompatible with DVD players or even incompatible with AVI in general (e.g. H.264 video + Vorbis audio), you have to transcode them. You also have to transcode if the MKV contains high definition video exceeding 720x480 resolution, because that is the maximum supported by most DVD players. Another reason to transcode is if the MKV contains subtitles that you want to keep with the AVI etc. ... You get the idea.

    First find out what you have (i.e. what's inside the MKV), then find out what you want (DVD player compatibility?). Then we can show you how to get from A to B.
    That's correct, I'm trying to watch the video file on a DVD player. The file is 720p. Not really sure about the audio.

    I'll wait for your reply, thanks.

  6. #6
    Join Date
    Nov 2006
    Beans
    1,134

    Re: Convert *.MKV to *.AVI

    This will scale the video down to 480p and encode it as Xvid/MP3 AVI:
    Code:
    mencoder -mc 0 -noskip -vf expand=:::::16/9,scale=720:480,hqdn3d,harddup -ovc xvid -oac mp3lame -xvidencopts fixed_quant=3.8:me_quality=6:noqpel:nogmc:trellis:chroma_me:chroma_opt:hq_ac:vhq=4:lumi_mask:max_key_interval=300:quant_type=mpeg:max_bframes=2:closed_gop:nopacked:profile=asp5:autoaspect:bvhq=1 -lameopts vbr=2:q=6:aq=2 -o outfile.avi infile.mkv

  7. #7
    Join Date
    Mar 2008
    Beans
    104

    Re: Convert *.MKV to *.AVI

    Quote Originally Posted by eye208 View Post
    This will scale the video down to 480p and encode it as Xvid/MP3 AVI:
    Code:
    mencoder -mc 0 -noskip -vf expand=:::::16/9,scale=720:480,hqdn3d,harddup -ovc xvid -oac mp3lame -xvidencopts fixed_quant=3.8:me_quality=6:noqpel:nogmc:trellis:chroma_me:chroma_opt:hq_ac:vhq=4:lumi_mask:max_key_interval=300:quant_type=mpeg:max_bframes=2:closed_gop:nopacked:profile=asp5:autoaspect:bvhq=1 -lameopts vbr=2:q=6:aq=2 -o outfile.avi infile.mkv
    Thanks for the help. But why 480p?

  8. #8
    Join Date
    Nov 2006
    Beans
    1,134

    Re: Convert *.MKV to *.AVI

    Quote Originally Posted by Tasc0 View Post
    But why 480p?
    Because very few DVD players support 720p.

  9. #9
    Join Date
    Nov 2006
    Location
    Osijek, Croatia
    Beans
    12

    Re: Convert *.MKV to *.AVI

    Hello! Try WinFF.

  10. #10
    Join Date
    Mar 2008
    Beans
    104

    Re: Convert *.MKV to *.AVI

    Quote Originally Posted by eye208 View Post
    Because very few DVD players support 720p.
    Sorry for the delay. I tried this and I get the following error message:
    Code:
    xvid:[ERROR] frame rate must be <= 30 for the chosen profile
    FATAL: Cannot initialize video driver.
    Not really sure why's that.


    Quote Originally Posted by diggerOS View Post
    Hello! Try WinFF.
    I don't use Windows. Thanks anyways.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •