Basic Video Transcoding Options in FFmpeg
Here are some of the basic video options that you might need frequently while using ffmpeg on various video files. For the transonding options of an audio file, refer this article. And you might get some help regarding basic FFmpeg here.
Set the bitrate of a video file using FFmpeg
-b <value> This options sets the bitrate of a video file. e.g.
[shredder12]$ ffmpeg -i input.avi -b 200k output.avi
Set the Frame rate of a video file
-r <value> This option is used to set the frame rate.
Set the size or resolution of a video file
-s <resolution> is used to specify the resolution of the output file. The basic syntax is
[shredder12]$ ffmpeg -i input.avi -s 1024x768 output.avi
You can even use abbreviations in place of the actual resolution. e.g "-s xga" in place of 1024x768 above. You can find more about the abbreviations here.
Set the aspect ratio
-aspect <ratio> is used to specify the aspect ratio of the output file. A common usage could be.
[shredder12]$ ffmpeg -i input.avi -aspect 4:3 output.avi
In order to get this ratio, the video will be stretched either along the width or the height.
Howto cropping and padding videos using FFmpeg
Refer these articles for cropping and padding.
Remove the video recording or stream from a media file.
-vn This option ensures that there is no video stream in the output file and also all the video related options are negated.
Specify video codec to be used by FFmpeg
-vcodec <codec> This is similar to the audio codec option "acodec". Specify the codec you want to use for video transcoding and FFmpeg will use it. The default codec is based upon the output file format.
Well, if you are not looking for a specific codec then I would suggest you to go for open video format theora. This format doesn't have any legal crap and is pretty good too. You can do the conversion like this.
[shredder12]$ ffmpeg -i input.avi -vcodec libtheora output.ogv
Althoug, you don't have to mention the video codec until you are using the proper format. You can find a little more about video conversion here.



























Post new comment