6

I'm probing a video file to get some basic information. For example, the following uses the show_entries flag to specify the necessary data.

> ffprobe -v error -show_entries format=size,duration:stream=codec_name,bit_rate video.mp4

I also need to get the TAG:rotate entry, but this does not working as the semicolon mixes with the syntax of the show_entries flag.

> ffprobe -v error -show_entries format=size,duration:stream=codec_name,bit_rate,TAG:rotate output.mp4
No match for section 'rotate'
Failed to set value 'format=size,duration:stream=codec_name,bit_rate,TAG:rotate' for option 'show_entries': Invalid argument

Is there a way to fix the syntax? The only other solution is not to specify the individual entries and just get all the data.

slhck
  • 223,558
  • 70
  • 607
  • 592
Benjamin
  • 163
  • 1
  • 1
  • 4

1 Answers1

11

You can use stream_tags for metadata tags stored in the stream:

Some examples and results:

ffprobe -v error -show_entries stream_tags=rotate -of csv=p=0 input.mp4
90

ffprobe -v error -show_entries stream_tags=rotate -of default=noprint_wrappers=1 input.mp4
TAG:rotate=90

ffprobe -v error -show_entries stream_tags=rotate:format=size,duration:stream=codec_name,bit_rate -of default=noprint_wrappers=1 input.mp4
codec_name=h264
bit_rate=39761
TAG:rotate=90
duration=5.000000
size=27114

In addition there is format_tags for metadata tags stored in the container (global metadata).

llogan
  • 57,139
  • 15
  • 118
  • 145