Quick Guide to FFMPEG commands

  • by asg_labsadmin
  • 0 comments

FFMPEG is the swiss knife of multimedia processing tools. I have spent a lot of time exploring and testing it for my projects. Below are some of the commands I found useful and hence sharing for everyone:

1) To get video frames:
ffmpeg -i byebye.mp4 -vframes 1 -r 1 -f image2 image-%3d.jpeg

2) To clip video:
ffmpeg -i movie.mp4 -ss 00:00:03 -t 00:00:08 -async 1 cut.mp4

3) Fade in:
ffmpeg -i test01.mp3 -af “afade=t=in:ss=0:d=4” test02.mp3

4) Fade out:
ffmpeg -i test02.mp3 -af “afade=t=out:st=65:d=5” test03.mp3

5) Converting flv to png frames while maintaining transparency
ffmpeg -i video.flv -r 25 -vcodec png -pix_fmt rgb32 %d.png

6) Converting video to images
ffmpeg -i video.xxx -r 25 %d.xxx

7) Converting images to video
ffmpeg -f image2 -i %d.xxx video.xxx

8) Extracting sound from video
ffmpeg -i video.xxx -vn -ac 2 -ar 44100 -ab 320k -f mp3 audio.xxx

9) Get video information
ffprobe -print_format json -show_format -show_streams video.xxx

Let us know your thoughts: