Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

mkv to avi converter

  • 22-12-2010 11:46am
    #1
    Registered Users, Registered Users 2 Posts: 222 ✭✭


    hi folks

    anyone know a good program for converting mkv to avi files? I have a load of old movies in mkv that I'd like to convert to avi to work with an old media player.

    I'm using ubuntu and mint at home.

    thanks


Comments

  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    Now....I'm going to get a bit technical here: mkv's and avi's are both just a container. In the same way that zip and rar files are both containers.

    If you just want to keep the video and audio the same and switch from .mkv to .avi, ffmpeg is your friend:

    ffmpeg -i <input.mkv> -acodec copy -vcodec copy <outputfile.avi>

    .mkv files usually contain H264 encoded videos (though that's not always the case). If you want to convert the video type (as well as the container) I would recommend you have a look at avidemux (edit: If you want to convert the video type and you're doing a lot of files, you can also use ffmpeg, or mencoder (my favourite). It will just take a bit more flutin' to set up).


  • Registered Users, Registered Users 2 Posts: 222 ✭✭jackrussell007


    that sounds handier than I'd thought.

    when you say keep the audio and video the same.....is there an alternative? all I need to do basically is play these mkv movies I have on an old media player that plays avi (+a couple of other formats I'm sure)

    is this a command I can lang into terminal? If so then happy days
    ffmpeg -i <input.mkv> -acodec copy -vcodec copy <outputfile.avi>

    thanks for the help.


  • Closed Accounts Posts: 910 ✭✭✭Jagera


    I second ffmpeg. it is only excellent.


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    What are the chances the hardware will read the actual codec used to make the MKV?
    You might need to go a step further and reencode to DivX/Xvid/MPEG2


  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    Khannie wrote: »
    Now....I'm going to get a bit technical here: mkv's and avi's are both just a container. In the same way that zip and rar files are both containers.

    If you just want to keep the video and audio the same and switch from .mkv to .avi, ffmpeg is your friend:

    ffmpeg -i <input.mkv> -acodec copy -vcodec copy <outputfile.avi>

    .mkv files usually contain H264 encoded videos (though that's not always the case). If you want to convert the video type (as well as the container) I would recommend you have a look at avidemux (edit: If you want to convert the video type and you're doing a lot of files, you can also use ffmpeg, or mencoder (my favourite). It will just take a bit more flutin' to set up).

    Great solution. I always use ffmpeg. Though sometimes I fail to include the `-sameq` arg, so never forget. Or, you could forget like me by just using using a ffmpeg function/script.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    I like to use WinFF ..... it uses ffmpeg as its back end but essentially stores presets for the various output requirements.

    ... everything in one central location ... means I don't have to remember :D:D


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    On a simliar note, I want to convert some AVI files to other AVI files readable on a portable player. If I want to use xvid codec, resize and lower the bitrate what would be the syntax for FFMEG?


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    I managed to resize but it changed the codec from xvid to ffmpeg and the file was unreadable. I need to get the file from this format:

    somefile.avi: RIFF (little-endian) data, AVI, 624 x 352, 23.98 fps, video: XviD, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)

    to this format which is readable on the player:

    anotherfile.avi: RIFF (little-endian) data, AVI, 320 x 240, 20.00 fps, video: XviD, audio: MPEG-1 Layer 1 or 2 (stereo, 44100 Hz)

    I might need to lower the framerate slightly also.


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    I managed to do it fairly easily in avidemux but I'd like to be able to batch this and integrate it into my file manager as a script to copy and transcode a set of files.

    Does this sound about right?
    for vidfile in *.avi do
    ffmpeg -i "$vidfile" -acodec copy -vcodec libxvid -s 320x240 -r 20 /media/disk/VIDEO/"$vidfile_smaller"
    done
    


  • Registered Users, Registered Users 2 Posts: 37,316 ✭✭✭✭the_syco


    I'd like to convert to avi to work with an old media player.
    What's the make and model of the media player?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 5,303 ✭✭✭source


    If you don't want to use command line, use Arista Transcoder...It takes a bit of time but good results.

    I have had similar problem with an old media drive that wouldn't play .mkv's sorted with this.


  • Registered Users, Registered Users 2 Posts: 775 ✭✭✭roboshatner


    mkv is the bomb


  • Registered Users, Registered Users 2 Posts: 5,303 ✭✭✭source


    might be good but older players like mine don't recognise it...... so it can be as good as it wants but its still not going to be any use to me or the op.


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    I've made some files with ffmeg that appear to have exactly the same specs as the one I made with avidemux but my player still doesn't recognise it. Apart from file from the command line, what's good to use to check if a file matches certain criteria?


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    I've made some files with ffmeg that appear to have exactly the same specs as the one I made with avidemux but my player still doesn't recognise it. Apart from file from the command line, what's good to use to check if a file matches certain criteria?

    I use "mediainfo" ....... the CLi version produces more info than the GUI.
    $ mediainfo
    Usage: "MediaInfo [-Options...] FileName1 [Filename2...]"
    "MediaInfo --Help" for displaying more information
    


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    Comparing the two in mediainfo I see the codec is listed as mpeg-4 visual (Xvid) for the working file and just xvid for the borked one. What would I need to use in the ffmpeg command to get the same output? ffmpeg --formats has nothing nore suitable looking and I don't really understand the difference to be honest.

    Maybe mencoder would have a compatible codec?


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    Comparing the two in mediainfo I see the codec is listed as mpeg-4 visual (Xvid) for the working file and just xvid for the borked one. What would I need to use in the ffmpeg command to get the same output? ffmpeg --formats has nothing nore suitable looking and I don't really understand the difference to be honest.

    Maybe mencoder would have a compatible codec?

    It would be helpful to know what device you are trying to prepare the video for. Some apparently have specific requirements - codec, size etc.
    Do you have an example of a video that works on the device? Maybe run it by mediainfo and compare that with the file which does not play?

    Again I would come back to something like WinFF (or Sinthgunt), both of which have presets for using ffmpeg conversion, specifically composed for various devices and uses.
    Even if you did not wish to use the GUI you can get access to the complete commands used in the presets.

    regards.


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    It's an unbranded device, POS from china.
    As per my last post I compared a file I made with avidemux and which works fine with one I made using ffmeg and which is rejected, using mediainfo. The only discernable difference was the name of the codec - mpeg-4 visual (Xvid) in the file that reads and simply 'xvid' in the one which doesn't. The files have the same framerate (20fps), bitrate (95kbps), frame siwe (320*176) and autio codec (mps@44kHz stereo).

    There's probably an easy enough way to batch this through avidemux from the CLI but I was just curious as to why ffmeg wasn't creating valid files.

    Unfortunately it's all academic now as I can no longer use the media player :(


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    Unfortunately it's all academic now as I can no longer use the media player

    :D ain't life great! :)


  • Closed Accounts Posts: 2 dogxa


    does the Kmplayer works on ubuntu?:pac:


  • Advertisement
Advertisement