Skip to content

Instantly share code, notes, and snippets.

@geekman
Last active June 6, 2023 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geekman/ef170d8b92b04d47aef246d2622d0989 to your computer and use it in GitHub Desktop.
Save geekman/ef170d8b92b04d47aef246d2622d0989 to your computer and use it in GitHub Desktop.
some ffmpeg commands

create a list of filename,title list

for %f in (*.mp4) do @ffprobe -v error -of csv -show_entries format=filename:format_tags=title %f >> list.txt

resizing for uploading video reviews to sites

ffmpeg -i <input-file> -preset fast -crf 18 -vf scale=720:-2 -an output.mp4

flags:

  • scales to 720 x <auto>
    note that it's -2 and not -1 because sometimes ffmpeg complains about the dimension not divisble by 2. see here for answer.

  • -an removes audio channel

extracting subs

combine stream specifiers s and m:key:value to select the first matching subtitle:

ffmpeg -i file.mkv -map 0:s:m:language:eng eng_subtitle.srt

reference(s):

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