FFmpeg Commands at a Glance.

This post may contains affiliate links. As an amazon associate I earn from qualifying purchases.

ffmg

Quick Terminal Tools for Social Media Management — FFmpeg Included

If you find Python or coding overwhelming, I get it! That’s why sometimes, I use simple, efficient tools—including FFmpeg—that I run quickly from the terminal to manage my social media accounts.

“Python language is the king ! You talk about AI Learning Python in 2025 does makes a sense.”

Here’s what you’ll need to know to get started:

  • Basic terminal commands

  • Setting up a virtual environment

  • Installing necessary libraries

  • Running the scripts

I’ve compiled all these tools and instructions on a single page to make it easy for you to follow along and get things done quickly.


1. Sequence of images → video (30 FPS)

ffmpeg -framerate 30 -i img_%04d.jpg -c:v libx264 -pix_fmt yuv420p output.mp4

Creates a 30fps MP4 from numbered images like img_0001.jpg, img_0002.jpg


2. Single image held still for 8 seconds

ffmpeg -loop 1 -i image.jpg -c:v libx264 -t 8 -pix_fmt yuv420p -vf "scale=1280:720,format=yuv420p" output_still.mp4

Loops one image for 8 seconds at 1280×720.


3. Linear zoom-in (8s @ 30fps)

ffmpeg -loop 1 -i image.jpg -filter_complex "zoompan=z='zoom+0.001':d=240,format=yuv420p" -c:v libx264 -t 8 -r 30 -pix_fmt yuv420p output_zoom_in.mp4

Slow zoom in from 1× to ~1.24×.


4. Linear zoom-out

ffmpeg -loop 1 -i image.jpg -filter_complex "zoompan=z='if(lte(zoom,1.5),zoom-0.001,1)':d=240,format=yuv420p" -c:v libx264 -t 8 -r 30 -pix_fmt yuv420p output_zoom_out.mp4

Starts zoomed at 1.5× and slowly zooms out to 1×.


5. Pan left-to-right (no zoom)

ffmpeg -loop 1 -i image.jpg -filter_complex "zoompan=z=1:x='min((in/240)*(iw-ow),iw-ow)':d=240,format=yuv420p" -c:v libx264 -t 8 -r 30 -pix_fmt yuv420p output_pan_lr.mp4

Slides camera view from left to right.


6. Pan top-to-bottom (no zoom)

ffmpeg -loop 1 -i image.jpg -filter_complex "zoompan=z=1:y='min((in/240)*(ih-oh),ih-oh)':d=240,format=yuv420p" -c:v libx264 -t 8 -r 30 -pix_fmt yuv420p output_pan_tb.mp4

Slides camera view from top to bottom.

Also READ  Tools Needed When You Move To A New Home

7. Diagonal pan (top-left → bottom-right)

ffmpeg -loop 1 -i image.jpg -filter_complex "zoompan=z=1:x='min((in/240)*(iw-ow),iw-ow)':y='min((in/240)*(ih-oh),ih-oh)':d=240,format=yuv420p" -c:v libx264 -t 8 -r 30 -pix_fmt yuv420p output_pan_diag.mp4

Moves view diagonally across image.


8. Smooth ease-in zoom-in (exponential curve)

ffmpeg -loop 1 -i image.jpg -filter_complex "zoompan=z='1+ (1.5-1)*(pow(in/239,2))':d=240,format=yuv420p" -c:v libx264 -t 8 -r 30 -pix_fmt yuv420p output_smooth_zoom_in.mp4

Zoom starts slow, speeds up toward the end.


9. Ken Burns: zoom-in + pan left→right

ffmpeg -loop 1 -i image.jpg -filter_complex "zoompan=z='1+ (1.3-1)*(in/239)':x='min((in/239)*(iw-ow),iw-ow)':d=240,format=yuv420p" -c:v libx264 -t 8 -r 30 -pix_fmt yuv420p output_kenburns_lr_zoom.mp4

Zooms from 1× to 1.3× while panning left to right.


10. Ken Burns: zoom-out + pan top→bottom

ffmpeg -loop 1 -i image.jpg -filter_complex "zoompan=z='1.3-(0.3*(in/239))':y='min((in/239)*(ih-oh),ih-oh)':d=240,format=yuv420p" -c:v libx264 -t 8 -r 30 -pix_fmt yuv420p output_kenburns_tb_zoomout.mp4

Zooms out from 1.3× to 1× while panning top to bottom.


11. Extract frames from video

ffmpeg -i input.mp4 frame_%04d.png

Saves all frames as PNGs.


12. Convert image format

ffmpeg -i input.png output.jpg

Converts PNG to JPEG.


13. Animated GIF from images

ffmpeg -framerate 10 -i frame_%02d.png -vf "scale=320:-1:flags=lanczos" output.gif

Turns numbered PNGs into a GIF.


14. Animated GIF from video

ffmpeg -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos" output.gif

Makes a GIF from a video.


15. Overlay watermark/logo on video

ffmpeg -i base.mp4 -i logo.png -filter_complex "overlay=10:10" -c:v libx264 -pix_fmt yuv420p final_watermarked.mp4

Adds a logo at position (10,10).

 

This post may contains affiliate links. As an amazon associate I earn from qualifying purchases.

Scroll to Top