How to check a video's codec with ffprobe or an API

Check a video's codec by probing it: ffprobe prints each stream's codec_name. For a Sume-hosted file, a free probe returns video_codec and pix_fmt.

5 min readSume
All posts

To check a video's codec, probe the file with ffprobe, which comes with FFmpeg: ffprobe -v error -show_entries stream=codec_type,codec_name -of default=noprint_wrappers=1 input.mp4 prints each stream's type and codec name, such as h264 for H.264 video and aac for AAC audio. For a file already on Sume, a free POST /v1/video-inspect with frames: false returns the same facts as video_codec and audio_codec.

The ffprobe facts come from its documentation, the codec and pixel format names from FFmpeg's formats, codecs, filters, and ffmpeg pages, and Sume's from the Video inspect docs and the Sume API reference, read on 2026-09-28. Anything described as current behavior is read from Sume's code.

How do I check the codec with ffprobe?

ffprobe gathers information from media streams and prints it in human- and machine-readable form, and its docs name this use: checking the container format and the format and type of each stream in it. Three options shape the answer:

  • -show_entries sets the fields to show, as section=field,field. codec_type says whether a stream is video or audio, and codec_name names its codec. The fields come out in ffprobe's usual order, not the order you list them. -show_entries stream, with no = and no field list, shows every entry of each stream.
  • -select_streams limits the output to the streams you name, such as v:0 for the first video stream.
  • -of sets the output format. With the default writer, noprint_wrappers=1 drops the section header and footer, and nokey=1 prints values without their keys.
# Every stream's type, codec, and pixel format
ffprobe -v error -show_entries stream=codec_type,codec_name,pix_fmt \
  -of default=noprint_wrappers=1 input.mp4

# Only the first video stream's codec name
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name \
  -of default=noprint_wrappers=1:nokey=1 input.mp4

What do the codec and pixel format names mean?

The names are FFmpeg's short names. Here are a few, as FFmpeg's own docs describe them; what codec MP4 uses explains why a file's extension says nothing about them, and 8-bit vs 10-bit pixel formats covers the others:

From FFmpeg's formats, codecs, ffmpeg, and filters documentation, read 2026-09-28.
NameFieldWhat it means
h264codec_nameH.264: ITU-T H.264 / MPEG-4 Part 10 AVC video
hevccodec_nameH.265: ITU-T H.265 / MPEG-H Part 2 HEVC video
av1codec_nameAV1: AOMedia Video 1 video
aaccodec_nameAAC audio
yuv420ppix_fmtYUV 4:2:0 planar, 8 bits

How do I check the codec of a file on Sume?

Run the free probe: POST /v1/video-inspect with frames: false, which is probe only, with no stills. It reads only your workspace's media.sume.com files, such as an earlier Sume job's output, and Get a video's duration, resolution, and fps shows the full request. In current code, it refuses a source file over 300 MiB with source_too_large; check a bigger file with ffprobe. The codec answer is in these probe fields:

  • video_codec and audio_codec: in current code, the ffprobe codec_name of the clip's video stream and audio stream.
  • pix_fmt and color_transfer: in current code, the video stream's pixel format and color transfer, from the same ffprobe call.
  • container: in current code, ffprobe's format name for the file.
  • hdr: true for PQ and HLG transfers, the sources video filter refuses with hdr_source_unsupported.

What if the codec is the problem?

Re-encode the video stream: How to convert HEVC to H.264 walks through the FFmpeg command and the Sume trim that do it, and MP4 plays audio but no video reads the probe for a file that plays sound with no picture.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume