Learn
FFmpeg
Guides
Creative Use Cases

10 Creative Use-Cases of FFmpeg with Example Commands

FFmpeg is a versatile tool that can handle a wide range of multimedia operations. While it's commonly used for tasks like converting media files or streaming video, FFmpeg also supports a variety of creative use-cases. Here are 10 examples that showcase the power and flexibility of FFmpeg.

  1. Creating a Video Slideshow from Images: You can create a video slideshow from a series of images. Here's an example command that creates a video slideshow from images named img001.jpg, img002.jpg, etc.

    ffmpeg -framerate 1 -i img%03d.jpg output.mp4
  2. Adding a Timecode Burn-In: You can add a timecode burn-in to a video, which can be useful for editing or review purposes. Here's an example command that adds a timecode burn-in to a video:

    ffmpeg -i input.mp4 -vf "drawtext=fontfile=DejaVuSans-Bold.ttf: text='%{pts\:hms}': x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" output.mp4
  3. Creating a Video Thumbnail: You can create a thumbnail image from a video. Here's an example command that creates a thumbnail image at the 1-minute mark of a video:

    ffmpeg -i input.mp4 -ss 00:01:00 -vframes 1 output.jpg
  4. Extracting Audio Channels: You can extract individual audio channels from a video. Here's an example command that extracts the left audio channel from a video:

    ffmpeg -i input.mp4 -map_channel 0.1.0 output.wav
  5. Creating a Video Loop: You can create a video loop, which can be useful for creating background videos or GIFs. Here's an example command that creates a 10-minute loop of a short video:

    ffmpeg -stream_loop -1 -i input.mp4 -c copy -fflags +genpts -t 600 output.mp4
  6. Adding a Video Overlay: You can add a video overlay on top of another video. Here's an example command that adds a small video overlay in the top-right corner of a video:

    ffmpeg -i main.mp4 -i overlay.mp4 -filter_complex "[0:v][1:v] overlay=main_w-overlay_w-10:10:enable='between(t,0,20)'" -pix_fmt yuv420p -c:a copy output.mp4
  7. Creating a Picture-in-Picture Effect: You can create a picture-in-picture effect, which can be useful for video interviews or commentary. Here's an example command that creates a picture-in-picture effect:

    ffmpeg -i main.mp4 -i pip.mp4 -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'" -pix_fmt yuv420p -c:a copy output.mp4
  8. Adding a Soundtrack to a Video: You can add a soundtrack to a video. Here's an example command that adds a soundtrack to a video:

 ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4
  1. Creating a Slow Motion or Fast Forward Effect: You can create a slow motion or fast forward effect. Here's an example command that creates a slow motion effect:

    ffmpeg -i input.mp4 -vf "setpts=2.0*PTS" output.mp4

    And here's an example command that creates a fast forward effect:

    ffmpeg -i input.mp4 -vf "setpts=0.5*PTS" output.mp4
  2. Creating a Video from Text: You can create a video from text, which can be useful for creating simple animations or slideshows. Here's an example command that creates a 5-second video from a single line of text:

    ffmpeg -f lavfi -i color=c=black:s=1280x720:d=5 -vf "drawtext=text='Hello, World!':fontsize=30:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2" output.mp4

These are just a few examples of the creative use-cases of FFmpeg. With its powerful features and flexible command syntax, the possibilities are nearly endless.