ffprobe -v fatal # set log level to fatal
-of default=nw=1:nk=1 # use default format and hide wrappers and keys
-show_streams # show info about media streams
-select_streams a # show only audio streams
-show_entries stream=codec_type # show only stream.codec_type entries
video.mp4 # input file
一个媒体文件包含一个音频流返回:
audio
1
0
0
0
0
0
0
0
0
0
0
0
und
SoundHandler
媒体文件不包含音频流返回空结果。
非媒体文件也返回空结果。如果要为非媒体文件和任何其他错误情况返回错误消息,请-v error
改用:
ffprobe -v error # set log level to error
-of default=nw=1:nk=1 # use default format and hide wrappers and keys
-show_streams # show info about media streams
-select_streams a # show only audio streams
-show_entries stream=codec_type # show only stream.codec_type entries
video.mp4 # input file
所以,你用这个而不是空结果:
non-media-file.zip: Invalid data found when processing input