Skip to content

Instantly share code, notes, and snippets.

@SpaceMonkeyForever
Last active April 27, 2019 17:59
Show Gist options
  • Save SpaceMonkeyForever/e250af8556ccb63a256668f68aa78f0f to your computer and use it in GitHub Desktop.
Save SpaceMonkeyForever/e250af8556ccb63a256668f68aa78f0f to your computer and use it in GitHub Desktop.
Video

Capture stream or download video:

TLDR:
streamlink url best -O | ffmpeg -i pipe:0 -c:v copy -c:a aac output.mkv
Details:
streamlink url best -o output.mkv

resulting format:

Container = Matroska
Video = AVC, ID = "V_MPEG4/ISO/AVC"
Audio = Opus, ID = "A_OPUS"

That format can't be imported in Premiere, we have to pipe through ffmpeg and re-encode audio:

streamlink url best -O | ffmpeg -i pipe:0 -c:v copy -c:a aac output.mkv

Interestingly, we can get around the import error by simply copying both streams and using the same container. However, Premiere won't see the audio stream, so this is not a good method.

streamlink url best -O | ffmpeg -i pipe:0 -c:v copy -c:a copy output.mkv

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