Wednesday, December 21, 2022

FFMPEG command Cheat Sheet

I've made many FFMPEG command lines over the years and keep losing track of them. 

I've decided to post them here in a list and edit them as I find / make more.


Create a time lapse video from an input file, one frame every 15 frames, maximum VBR quality, rotate 90 degrees counterclockwise and vertical flip, delete audio and encode with h.265 using cuda and nvenc on a nvidia graphics card.

ffmpeg.exe -hwaccel cuda -i input.MP4  -vf framestep=15,setpts=N/60/TB,fps=60,transpose=0 -c:v hevc_nvenc -rc vbr -cq 0 -qmin 0 -qmax 1 -profile:v main10 -pix_fmt p010le -b:v 0K -an -max_interleave_delta 0 output.mkv


Combine an input video and two separate mono audio tracks into a single video file, encoding with dxva using nvenc on a nvidia graphics card. Example input would be video exported from Davinci Resolve

ffmpeg -y -hwaccel_output_format d3d11 -hwaccel d3d11va -i "video.mxf" -i "A01.mxf" -i "A02.mxf"  -filter_complex "[1:a][2:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -map 0:v -c:v hevc_nvenc -rc vbr -cq 10 -qmin 6 -qmax 14 -profile:v main10 -pix_fmt p010le -b:v 0K out.mp4

Same as above but on an AMD/ATI card and with bitrate set to 100 megabit

ffmpeg -y -hwaccel_output_format d3d11 -hwaccel d3d11va -i '.\video.mxf' -i '.\A01.mxf' -i '.\A02.mxf'  -filter_complex "[1:a][2:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s16le -map 0:v -c:v hevc_amf -b:v 100M "out.mkv"


Trapezoid transform a video with perspective example, trim a bit off the left top and left bottom of a 4k vertical video

Top left corner 29:490

Top right corner 2160:0

Bottom left corner 76:3241

Bottom right corner 2160:3840


-lavfi "perspective=29:490:2160:0:76:3241:2160:3840:interpolation=linear"

No comments:

Post a Comment