Ubuntu% ffmpeg -i video.mpg -f mp4 -vcodec libx264 -vpre default -an -threads 0 video.mp4Īs the name implies, settings are default values and generate a video compliant with the ' Main' H.264 profile. Here, I will encode a 3-minute MPEG video to H.264 using each of the available presets.Īudio encoding is disabled (' -an') and we let ffmpeg decide how many threads to run (' -threads 0'). Now let's look at the different preset files and run some tests. Ubuntu% ffmpeg -i video.mpg -vcodec libx264 -vpre ~/myPresets/libx264-normal.ffpreset video.mp4 Ubuntu% ffmpeg -i video.mpg -vcodec libx264 -vpre normal video.mp4Īlternatively, you can set it to the full path to the preset file (useful if you don't want to keep them in ~/.ffmpeg) So how do you use a preset file? Just set the ' -vpre' flag after the ' -vcodec' flag (the flag order does matter): You really don't need to understand all these flags: the main reason for these preset files is obviously to define a number of typical x264 configurations which can be used out of the box. this detailed list of x264 flags, and I guess this guide too,ĭon't worry, though.this mapping guide written by one of the ffmpeg developers,.To ease the pain of translating and understanding these flags, you will certainly need: Keep in mind that these are ffmpeg flags (not x264 flags), so although they really are meant to configure the x264 encoding process, they differ from the actual flags that you would pass directly to the x264 encoder. Ouch! Welcome to the wonderful world of H.264 encoding ) Partitions=+parti8x8+parti4x4+partp8x8+partb8x8 What do you find in a preset file? Well, a long list of ffmpeg flags related to H.264 encoding: Let's copy these to your ffmpeg configuration directory: Libx264-fastfirstpass.ffpreset libx264-max.ffpreset Libx264-default.ffpreset libx264-hq.ffpreset libx264-normal.ffpreset Just head for the ffmpeg source and look at the ffpresets directory: Wouldn't it be nice to store your favorite options in a configuration file once and for all? Yes it would and yes you can! As discussed earlier, the ffmpeg command line can be quite daunting, especially when used to encode x264 video.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |