PDA

View Full Version : mkv to avi video converter?


itsANDREW
07-22-2010, 03:28 AM
I've been looking to put some videos onto my phone... but since it doesn't support .mkv format, I was wondering if anyone knew any good quality mkv to avi converters, preferrably free?

pthomas22
07-22-2010, 05:00 AM
http://www.dvdvideosoft.com/

The FreeStudio does lots of things and one is video conversion. No idea if it converts mkv but try it out

Or try this
http://www.sharewareguide.net/article/Tip/mkv-converter:-how-to-convert-mkv-file,-such-as-convert-mkv-to-avi%28divx,xvid%29.html

jabawok
07-22-2010, 07:04 AM
avidemux (avidemux.org) does the trick for me, and its free as in freedom, as well as money.

n900 lover
07-22-2010, 07:29 AM
i use mkv to vob.. its free too, but my n900 wont play hd or bluray rips for some reason.

Joorin
07-22-2010, 07:45 AM
Or you can use mencoder which comes as part of the mplayer package.

paulkoan
07-22-2010, 07:53 AM
This is my script, using ffmpeg and outputs to mp4 container rather than avi container (mp4 is a better option I think):


#!/bin/bash

outfile=$1
echo "output folder: $outfile"
mkdir -p $outfile
shift

while [ $# -ne 0 ]; do
echo "file = $1"
infile=$1
thefile="${infile%.*}"
mkvfile="$outfile/${thefile##*/}.mkv"
mp4file="$outfile/${thefile##*/}.mp4"
avifile="$outfile/${thefile##*/}.avi"
echo "mkv = $mkvfile"
echo "mp4 = $mp4file"
#ffmpeg -i "$infile" -s 800x480 -vcodec libx264 -vpre default -vpre baseline -crf 22 -acodec libfaac -ab 128k -ac 2 -f matroska "$mkvfile"
ffmpeg -i "$infile" -r pal -s 800x448 -vcodec mpeg4 -qmin 3 -qmax 5 -crf 22 -acodec libfaac -ab 128k -ac 2 -f mp4 "$mp4file"
# ffmpeg -i "$infile" -r pal -s 800x448 -vcodec mpeg4 -qmin 3 -qmax 5 -crf 22 -acodec libfaac -ab 128k -ac 2 -f avi "$avifile"

shift
done


To use it, save it as scriptname, and +x it

The format is

scriptname <outputfolder> <inputfile> [inputfile ...]

It will take each of the input files, convert them to mpeg4 + ac3 inside mp4 container and place them into "outputfolder". If you really want avi containers, then comment out the mp4 line and uncomment the following avi line.

If you are using Windows, then there are several converters available, but you may want to start with these settings, they are what I have had the most luck with in terms of performance on the n900.

I would totally welcome any input however...

itsANDREW
07-22-2010, 09:02 PM
avidemux (avidemux.org) does the trick for me, and its free as in freedom, as well as money.

could you please explain how to use this?

itsANDREW
07-22-2010, 09:07 PM
i'm looking at it and trying to figure out how to go from mkv to avi... but i really don't know how

itsANDREW
07-22-2010, 09:17 PM
This is my script, using ffmpeg and outputs to mp4 container rather than avi container (mp4 is a better option I think):


#!/bin/bash

outfile=$1
echo "output folder: $outfile"
mkdir -p $outfile
shift

while [ $# -ne 0 ]; do
echo "file = $1"
infile=$1
thefile="${infile%.*}"
mkvfile="$outfile/${thefile##*/}.mkv"
mp4file="$outfile/${thefile##*/}.mp4"
avifile="$outfile/${thefile##*/}.avi"
echo "mkv = $mkvfile"
echo "mp4 = $mp4file"
#ffmpeg -i "$infile" -s 800x480 -vcodec libx264 -vpre default -vpre baseline -crf 22 -acodec libfaac -ab 128k -ac 2 -f matroska "$mkvfile"
ffmpeg -i "$infile" -r pal -s 800x448 -vcodec mpeg4 -qmin 3 -qmax 5 -crf 22 -acodec libfaac -ab 128k -ac 2 -f mp4 "$mp4file"
# ffmpeg -i "$infile" -r pal -s 800x448 -vcodec mpeg4 -qmin 3 -qmax 5 -crf 22 -acodec libfaac -ab 128k -ac 2 -f avi "$avifile"

shift
done


To use it, save it as scriptname, and +x it

The format is

scriptname <outputfolder> <inputfile> [inputfile ...]

It will take each of the input files, convert them to mpeg4 + ac3 inside mp4 container and place them into "outputfolder". If you really want avi containers, then comment out the mp4 line and uncomment the following avi line.

If you are using Windows, then there are several converters available, but you may want to start with these settings, they are what I have had the most luck with in terms of performance on the n900.

I would totally welcome any input however...

as far as this script goes... you might have to explain more to me please. i have no experience whatsoever with linux, etc.

paulkoan
07-22-2010, 09:37 PM
AVIDemux:

Open the mkv file, and select AVI as the format in the last dropdown.

Make sure you are familiar with the differences between codecs and containers. The first two drop downs let you choose the codecs you want to use for video and audio. Most mkv files you might have will probably use h264 (may show up as AVC1 in the fourcc in the File/Information display) for video and ac3 for audio. If you are happy for these to be used (they are supported on n900) then leave these settings at copy. Otherwise choose the codecs you would like to use.

Then File/Save.

paulkoan
07-22-2010, 09:51 PM
as far as this script goes... you might have to explain more to me please. i have no experience whatsoever with linux, etc.

It may not be all that useful for you then. The majority of the script just deals with the file names and looping. The main thrust of the script is in the ffmpeg line:

ffmpeg -i "$infile" -r pal -s 800x448 -vcodec mpeg4 -qmin 3 -qmax 5 -crf 22 -acodec libfaac -ab 128k -ac 2 -f mp4 "$mp4file"


-i is the input file
-r is the frame rate (using PAL default framerate)
-s is the size. For 16:9 content, this seems to be the best option from the wiki, as it keeps all the horizontal information and puts small borders at the top and bottom (16/9 = 800/448 approx)
-vcodec is the video codec to use - I use mpeg4
-qmin = minimum quantiser
-qmax = max quantiser
-crf = constant rate factor

These three settings influence the quality and bitrate in ways I do not fully get. crf may not even be applicable to mpeg4

-acodec is the audio codec, I am using the libfaac codec for aac audio

-ab audio bitrate
-ac audio channels (2=stereo)

-f container format - here I use mp4

"$mp4file" - the last parameter to ffmpeg is the output file.

Video transcoding is a complex topic and I don't even approximate an expert.

itsANDREW
07-22-2010, 10:15 PM
It may not be all that useful for you then. The majority of the script just deals with the file names and looping. The main thrust of the script is in the ffmpeg line:

ffmpeg -i "$infile" -r pal -s 800x448 -vcodec mpeg4 -qmin 3 -qmax 5 -crf 22 -acodec libfaac -ab 128k -ac 2 -f mp4 "$mp4file"


-i is the input file
-r is the frame rate (using PAL default framerate)
-s is the size. For 16:9 content, this seems to be the best option from the wiki, as it keeps all the horizontal information and puts small borders at the top and bottom (16/9 = 800/448 approx)
-vcodec is the video codec to use - I use mpeg4
-qmin = minimum quantiser
-qmax = max quantiser
-crf = constant rate factor

These three settings influence the quality and bitrate in ways I do not fully get. crf may not even be applicable to mpeg4

-acodec is the audio codec, I am using the libfaac codec for ac3 audio

-ab audio bitrate
-ac audio channels (2=stereo)

-f container format - here I use mp4

"$mp4file" - the last parameter to ffmpeg is the output file.

Video transcoding is a complex topic and I don't even approximate an expert.

thanks for taking the time out to explain everything. but for the first explanation that you gave me, regarding the avidemux...

i left it on copy and tried copying it over in avi format, but it still says its not available. i'm trying mp3 now for audio and seeing if that works better. any recommendations on which formats i should use?

itsANDREW
07-22-2010, 10:16 PM
it keeps saying audio codec not supported, and no matter what, i can't see a thumbnail for it..

paulkoan
07-22-2010, 10:18 PM
it keeps saying audio codec not supported, and no matter what, i can't see a thumbnail for it..

It seems like the codec for audio in the source file is the one it has problems with.

If you look in File / Information, what are the codec details? You could post the whole thing here.

itsANDREW
07-22-2010, 10:22 PM
Video
Codec 4CC: AVC1
Image Size: 1280 x720
Aspect Ratio: 1:1 (1:1)
Frame Rate: 25.000 fps
Frame Count: 94598 frames
Total Duration: 01:03:03.920

Audio
Codec: AC3
Channels: Stereo
Bitrate: 24000 Bps / 192 kbps
Variable Bitrate: No
Frequency: 48000 Hz
Total Duration: 01:03:03:936


edit: for video codec, i've left it on copy but for audio i've tried copy AND mp3 with no use

paulkoan
07-22-2010, 10:36 PM
If you go to Help / Plugins is LibAC3 present in the Audio tab?

It is odd as I would expect with "Copy" it would just copy it whatever format it was.

What do you mean by "no thumbnail for it"? I can't see a place in avidemux where there are thumbnails for the codecs.

itsANDREW
07-22-2010, 10:40 PM
I see 00.00.01 LibAC3 decoder plugin for avidemux (c) Mean

And for the thumbnail, I meant within the N900.

PureEvil
07-22-2010, 11:04 PM
If you have Windows, I use Super C... converts anything I have thrown at it at least.

http://www.erightsoft.com/SUPER.html

itsANDREW
07-22-2010, 11:07 PM
I'm currently on Mac OS X

PureEvil
07-22-2010, 11:11 PM
I don't use Macs often, but perhaps you can give Handbrake a go, I think that will do what you want.

http://handbrake.fr/

paulkoan
07-22-2010, 11:25 PM
I see 00.00.01 LibAC3 decoder plugin for avidemux (c) Mean

And for the thumbnail, I meant within the N900.

Ok, well this question may be best answered by the avidemux people, perhaps try at their forums?

jbscurtis
07-22-2010, 11:46 PM
I don't use Macs often, but perhaps you can give Handbrake a go, I think that will do what you want.

http://handbrake.fr/

I have handbrake on my Vista machine. It works great. Easy to use too.

itsANDREW
07-22-2010, 11:57 PM
Trying that now... but it doesn't seem to allow output to .avi. Only mp4 or mkv

maxximuscool
07-23-2010, 12:11 AM
FormatFactory = FREE (Convert to anything you like)

PureEvil
07-23-2010, 12:26 AM
For your N900 mp4 would be perfect... that's what plays back best

itsANDREW
07-23-2010, 01:03 AM
Trying out Format Factory now.. thanks!

Even at MP4 though, it still tells me that something is not supported.

itsANDREW
07-23-2010, 01:06 AM
I just realized that it doesn't support Mac...