Ffmpeg: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= Overview = Ffmpeg is a powerful tool for handling multimedia files and compiling videos from the command line.") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
= Overview = |
= Overview = |
||
[http://ffmpeg.org/ FFmpeg] is a powerful tool for handling multimedia files and compiling videos from the command line. It is extremely versatile and allows the user control over many aspects of the encoding process. |
|||
= Mobile Device Compatiblity = |
|||
Media is digested increasingly through mobile phones and tablet devices. Therefore, it is important to be aware of possible compatibility issues when encoding videos for these devices. |
|||
Here is a command that compiles a series of .png images into a .mp4 video that is compatible with Android and Apple devices (see links at the bottom for more detailed information). |
|||
<code> |
|||
ffmpeg -i mov%5d.png -vcodec libx264 -profile:v baseline -level 3.1 -pix_fmt yuv420p -crf 20 -g 250 -r 20 output.mp4 |
|||
</code> |
|||
'''''Some notes on the above command:''''' |
|||
* compiles .png files named movXXXXX.png, where XXXXX are sequentially numbered strings of 5 digits starting from 00001 |
|||
* the -profile:v command, and the accompanying -level command, ensure compatibility with iPhone/iPad. Different profiles and levels, as detailed [https://trac.ffmpeg.org/wiki/Encode/H.264 here], can be used which result in varying levels of compatibility and video compression quality. |
|||
* -pix_fmt yuv420p must be used to ensure that FFmpeg uses a correct color formatting for these devices (''this command should be researched further, esp. for how it relates to video quality'') |
|||
* -crf (constant rate factor) specifies the compression quality desired (i.e., how lossy your video will be). The command takes a single number between 0 and 51 as an argument, with 0 corresponding to no loss and 51 to the greatest amount of loss. The value 23 is the default, and the range 18-28 contains typical values. A value of 18 is not lossless but should be visually equivalent (or nearly equivalent) to a lossless video. Smaller numbers will result in better quality videos at the expense of larger file sizes. |
|||
* -r controls the framerate of the video (frames/second) |
|||
= Links = |
|||
*[http://ffmpeg.org/ FFmpeg Main Webpage] |
|||
*[http://trac.ffmpeg.org/wiki FFmpeg Wiki] |
|||
*[http://trac.ffmpeg.org/wiki/Encode/H.264 Notes on encoding H.264 video for iPhone/iPad compatibility] |
Latest revision as of 16:17, 22 February 2015
Overview
FFmpeg is a powerful tool for handling multimedia files and compiling videos from the command line. It is extremely versatile and allows the user control over many aspects of the encoding process.
Mobile Device Compatiblity
Media is digested increasingly through mobile phones and tablet devices. Therefore, it is important to be aware of possible compatibility issues when encoding videos for these devices. Here is a command that compiles a series of .png images into a .mp4 video that is compatible with Android and Apple devices (see links at the bottom for more detailed information).
ffmpeg -i mov%5d.png -vcodec libx264 -profile:v baseline -level 3.1 -pix_fmt yuv420p -crf 20 -g 250 -r 20 output.mp4
Some notes on the above command:
- compiles .png files named movXXXXX.png, where XXXXX are sequentially numbered strings of 5 digits starting from 00001
- the -profile:v command, and the accompanying -level command, ensure compatibility with iPhone/iPad. Different profiles and levels, as detailed here, can be used which result in varying levels of compatibility and video compression quality.
- -pix_fmt yuv420p must be used to ensure that FFmpeg uses a correct color formatting for these devices (this command should be researched further, esp. for how it relates to video quality)
- -crf (constant rate factor) specifies the compression quality desired (i.e., how lossy your video will be). The command takes a single number between 0 and 51 as an argument, with 0 corresponding to no loss and 51 to the greatest amount of loss. The value 23 is the default, and the range 18-28 contains typical values. A value of 18 is not lossless but should be visually equivalent (or nearly equivalent) to a lossless video. Smaller numbers will result in better quality videos at the expense of larger file sizes.
- -r controls the framerate of the video (frames/second)