Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
FFmpeg & FFprobe


To HAP Alpha

ffmpeg -i in.mp4 -vcodec hap -format hap_alpha

To HEVC (x265) GPU

ffmpeg -hwaccel cuvid -i in.mkv -c:v hevc_nvenc -preset slow -b:v 8M -maxrate:v 8.5M -pix_fmt yuv420p out.mkv


Aiff from H264

ffmpeg -i in.mp4 out.aiff


ffprobe -i in.mkv -show_format -hide_banner


Concat SRT

ffmpeg -i "|" -c copy

Mapping (Convert Video, copy Audio and Subtitles)

ffmpeg -i in.mkv -map 0:0 -map 0:2 -map 0:30 -c:v hap -format hap_alpha -c:a copy -c:s copy out.mkv

Remove Chapters

-map_chapters -1

Trim without encoding

-ss 00:00:00 -t 00:00:03 1st timecode: start time / 2nd timecode;

'too many packets buffered for output' bug

-max_muxing_queue_size 1024


To HEVC with chapter selection and max muxing

ffmpeg -hwaccel cuvid -i in.mkv -max_muxing_queue_size 1024 -map 0:0 -map 0:30 -map 0:31 -c:v hevc_nvenc -preset slow -b:v 8M -maxrate:v 8.5M -pix_fmt yuv420p -c:a copy -c:s copy -map_chapters -1 out.x265-Hubris.mkv

Trim without encoding

ffmpeg -i -ss 00:00:00 -t 00:00:03 -async 1 -c copy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment