i have xp and since i'm not familiar with compiling i downloaded win32-static version of ffmpeg, svn-r26251. i want to resize an mp4 (1280x720 originally) video to get a smaller file size with approximately same quality. My command is:
ffmpeg -i ma.mp4 -vcodec libx264 -vpre hq -s 640x360 ma2.mp4
however it says "file for preset 'hq' not found". i tried -fpre, made no difference. without libx264, the resulting file, ma2.mp4, won't play in jwplayer, you just hear audio. (the reason is that it is not "mpeg4(h264)", it is just "mpeg4"). what should i do?
This problem seems to be related to XP, it works on Win2K. I checked with filemon and it shows that it's looking in X:\usr\local\share\ffmpeg for files libx264-veryslow.ffpreset or veryslow.ffpreset - where X is the drive you are running ffmpeg from. I created the path on the drive, copied all presets in and now it works!
For x264 preset, instead of using "-vpre", the new builds will work with "-preset", as this will call the x264 preset directly.
ffmpeg says that it cannot find your preset file,
hq.ffpreset
in your case. more info in ffmpeg docs[EDIT] presets are just for convenience. if you have
hq.ffpreset
file so just take everything from it and put in command line directlySince you are running windows, unless you change your %HOME% variable, you will need to type the full path to "hq.ffpreset". It may be named "libx264-hq.ffpreset" instead. Also, this may or may not apply, but make sure that your build was made with libx264 support. If I knew if I was allowed to, I would link to my personal ffmpeg 1.2 shared build for win32. I can confirm that this command works with this version.
If you do not have the HQ preset file at all, I found a link to a version of it here: https://raw.github.com/joeyblake/FFmpeg-Presets/master/libx264-hq.ffpreset
Put this wherever you want (somewhere on %PATH% might work well).
Presented here are two solutions for Windows users to help FFmpeg find its x264 presets folder. Accompanying each solution is a batch file to automate the solution in its entirety.
Use only one of these solutions.
The first solution is easiest, but you will have to repeat it across every drive you wish to use FFmpeg on. If you do not wish to do that, use the second solution. It is a bit more complicated, but the batch file makes the process painless.
Again, do not use both solutions. I strongly favour Solution 2.
SOLUTION 1
FFmpeg looks for x264 presets in
C:\usr\local\share\ffmpeg
, a directory which needs to be created in Windows:C:\usr\local\share\ffmpeg
~ffmpeg\presets
into the new folder.Or run the following as a batch file:
Before you run this batch file be sure to change
C:\Program Files (x86)\ffmpeg\presets
to the current location of your~\ffmpeg\presets
folder.SOLUTION 2
FFmpeg looks for x264 presets in
%HOME%\.ffmpeg
, an environment which needs to be created in Windows:First, create two folders:
HOME
(in this example, I will locate it atC:\Users\your_user_name\HOME
};HOME
create another new folder named.ffmpeg
(note the period at the beginning of the filename);~\ffmpeg\presets
into the new folderC:\Users\your_user_name\HOME\.ffmpeg
your_user_name
to your actual usernameThen establish the folder
HOME
as an environment variable%HOME%
:Control Panel\System and Security\System
;Advanced system settings
(left side of window);Environment Variables
(button near bottom);New...
(under System Variables to make presets available to all users);Variable name:
enterHOME
Variable value:
enterC:\Users\your_user_name\HOME
your_user_name
to your actual usernameOr run the following as a batch file:
Before you run this batch file be sure to change
C:\Program Files (x86)\ffmpeg\presets
to the current location of your~\ffmpeg\presets
folder.ffmpeg project has been renamed to avconv and so the directory names have changed to reflect this. The documentation states:
This means it will now look into
$HOME/.avconv
and alsoPREFIX/share/avconv
which is normally/usr/share/avconv
.