Useful commands for FFmpeg

21 January 2021

Useful commands for FFmpeg

Here is a collection of various useful commands for FFmpeg that perhaps some day may come in handy for you. It also shows a tiny bit of the endless possibilities that FFmpeg has.

1. Extract frames as images from a video

ffmpeg -i video.mp4 filename%04d.jpg

2. Make video from a set of images

ffmpeg -framerate 25 -i ./filename%4d.png video.mp4

3. Extract xx seconds clip from a long video

ffmpeg -ss 00:00:55 -i video.mp4 -t 00:00:10 -vcodec copy -acodec copy videoclip.mp4

4. Extract an save audio from a video file

ffmpeg -i video.mp4 -vn -acodec copy audio.aac

5. Add audio to a video

ffmpeg -y -i video.mp4 -i audio.aac -c copy -map 0:v:0 -map 1:a:0 video-with-audio.mp4

6. Join two video side by side

  • for horizontal stacking of the videos
ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex hstack -c:v ffv1 output.mp4
  • for vertical stacking of the videos
ffmpeg -i ./sample-1.mp4 -i ./sample-out-image1.mp4 -filter_complex vstack -c:v ffv1 output.mp4

More coming soon!

Table of Contents

Leave a Reply

Your email address will not be published. Required fields are marked *

Similar Content

23 January 2021
Introduction to the new how-to article in the Knowledge Base.

I wrote a new guide on setting up your own live-stream server. Mostly due to your requests. I took the opportunity to simplify and shorten the guide a bit. If you follow this guide step by step, and use your brain a tiny bit, you'll be fine. This guide has so far been tested on […]

× Read More ×
19 June 2025
Choosing the live-stream host that suits your needs

Discover how to choose the right live-stream host for your organization. Compare popular platforms like DaCast, Wowza, Vimeo, Kick, ReStream and IBM.

× Read More ×
Copyright © 2025. 
All rights reserved.