ffmpeg examples

February 18, 2013


Below are a few samples that I use on a regular basis.

Sample 1. Convert an avi file to an flv file (flash). ‘-sameq’ means keep same quality as source. in this example, the video file is G.avi. ‘-i’ means the input file follows. The output file is always the last file on the line.

Sample 2. Cut some time out of a video cut time out of a video (what I use to make 1 second long videos, can omit the start time)

Sample 3. the following will extract the bitmaps from the avi file and name them as images/000001.bmp and so on. the ‘%6d’ is a special character set that says make a number with a pattern of six digits. in this example a subfolder called ‘images’ has the bitmap files.

Sample 4.make a movie from individual bitmap frames with high quality using the bit rate control the frames are in the subfolder ‘movie’. the ‘0%d’ is a special character set thats look for files names that start with a zero followed by a number. For example movie/0001.png movie/0002.png.The ‘-b:v 4000k’ means set the encoding bit rate to variable with a peak rate of 4 megabits/second. to make the file size smaller, drop down below 4mpbs, the lower the number the more lossy. to make the file size larger, and less lossy, increase the peak bit rate.

Sample 5. crop to 720×480 with upper left stating at position 67,67, force video codec to h264

Entry filed under: Image Processing. Tags: .

Implementation of a Laplacian filter WPF 3D Video Example using DiffuseMaterial and MediaElement