Skip to content

Instantly share code, notes, and snippets.

@richjenks
Created March 25, 2018 16:25
Show Gist options
  • Save richjenks/daf1fa619cf263b9194c01fa4f9c25e7 to your computer and use it in GitHub Desktop.
Save richjenks/daf1fa619cf263b9194c01fa4f9c25e7 to your computer and use it in GitHub Desktop.
Get the video/audio codec of the first stream in a video file
# Video
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 input.mp4
# Audio
ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 input.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment