ffmpeg

Examples

ffmpeg -i input.flv

...will give information about the file



ffmpeg -i inpuvvideofile.flv -ab 128k outputaudiofile.mp3

... will convert the audio channel to mp3 (128bps)



ffmpeg -i inpuvvideofile.flv -acodec copy outputaudiofile.mp3

... if the audio channel is mp3, we can simply copy it.



ffmpeg -ss 00:00:30.00 -t 25 -i bar.mp3 -acodec copy bar-new.mp3

... cut the mp3 file from 30sec creating a 25sec. long chunk.



ffmpeg -i thexvidinputfile.avi -target dvd -aspect 16:9 -sameq theoutputfile.mpg

... convert to DVD



ffmpeg -i input.mts -vcodec libvpx -b:v 15M -acodec libvorbis -b:a 192k output.webm

... convert .MTS file to WebM (VP8) .webm



ffmpeg -i input.mts -vcodec h264 -acodec libvo_aacenc output.mp4

... convert .MTS file to "web-standard" h264 .mp4



ffmpeg -i input.mp4 -vframes 1 -s 640x360 -vcodec png output.png

... creates a single .png thumbnail from input.mp4 in 640x360 format



ffmpeg -i input.mp4 -ss 00:00:00.00 -t 96 -c copy output.mp4

... copies the first 96 secons of input.mp4 as output.mp4 without reencoding



ffmpeg -i input.mp4 -ss 00:00:15 -to 00:00:25 -c copy output.mp4

... copies using the start end to timestamps



for i in ./*.flac; do ffmpeg -i "$i" -qscale:a 0 "${i[@]/%flac/mp3}"; done

... convers all .flac files in the directory to .mp3



ffmpeg -f concat -safe 0 -i files.txt -c copy joinedvid.mp4

... concats several video files (listed in files.txt) into one



ffmpeg -loop 1 -i input.jpg -i input.mp3 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:-1:-1:color=black,setsar=1,format=yuv420p" -shortest -fflags +shortest output.mp4

... makes a video from input picture and mp3 file

2026-04-11 10:49:17

minicms - © 2020-2026 Simeon Simeonov