braice / MuMuDVB

A DVB IPTV streaming software
http://mumudvb.braice.net/
GNU General Public License v2.0
218 stars 133 forks source link

Loss of sound with ffmpeg #135

Open nightshadow36 opened 8 years ago

nightshadow36 commented 8 years ago

Hi. I have had an ongoing problem for about 1 year now. I use mumudvb and ffmpeg to transcode the stream / protocol UDP Sometimes when there is a heavy storm or rain i loss sound through ffmpeg. Is this due to the nature of using UDP? Do you think HTTP wuld fix the problem, or is UDP the best protocol to use? Thank you.

yo2loj commented 8 years ago

This is due to the nature of radio waves scattering off ice crystals in heavy clouds. This will translate from macroblocks to complete loss of reception, depending on the intensity of the phenomena. The video stream will recover on the next TS packet, but the audio transcoding would fail. This seems an ffmpeg issue of stream error handling, and has nothing to do with MuMuDVB.

And please, close the issues you opened after clarification/solving!

nightshadow36 commented 8 years ago

@yo2loj Sorry to ask but you seem to know what you are talking about. Would useing protocol HTTP in MuMudvb fix this problem then? Thank you.

yo2loj commented 8 years ago

Since the size of ice crystals and raindrops is on the same size scale as the wave length of the satellite signal, there could be heavy RF absorbtion during thunderstorms, heavy rain or snowfall. The data from the satellite is packetized in the TS stream and the receiver has recovery algos for such cases. This will translate to macroblocks on the picture and stuttering on the audio (similar to packet loss on a UDP stream). The problem is that this loss happens BEFORE processing by the receiver, MuMuDVB or network transmission, so actually your transport protocol has absolutely no influence on this. The problem with transcoding is the actual ability of ffmpeg to be able to recover from an audio stream whith lost packets. Since this seems not the case, you will loose audio on bad signal levels because the decoding (and of course re-encoding) fails because of input stream error and does not restart. There is actually nothing you could do to prevent this, except a bigger antenna.

m0yellow commented 7 years ago

You could mitigate the problem, by adding silent audio additively in ffmpeg, as ffmpeg wouldn't loose the sync on the audio completely. But you would hear drops. A bigger dish is a better, and cleaner solution. Please close the issue if this answers your question.