ffprobe show_entries 的条目名称使用分号

Ben*_*min 6 ffmpeg ffprobe

我正在探索一个视频文件以获取一些基本信息。例如,以下使用 show_entries 标志来指定必要的数据。

> ffprobe -v error -show_entries format=size,duration:stream=codec_name,bit_rate video.mp4
Run Code Online (Sandbox Code Playgroud)

我还需要获取 TAG:rotate 条目,但这不起作用,因为分号与 show_entries 标志的语法混合在一起。

> 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
Run Code Online (Sandbox Code Playgroud)

有没有办法修复语法?唯一的其他解决方案是不指定单个条目而只获取所有数据。

llo*_*gan 9

您可以使用stream_tags存储在流中的元数据标签:

一些例子和结果:

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
Run Code Online (Sandbox Code Playgroud)

此外,还有format_tags用于存储在容器中的元数据标签(全局元数据)。