I'm streaming few RTMP streams through nginx and I want to check every few seconds what stream has the highest volume. Specifically these streams are of talking heads and I assume that usually only one of them is speaking at a time, and I'm trying to find which one. Since nginx can output hls (Apple http live streaming) I decided to check every few seconds the last segment of each stream using ffmpeg. Example:
ffmpeg -f mp3 -i /my/path/camera67/123.ts -af "volumedetect" -f null /dev/null
For some reason the max_volume is always zero (max_volume: 0.0 dB) and mean_volume seems meaningless regarding the volume.
- Do you have any idea why it's always zero?
- Is there a helpful way to understand mean_volume?
- Can you think of a different tool that may give me the volume (e.g. mediainfo or ffprobe)?
I also tried:
ffmpeg -f lavfi -i amovie=/my/path/camera67/123.ts,volumedetect
This time I got:
[mpegts @ 0x130bf40] start time for stream 1 is not set in estimate_timings_from_pts [mpegts @ 0x130bf40] Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels, fltp): unspecified sample rate Consider increasing the value for the 'analyzeduration' and 'probesize' options [Parsed_amovie_0 @ 0x130bcc0] No audio stream with index '-1' found [lavfi @ 0x130abc0] Error initializing filter 'amovie' with args '/my/path/camera67/123.ts' amovie=/my/path/camera67/123.ts,volumedetect: Invalid argument
Any idea?
Thanks, T.