FFMPEG Movie Magic

FFMpeg: https://ffmpeg.org/ is an Extremely Ugly, Extremely *powerful* command line tool to process movies and stills.
My examplesa are for Linux, likely MACOS- Windows varies slightly.

Here are some of my most useful commands as a reference for Myself, really:

  • Break [MJPEG] Input Movie into single JPG still frames in the same directory:
    ffmpeg -i input.avi -vcodec copy frame%4d.jpg

    Convert between video types/containers:

    ffmpeg -i input.avi -c:v libx265 -c:a libfdk_aac output.mp4

    [h265 is super compressed, libfdk_aac is the highest quality AAC encoder you can use]

  • Above example, but Batch convert files into an (existing) folder “output” below this one, keeping main filename:
    for i in *.avi; do ffmpeg -i "$i" -c:v libx265 -c:a libfdk_aac./output/"${i%.*}.mp4"; done
  • Top Example, Batch, convert multiple videos into a huge collection of numbered frames  (for fun work re concatenating, etc) This will create: file1_0000.jpg (4 digitas count upward)
    file2_0000.jpg (same Story for file1.avi, file2.avi:
    for i in *.avi; do ffmpeg -i "$i" -c:v copy ./output/"${i%.*}_%3d.jpg"; done

Leave a Reply

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