(p.bubestinger@av-rd.com)2021-09
The beauty of CLI is that anything you can do on the commandline, you can fully automate and integrate into workflows the same way.
…and it’s like reading the book, rather than watching the movie.
$ ffmpeg -pix_fmts
$ ffmpeg -i input_file -c:v libx264 -crf 21 -c:a copy -pix_fmt yuv422p out.mkv
$ ffmpeg -i input_file -c:v libx264 -crf 21 -c:a copy -pix_fmt yuv420p10le out.mkv
$ ffmpeg -i video_in.mov -c copy \
-map 0 video_out.mkv
$ ffmpeg -i video_in.mov -c:v copy -c:a pcm_s16le \
-map 0 video_out.mkv
$ ffmpeg -i video_in.mov -c:v ffv1 -c:a copy \
-pix_fmt + -map 0
video_out.mkv
$ ffmpeg -i XDCAM_sample.mxf \
-pix_fmt rgb24 out/reel1_%06d.dpx \
-c:a pcm_s16le out/audio.wav
$ ffmpeg -f image2 -r 24 -start_number 1234 \
-i out/reel1_%06d.dpx \
-i out/audio.wav \
-c:v libx264 -crf 22 \
-c:a aac -b:a 192k \
-vf scale=1920:-1 -pix_fmt yuv420p \
access_copy.mp4
Decoded:
$ ffmpeg -i input_file.xxx -f framemd5 input_file.xxx.framemd5
Stream data as-is:
$ ffmpeg -i input_file.xxx -c copy -f framemd5 \
input_file.xxx.framemd5
$ ffmpeg-rel -hide_banner -i amanda_excerpt.m2t \
-map 0 -c copy \
-f streamhash -hash md5 - -v quiet
$ ffmpeg -i input_file -c copy -ss 00:01:23 -t 20 out1.mkv
$ ffmpeg -i input_file -c copy -map 0 \
-metadata title="This is the title" \
-metadata artist="The artist" \
output.mkv
$ ffmpeg -i in.mxf -vf "lut1d=CanonLog3_10-to-Linear_FL_Ver.2.0.cube" \
-c:v libx264 -g 300 -pix_fmt yuv420p -crf 22 \
-c:a aac -b:a 192k \
-map 0 delme.mp4
$ ffmpeg -txt_page 777 -txt_format text -txt_duration 2000 \
-i orf2.ts -vn -an -c:s srt \
orf2_sub.srt
Extracts only the subtitles (from Teletext page 777) as formatted text (SRT).
$ ffmpeg -i orf2.ts -i orf2_sub.srt -c copy \
-map 0:v -map 0:a \
-map 1:s -c:s srt \
out.mkv
Copies all audio+video+subtitle streams (no transcoding) into a Matroska container: (This is useful for subtitle content and timing validation/debugging)
“It’s like ZIP for film.”
RAWcooked is a convenient CLI frontent for converting image/audio/folder film data into FFV1/FLAC in MKV - and fully reversibly back.
$ rawcooked dpx/ --check-padding -o rawcooked.mkv
ffmpeg -formats | grep raw)Peter Bubestinger-Steindl
p.bubestinger@av-rd.com