1

我正在尝试从 ffprobe 返回特定值:

ffprobe -v error -select_streams V:0 -show_entries stream=index,width,height,sample_aspect_ratio,display_aspect_ratio:format=duration -of default=noprint_wrappers=1:nokey=1 test.MTS

输出中的流值重复:

0
1920
1080
1:1
16:9
0
1920
1080
1:1
16:9
116.640000

格式值不重复。如果我剥离打印机值以查看发生了什么:

ffprobe -v error -select_streams V:0 -show_entries stream=index,width,height,sample_aspect_ratio,display_aspect_ratio:format=duration test.MTS

我看到一个名为 [PROGRAM] 的部分,其中重复了流 0:

[PROGRAM]
[STREAM]
index=0
width=1920
height=1080
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
[/STREAM]
[/PROGRAM]
[STREAM]
index=0
width=1920
height=1080
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
[/STREAM]
[FORMAT]
duration=116.640000
[/FORMAT]

有人可以帮我只返回一次视频流 0 值吗?

4

1 回答 1

0

常规stream没有唯一的部分名称。-show_entries program_stream但是,您可以仅使用或丢弃额外信息来选择节目流。看ffprobe -sections

于 2015-11-15T22:47:46.417 回答