Skip to content

Instantly share code, notes, and snippets.

@LuisMayo
Last active April 14, 2022 19:08
Show Gist options
  • Save LuisMayo/cf4cfaa0a3a859222653ea9b3de49752 to your computer and use it in GitHub Desktop.
Save LuisMayo/cf4cfaa0a3a859222653ea9b3de49752 to your computer and use it in GitHub Desktop.
FFMPEG and yt-dlp flags and useful commands

FFMPEG

Merge video and subtitles into mkv file

ffmpeg -hwaccel auto -i aa.mp4 -i aa.srt -c copy aa.mkv

Vobsubs (.idx and .sub)

Select the .idx file. Ffmpeg will automatically search for the .sub file. Just another audio stream.

Mapping

https://trac.ffmpeg.org/wiki/Map

Yt-dlp

Download with 264 codec

yt-dlp -S "codec:h264"

Download last X videos from channel/playlyst

yt-dlp -S "codec:h264" --playlist-end=x

Download with embeded subtitles in mkv with 264 codec

yt-dlp -S "codec:h264" --write-subs --write-auto-subs --embed-subs --compat-options no-keep-subs --sub-langs en,es,en-original,es-original --convert-subs srt --remux-video mkv

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