ffmpeg ocmmands
ffmpeg ocmmands
mp4
ffmpeg -framerate 16 -i /content/output/%04d.jpg dec26_scifi_moflo.mp4
The image sequence writer is preset to emulate a constant frame rate stream, so it
will duplicate frames within timestamp gaps as per the output frame rate (default
25 for images) i.e. if the input has a frame at t=0 and t=0.12 then ffmpeg will
dupe the frame at t=0 at t=0.04 and t=0.08 for a 25 fps output. Use -vsync 0 to
avoid this behaviour.
resize:
ffmpeg -i input.mp4 -vf scale=320:240,setsar=1:1 output.mp4
ffmpeg -i WGclip3b.mp4 -vf scale=640:480,setsar=1:1 WGC.mp4
-vf scale=1024:1024,setsar=1:1
Note that if you've used -ss, you have to subtract this from the -to timestamp. For
example, if you cut with -ss 3 -i in.mp4 -to 5, the output will be five seconds
long.
X=1;
for i in *.png; do
mv $i $(printf %04d.%s ${X%.*} ${i##*.})
let X="$X+1"
done
#!/bin/bash
i=0
for file in img*jpg; do
echo -n "$file.. "
if [ $i -eq 0 ]; then
cp $file avg.jpg
else
convert $file avg.jpg -fx "(u+$i*v)/$[$i+1]" avg.jpg
fi
i=$[$i+1]
done
ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.wav
(for %i in (*.wav) do @echo file '%i') > mylist.txt
#frame count:
ffprobe -v error -select_streams v:0 -count_packets -show_entries
stream=nb_read_packets -of csv=p=0 input.mp4
#twitter safe
ffmpeg -i cma16fps_b.mp4 -ac 2 -pix_fmt yuv420p -vsync 2 -r 60 cma16fps_v.mp4
80:480:559:0
ffmpeg -i BalancedRadiance.gif -filter:v "crop=480:480:80:0" br_crop1.mp4
You need to combine -start_number 100 and -frames:v 101 (101 frames from
image100.jpg to image200.jpg).
#experimental
ffmpeg -i st-%04d.png -vf "minterpolate='mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=30'"
output%04d.png # mi_mode=blend is way better
ffmpeg -i st-%04d.png -vf
"minterpolate='mi_mode=blend:mc_mode=aobmc:vsbmc=1:fps=30'" out/%04d.png
ffmpeg -i %04d.png -vf "minterpolate='mi_mode=blend:mc_mode=aobmc:vsbmc=1:fps=30'"
out/%04d.png
ffmpeg -i st-%04d.png -vf
"minterpolate='mi_mode=blend:mc_mode=aobmc:vsbmc=1:fps=30'" -ac 2 -pix_fmt yuv420p
-vsync 2 10_8_2023_Midream1.mp4
-ac 2 -pix_fmt yuv420p -vsync 2
#^^experimental
for file in *.png; do
# Check if the file exists and is a regular file
if [ -f "$file" ]; then
# Convert transparent background to white background using ImageMagick
convert "$file" -background white -alpha remove -alpha off "${file%.png}.png"
fi
done
# Format the output file name with the correct zero padding
output_file_name=$(printf "%04d.png" "$filename")