Skip to content

Instantly share code, notes, and snippets.

@or9
Created July 25, 2022 02:19
Show Gist options
  • Save or9/a2cadc3772166cacaf1510bdaaae1e87 to your computer and use it in GitHub Desktop.
Save or9/a2cadc3772166cacaf1510bdaaae1e87 to your computer and use it in GitHub Desktop.
ffmpeg combine photos into video
#!/bin/sh -e
# Just the base command required to run ffmpeg docker image
# Probably need to append additional arguments such as
# -i input_file.ext
# -parm1 arg
# -parm2 arg
# output_filename.ext
docker run \
-v "$(pwd):$(pwd)" \
-w "$(pwd)" \
jrottenberg/ffmpeg \
-stats \
"$@"
#!/bin/bash
MSYS_NO_PATHCONV=1 ffmpeg.sh \
-framerate 6 \
-pattern_type glob \
-i '*.jpg' \
-y \
out4.mp4
#!/bin/bash
# blend frames rather than using mci
# mci (motion compensated interpolation)
# mci probably needs additional frames and processing to be useful
# since it seems to produce really trippy videos from photos
# using blend
MSYS_NO_PATHCONV=1 ffmpeg.sh \
-i "acc 09 2021 south 4.mp4" \
-filter:v "minterpolate='fps=30:mi_mode=blend',setpts=2*PTS" \
-y "acc 09 2021 south 4 mint.mp4"
# Alternatively, mci
# Ensure you use filter:v so it only tries to process the video track (in case there's audio)
# Ensure you do "scale=NUM_SMALLER_THAN_4000:-1" first (before minterpolate) because
# minterpolate can only process 4,000 something pixel (width? height?) frames,
# and larger values will cause a really stupid, meaningless error.
# MSYS_NO_PATHCONV=1 ffmpeg.sh \
# -i "cmp 11 21 2021 1.mp4" \
# -filter:v "scale=1920:-1,minterpolate='fps=30:mi_mode=mci:mc_mode=aobmc:me_mode=bidir:me=epzs:mb_size=32:search_param=64:vsbmc=32:scd=fdiff:scd_threshold=10',setpts=2*PTS" \
# -y \
# "cmp 11 21 2021 1 mint.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment