

(Be aware that it could technically have a different stream number, like 0.1.) The below output uses the MS Video-1. Pull the Stream #0.0: Video line and you can see the codec. To reduce the output even further, introduce sed: $ ffprobe video.mkv 2>&1 >/dev/null |grep Stream.*Video | sed -e 's/.*Video: //' -e 's/.*//'įFmpeg gives the codec too. To extract the video codec information - since ffmpeg sends information to stderr - pipe and grep it: $ ffprobe video.mkv 2>&1 >/dev/null | grep Stream.*Video Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)

To get the codec information without playing back the file, use ffprobe. This method is easier to understand but messy.
FFMPEG VIEW INSTALLED CODECS HOW TO
Mediainfo mediainfo -Inform="Video %Codec%" video.mkvĪnswer made possible thanks to How to find duration of a video file using mediainfo in seconds or other formats? ffprobe (ffmpeg) easy wayĪssuming your video has one video stream only: ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 video.mkvĪnswer made possible thanks to How to get video duration in seconds? ffprobe (ffmpeg) dirty way
