ffprobe/ffmpg silence detection command

随声附和 提交于 2021-02-19 07:48:08

问题


I'm working on a stream silence detection. It's working on the following command in ffmpeg:

ffmpeg -i http://mystream.com/stream -af silencedetect=n=-50dB:d=0.5 -f null - 2> log.txt

I would like to get a json output of the logfile. There is a json option in 'ffprobe' but silencedetect=n=-50dB:d=0.5 is'nt working.

Help!

Cheers!


回答1:


ffprobe is meant to probe container-level or stream-level metadata. silencedetect is a filter which analyses the content of decoded audio streams; its output isn't controlled by the choice of writer.

What you could do, since silencedetect also logs its result to metadata tags, is output just that data to a file.

ffmpeg -i http://mystream.com/stream -af silencedetect=n=-50dB:d=0.5,ametadata=print:file=log.txt -f null -

Output

frame:281  pts:323712  pts_time:6.744  
lavfi.silence_start=6.244
frame:285  pts:328320  pts_time:6.84   
lavfi.silence_end=6.84
lavfi.silence_duration=0.596
frame:413  pts:475776  pts_time:9.912  
lavfi.silence_start=9.412
frame:1224 pts:1410048 pts_time:29.376 
lavfi.silence_end=29.376
lavfi.silence_duration=19.964


来源:https://stackoverflow.com/questions/44799312/ffprobe-ffmpg-silence-detection-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!