[FFmpeg-user] Piped processes result in glitches/dropouts
Anders Bjerkén
anders at bjerken.net
Sat Sep 14 14:32:01 EEST 2024
Hi!
My setup is a ZOOM H5 microphone, a Raspberry Pi and a AWS hosted icecast
server. I want to take a stream from the mic, encode it to mp3 on the RPI,
save it to disc on the RPI, and pipe the same encoded content to the
icecast server.
This is the command I use:
ffmpeg -f alsa -i hw:2 -filter:a "volume=1.5" -ab 192k -acodec mp3 -f mp3 -
| ffmpeg -f mp3 -i - -c copy -f mpegts udp://<external_ip>:1685 -c copy -f
mp3 udp://0.0.0.0:1685
Conceptually, it works. However, every now and then I get synchronized 1-2
second long glitches in the outcoming data stream for both outputs.
Using only disc saving or icecast piping works fine.
The encoding ffmpeg process takes appr. 25% of the CPU, the splitting
ffmpeg process takes about 1%. There is plenty of CPU capacity left.
Using TCP based output gives the same result. The reason why I use a stream
locally is because I want to concatenate all data in one file (which I
postprocess before using).
Is there any way I can modify the command to get rid of the dropouts? I
have used all suggested versions of this command mentioned
on https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs, but with the
same result in the end.
Best regards
Anders
More information about the ffmpeg-user
mailing list