Skip to content

Instantly share code, notes, and snippets.

@tolu
Last active December 6, 2016 01:20
Show Gist options
  • Save tolu/15f8e8f8f7e3a9cf5b77 to your computer and use it in GitHub Desktop.
Save tolu/15f8e8f8f7e3a9cf5b77 to your computer and use it in GitHub Desktop.
ffmpeg Usage

ffmpeg HowTo

Ripping

DVD

From ripping-dvd-with-ffmpeg

ffmpeg -i concat:VTS_01_1.VOB\|VTS_01_2.VOB\|VTS_01_3.VOB -map 0:v -map 0:a -c:v libx264 -crf 18 -vf yadif -c:a flac aikido.mkv

Windows Usage

:: concatenate all vob files first
copy /b VTS_01_*.VOB all_vobs.VOB

ffmpeg -i all_vobs.VOB -map 0:v -map 0:a -c:v libx264 -crf 18 -vf yadif output.mp4

:: delete concatenated file
del dvd\dvd.VOB

HLS Streams

ffmpeg -i http://path/to/master.m3u8 local/output/path

Thumbnail grabbing

Single frame

ffmpeg $fileOrStream -ss 00:00:14.435 -vframes 1 out.png

Frames from interval

One image per second

ffmpeg $fileOrStream -vf fps=1 out%03d.jpg

Outputs files named out001.jpg, out002.jpg etc

One image per minute

ffmpeg $fileOrStream -vf fps=1/60 out%03d.jpg

Output I-Frames

ffmpeg -i $fileOrStream -vf "select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr thumb%04d.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment