FFprobe, as its name implies, is a tool for getting information about media files.
This command:
Will return us some general information about the video file:
I have abbreviated it heavily, as we’ll check this out later.
But FFprobe is way more powerful than just this!
With the following command, we can get the same listing in JSON format, which is machine-readable!
The explanation of this command is the following:
“-v error -hide_banner”: This part hides extra output, such as headers and the default build information.
“-print_format json”: Obviously, this causes ffprobe to output a JSON.
“-show_streams” is the main switch that requests the stream information.
In this output, you can see three streams of data in this video file. The first (index: 0) is a video stream, that is an HD video with an H.264 codec. Then we have two audio streams, the first (index: 1) is a simple mp3 stream with stereo audio, and the second (index: 2) is an ac3 stream with 6 channels, most likely in an 5.1 configuration.
I have removed quite a lot of output for brevity, but you can get way more information out of these streams, e.g. fps for the video stream and so on.
Other than -show_streams, there are 3 more: -show_format, -show_packets and -show_frames. Unless you are really deep in the rabbit hole, you’ll not need the last two, but -show_format could be useful:
This is an overview of “what is this file”. As we see, it is a MOV file (format_name), with three streams (nb_streams), and it is 634 seconds long. Also, there are some tags where we can see the title, the artist, and other information.