/opt/ffmpeg/bin/ffmpeg -i 1.mov -i 2.mov -f lavfi -i color=black -filter_complex \ "[0:v]format=pix_fmts=yuva420p,fade=t=out:st=4:d=1:alpha=1,setpts=PTS-STARTPTS[va0];\ [1:v]format=pix_fmts=yuva420p,fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+4/TB[va1];\ [2:v]scale=1920x1080,trim=duration=7[over];\ [0:a]afade=t=out:st=4:d=1[a0];\ [1:a]afade=t=in:st=0:d=1[a1];\ aevalsrc=0:d=4[s1];\ [s1][a1]concat=n=2:v=0:a=1[ac1];\ [a0][ac1]amix[outa];\ [over][va0]overlay[over1];\ [over1][va1]overlay=format=yuv420[outv]" \ -vcodec libx264 -aspect 1.778 -map [outv] -map [outa] -codec:a libmp3lame -qscale:a 2 -ss 00:00:02 -t 5 out.mp4
/opt/ffmpeg/bin/ffmpeg -i 1.mov -i 1.mov -f lavfi -i color=black -filter_complex \ "[0:v]format=pix_fmts=yuva420p,fade=t=out:st=4:d=1:alpha=1,setpts=PTS-STARTPTS[va0];\ [1:v]format=pix_fmts=yuva420p,fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+4/TB[va1];\ [2:v]scale=1920x1080,trim=duration=7[over];\ [0:a]afade=t=out:st=4:d=1[a0];\ [1:a]afade=t=in:st=0:d=1[a1];\ aevalsrc=0:d=4[s1];\ [s1][a1]concat=n=2:v=0:a=1[ac1];\ [a0][ac1]amix[outa];\ [over][va0]overlay[over1];\ [over1][va1]overlay=format=yuv420[outv]" \ -vcodec libx264 -preset ultrafast -qp 0 -aspect 1.778 -map [outv] -map [outa] -acodec libvorbis -qscale:a 10 -ss 00:00:02 -t 5 out.mp4
ffmpeg -i first.mp4 -i second.mp4 -filter_complex "xfade=transition=fade:offset=60:duration=1" out.mp4 <code> // from https://superuser.com/questions/778762/crossfade-between-2-videos-using-ffmpeg //
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
crf
is typically 24 through 30. Higher numbers are smaller files and lower quality. From https://unix.stackexchange.com/questions/28803/how-can-i-reduce-a-videos-size-with-ffmpeg
ffmpeg -i <FILENAME1> <FILENAME2>_%03d.png
ffmpeg -i input.mkv -filter:v "minterpolate='mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=120'" output.mkv
where fps
is the output fps (independent of input fps)ffmpeg -itsscale 2 -i input.mp4 -c copy -an output.mp4
# slow to 2x slower