博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ffmpeg 音频音量的获取
阅读量:4199 次
发布时间:2019-05-26

本文共 1457 字,大约阅读时间需要 4 分钟。

使用 ffmpeg 的 volumedetect 获取音频音量信息,测试命令如下:

ffmpeg -i ~/media/test.mp4 -filter_complex volumedetect -c:v copy -f null /dev/null

命令执行结果如下:

[Parsed_volumedetect_0 @ 0x7fb417591180] n_samples: 0Stream mapping:  Stream #0:1 (aac) -> volumedetect  volumedetect -> Stream #0:0 (pcm_s16le)  Stream #0:0 -> #0:1 (copy)Press [q] to stop, [?] for helpOutput #0, null, to '/dev/null':  Metadata:    major_brand     : isom    minor_version   : 512    compatible_brands: isomiso2avc1mp41    encoder         : Lavf58.20.100    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s (default)    Metadata:      encoder         : Lavc58.35.100 pcm_s16le    Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1301 kb/s, 24 fps, 24 tbr, 12288 tbn, 12288 tbc (default)    Metadata:      handler_name    : VideoHandlerframe= 1085 fps=0.0 q=-1.0 Lsize=N/A time=00:00:45.08 bitrate=N/A speed= 569x    video:7183kB audio:7764kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown[Parsed_volumedetect_0 @ 0x7fb417474d80] n_samples: 3975168[Parsed_volumedetect_0 @ 0x7fb417474d80] mean_volume: -20.0 dB[Parsed_volumedetect_0 @ 0x7fb417474d80] max_volume: -7.2 dB[Parsed_volumedetect_0 @ 0x7fb417474d80] histogram_7db: 6[Parsed_volumedetect_0 @ 0x7fb417474d80] histogram_8db: 107[Parsed_volumedetect_0 @ 0x7fb417474d80] histogram_9db: 6261bogon:~ xubinbin$

从输出信息中我们可以看到 mean_volume 为获取到的平均值 -20.0 dB。

转载地址:http://dgfli.baihongyu.com/

你可能感兴趣的文章
【一天一道LeetCode】#59. Spiral Matrix II
查看>>
【一天一道LeetCode】#30. Substring with Concatenation of All Words
查看>>
【一天一道LeetCode】#60. Permutation Sequence.
查看>>
【一天一道LeetCode】#62. Unique Paths
查看>>
【一天一道LeetCode】#61. Rotate List
查看>>
【一天一道LeetCode】#63. Unique Paths II
查看>>
【一天一道LeetCode】#36. Valid Sudoku
查看>>
【一天一道LeetCode】#75. Sort Colors
查看>>
【一天一道LeetCode】#76. Minimum Window Substring
查看>>
【计算机网络 第五版】阅读笔记之一:概述
查看>>
【计算机网络 第五版】阅读笔记之二:物理层
查看>>
【计算机网络 第五版】阅读笔记之三:数据链路层
查看>>
【计算机网络 第五版】阅读笔记之四:网络层
查看>>
【计算机网络 第五版】阅读笔记之五:运输层
查看>>
【一天一道LeetCode】#77. Combinations
查看>>
【一天一道LeetCode】#78. Subsets
查看>>
【一天一道LeetCode】#79. Word Search
查看>>
【一天一道LeetCode】#81. Search in Rotated Sorted Array II
查看>>
【数据结构与算法】深入浅出递归和迭代的通用转换思想
查看>>
【一天一道LeetCode】#83. Remove Duplicates from Sorted List
查看>>