Ahmad Tahboub Ahmad Tahboub - 1 year ago 53
Linux Question

FFmpeg cannot recognize a preset even though it does exsist Ubuntu 12.04

I have installed ffmpeg and x264 folloowing the steps in this documentation :http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide

Now I have this line to execute :

sudo /usr/bin/ffmpeg -i input_file.flv -f flv -vcodec libx264 -vpre normal -r 25 -s 0x0 -aspect 1.7777777777778 -padcolor 000000 -padtop 0 -padbottom 0 -padleft 0 -padright 0 -acodec libfaac -ab 128000 -ar 22050 output_file.flv

Input #0, flv, from 'WIN! Jwow.flv':
starttime : 0
totalduration : 101
totaldatarate : 865
bytelength : 10897460
canseekontime : true
sourcedata : BD58B2E43HH1338284027987695
purl :
pmsg :
Duration: 00:01:40.66, start: 0.000000, bitrate: 877 kb/s
Stream #0.0: Video: h264 (Main), yuv420p, 640x360, 745 kb/s, 29.97 tbr, 1k tbn, 59.94 tbc
Stream #0.1: Audio: aac, 44100 Hz, stereo, s16, 131 kb/s
**File for preset 'normal' not found**

I have the presets in the the following directories:


And still getting the same error: File for preset 'normal' not found

What is the problem here, Please Help!

Extra info - this is what i get when i do ffmpeg -version

ffmpeg version git-2012-05-31-60de761
built on May 31 2012 15:54:11 with gcc 4.6.3
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab


Answer Source

The good news is that you're using a recent ffmpeg and x264. The bad news is that you are using outdated syntax. FFmpeg development is very active and syntax changes do occur, the current syntax equivalent of your command is:

ffmpeg -i input_file.flv -vcodec libx264 -preset medium -crf 23 -acodec libfaac -aq 100 -ar 22050 output_file.flv

I removed all of the superfluous stuff. Why pad with a value of 0? What is resizing the output to 0x0? You don't need to change the frame rate in most cases so I removed -r as well.

I recommend using -aq (or -q:a, same thing different way of declaring it) instead of -b:a for libfaac when using libx264 with -crf. It's similar to faac -q 100 which is its default.

As for presets ffmpeg does not use text files to emulate the standard x264 presets anymore but now accesses them directly via libx264. See x264 --fullhelp for a list of presets but ignore the placebo preset as it is a complete waste of time. Basic usage is to use the slowest preset you have patience for.

I added the -crf option to control the video quality. Default value is 23. A lower value is a higher quality and a sane range is 18-24. Basic usage is to use the highest value that still gives you an acceptable quality. See FFmpeg: The ultimate Video and Audio Manipulation Tool for a more detailed explanation.