ffmpeg h264 problem: "File for preset ... not found" on XP
Asked Answered
T

6

9

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?

Topless answered 31/1, 2011 at 21:1 Comment(1)
wouldn't downvoter mind to indicate what's wrong with the question?Vallee
D
21

For x264 preset, instead of using "-vpre", the new builds will work with "-preset", as this will call the x264 preset directly.

Distillation answered 8/7, 2012 at 16:50 Comment(0)
B
1

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!

Burst answered 12/3, 2011 at 21:39 Comment(0)
V
0

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 directly

Vallee answered 31/1, 2011 at 21:17 Comment(2)
there is a preset folder and all preset files are in this folder... i try to manually enter the preset file as described in documentation using "-fpre" but nothing changed. i tried following command: ffmpeg -i ma.mp4 -vcodec libx264 -fpre "C:\ffmpeg\presets\libx264-baseline.ffpreset" ma2.mp4Topless
I had the same issue in the later version of ffmpeg on Windows 7. I tried -fpre and -vpre and whatever else I could think of. Nothing worked so had to use -vprofile. Not sure that will work with hq though. For customizations, I used x264 command line args.Ishmael
I
0

ffmpeg project has been renamed to avconv and so the directory names have changed to reflect this. The documentation states:

First ffmpeg searches for a file named arg.ffpreset in the directories ‘$FFMPEG_DATADIR’ (if set), and ‘$HOME/.ffmpeg’, and in the datadir defined at configuration time (usually ‘PREFIX/share/ffmpeg’) or in a ‘ffpresets’ folder along the executable on win32, in that order. For example, if the argument is libx264-max, it will search for the file ‘libx264-max.ffpreset’.

This means it will now look into $HOME/.avconv and also PREFIX/share/avconv which is normally /usr/share/avconv.

Ingratitude answered 1/6, 2012 at 16:35 Comment(0)
K
0

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:

  • Create a folder C:\usr\local\share\ffmpeg
  • Copy all of your preset files from ~ffmpeg\presets into the new folder.

Or run the following as a batch file:

    ::BEGIN SOLUTION 1 BATCH FILE
    md C:\usr\local\share\ffmpeg
    copy "C:\Program Files (x86)\ffmpeg\presets" C:\usr\local\share\ffmpeg
    ::END SOLUTION 1 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:

  • Create the folder HOME (in this example, I will locate it at C:\Users\your_user_name\HOME};
  • Within the folder HOME create another new folder named .ffmpeg (note the period at the beginning of the filename);
  • Copy all of the preset files from the folder ~\ffmpeg\presets into the new folder C:\Users\your_user_name\HOME\.ffmpeg
  • Remember to change your_user_name to your actual username

Then establish the folder HOME as an environment variable %HOME%:

  • Open an explorer window;
  • Navigate to Control Panel\System and Security\System;
  • Select Advanced system settings (left side of window);
  • Select Environment Variables (button near bottom);
  • Select New... (under System Variables to make presets available to all users);
  • In Variable name: enter HOME
  • In Variable value: enter C:\Users\your_user_name\HOME
  • Remember to change your_user_name to your actual username

Or run the following as a batch file:

    ::BEGIN SOLUTION 2 BATCH FILE
    md %userprofile%\HOME
    md %userprofile%\HOME\.ffmpeg
    copy "C:\Program Files (x86)\ffmpeg\presets" %userprofile%\HOME\.ffmpeg
    setx HOME %userprofile%\HOME\ /m
    ::END SOLUTION 2 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.

Kahlil answered 28/1, 2013 at 8:35 Comment(1)
it seems ffmpeg trying to read the presets from developer's computer! to be exact from \home\kyle\software\ffmpeg\builds\win64\static\ffmpeg-3.2-win64-static\share\ffmpeg\libx264-*.avpreset file and doesn't make any attempt to look into any of those folders suggested above. same happens for all versions 3.2 and aboveChaldea
N
0

Since 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).

Nada answered 5/9, 2013 at 15:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.