微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ffprobe如何确定持续时间?

我正在使用ffprobe来分析存储在远程服务器上的媒体文件。 这似乎工作得很好,但对于一些文件的持续时间缺失或不正确(通常比它应该更长)。 其他时候,它会准确地返回这些信息,而且它似乎与媒体types(编解码器等)无关。

以下是一个可用的命令示例:

ffprobe -v quiet -print_format json -show_streams -show_format http://host.com/file.aiff

{ "streams": [ { "index": 0,"codec_name": "pcm_s16be","codec_long_name": "PCM signed 16-bit big-endian","codec_type": "audio","codec_time_base": "1/44100","codec_tag_string": "[0][0][0][0]","codec_tag": "0x0000","sample_fmt": "s16","sample_rate": "44100","channels": 2,"bits_per_sample": 16,"r_frame_rate": "0/0","avg_frame_rate": "0/0","time_base": "1/44100","start_pts": 0,"start_time": "0.000000","duration_ts": 8494248,"duration": "192.613333","bit_rate": "1411200","nb_frames": "8494248","disposition": { "default": 0,"dub": 0,"original": 0,"comment": 0,"lyrics": 0,"karaoke": 0,"forced": 0,"hearing_impaired": 0,"visual_impaired": 0,"clean_effects": 0,"attached_pic": 0 } } ],"format": { "filename": "http://host.com/file.aiff","nb_streams": 1,"nb_programs": 0,"format_name": "aiff","format_long_name": "Audio IFF","probe_score": 100 } }

以下是一个不包含以下内容的示例:

/ dev / dsp windows替代

audiostream采样率在Linux

logging到WAV文件

从audio文件生成波形图像

pactl列表源文件之后没有bluez设备

ffprobe -v quiet -print_format json -show_streams -show_format "http://host.com/file.wav"

其中产生这个结果:

{ "streams": [ { "index": 0,"codec_name": "pcm_s16le","codec_long_name": "PCM signed 16-bit little-endian","codec_tag_string": "[1][0][0][0]","codec_tag": "0x0001","format": { "filename": "http://host.com/file.wav","format_name": "wav","format_long_name": "WAV / WAVE (Waveform Audio)","probe_score": 99 } }

这两个例子是不同的格式,但我已经看到它的工作,并没有工作时,格式是相同的,我只是没有一个方便的例子。

我想知道的是,如果有什么我可以改变的关于我使用的ffprobe的参数,以确保持续时间的一致性和准确性,或任何信息,我可以findffprobe如何工作,所以我弄清楚我怎么可能改变input文件,等等,所以他们正常工作。

另外,如果有一个不同的工具可以更可靠地工作(这将需要一个开源的Linux工具),欢迎任何build议或build议。

如何用PyAudioselect一个特定的input设备

如何播放同时下载的mp3?

Python:更改Windows 7主卷

什么是从waveOutWrite API方法callback的延迟(或延迟)时间?

音量(平衡)控制XP / Vista的

一个简单的解决方案是使用-show_packets选项

ffprobe -i input.mp4 -show_packets > a.txt

现在打开a.txt并转到最后一个数据包,并看到dts_time值,这将是文件的精确持续时间。 如果未定义dts_time,请检查pts_time值。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐