Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a 4.3 GB 720p movie and want to convert this MKV with DTS sound to MP4 video with AAC or AC3 audio.

I sometimes got "ffmpeg: unrecognized option '-c:v'" and "aac unrecognized" and other stuff.

I want this movie to have small size like those found on torrent sites.

share|improve this question
    
Can you help us please and give us the exact command you're using and the complete, uncut output that FFmpeg produces? Which operating system are you on? And lastly: Do you have to use FFmpeg? Please edit your question. –  slhck Oct 2 '12 at 18:48

2 Answers 2

Make sure you run the latest version of FFmpeg. For Windows and Linux, static builds are availabe from the homepage. For OS X, you can install FFmpeg through Homebrew.

Then, in the simplest case run:

ffmpeg -i input.mkv -c:v libx264 -c:a libfaac out.mp4

For controlling video quality, set the crf parameter, which defaults to 23. Lower means better quality, but higher file size. Try values between 19 and 26 to see what fits best. You can also set a certain bit rate, depending on which file size you want. Here, for example, 500 kBit/s:

ffmpeg -i input.mkv -c:v libx264 -crf 23 …
ffmpeg -i input.mkv -c:v libx264 -b:v 500k …

For audio, you can set quality or bit rate too. 100 is the default quality value and higher means better.

ffmpeg -i input.mkv  … -c:a libfaac -q:a 100 out.mp4
ffmpeg -i input.mkv  … -c:a libfaac -b:a 128k out.mp4

If libfaac is not available, I believe you can use aac instead, with the additional option -strict experimental.

Please read our blog post for more info: FFmpeg: The ultimate Video and Audio Manipulation Tool

share|improve this answer
    
    
You're missing a space between your filename and -c:v –  slhck Oct 3 '12 at 20:27
    
pastie.org/4905747 –  dale Oct 4 '12 at 1:45
    
As I said, make sure you run the latest version of FFmpeg (e.g. from ffmpeg.gusari.org/static) and try again. Your version is over three years old! –  slhck Oct 4 '12 at 6:01

MKV is just a container. You can have an mpeg-4 video inside of a .mkv container.

My suggestion is this:

push the file to a .mkv container:

mkvmerge -o newfile.mkv inputfile.m4v

Get the script available here: https://github.com/JakeWharton/mkvdts2ac3

Run this: mkvdts2ac3.sh newfile.mkv

Done! My TV supports AC3, but not DTS so this setup does wonders for me.

Please note that mkvdts2ac3.sh has some dependency requirements that are very basic. You'll see them when you run the script.

share|improve this answer
    
root@Frenzen:~/Downloads/2.Days.In.New.York.2012.720p.BluRay.X264- 7SinS# mkvmerge -o 7s-2days-in-ny-720p.mkv inputfile.m4v mkvmerge v3.0.0 ('Hang up your Hang-Ups') built on Dec 29 2009 00:24:14 Error: The source file 'inputfile.m4v' could not be opened successfully, or retrieving its size by seeking to the end did not work. root@Frenzen:~/Downloads/2.Days.In.New.York.2012.720p.BluRay.X264-7SinS# –  dale Oct 3 '12 at 1:04
    
Sounds like a corrupt input file. –  UtahJarhead Oct 3 '12 at 2:31
    
@dale Could you please include the output I asked you for in the comment on your original question? That would help us troubleshoot your issue. –  slhck Oct 3 '12 at 15:27
    
Also, UtahJarhead, the OP seems to want an MP4 result file from an MKV input file. He does not have an m4v file which is why your command doesn't work. Also, dale used the wrong syntax, specifying his existing file as output and giving inputfile.m4v as input, which obviously does not exist. –  slhck Oct 3 '12 at 15:31
    
mp4 is a codec, not a container. mkv is a container, not a codec. That's like saying they want to make a garage out of a Cadillac. What codec is the input .mkv file because that may make a difference. –  UtahJarhead Oct 3 '12 at 15:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.