[FFmpeg-user] How to deal with glitches and cut-outs on incoming stream?

Pan 069 pan069 at gmail.com
Tue May 10 03:16:24 CEST 2016

Hi everyone,

I'm pretty new to ffmpeg and I would appreciate some advice on an problem
I'd like to solve (if possible).

Imagine the following scenario: You're recording a live audio stream, a
radio channel for the sake of argument, and next to the live stream you
have a program (data set) of what's being broadcasted. The program
indicates at what time an audio segment starts and stops. Let's assume that
the live audio stream and the program sync up perfectly, meaning that the
first segment starts exactly at time 00:00 of the captured audio and the
next segment at 01:00 (hour hour in).

The problem that I'm facing is that over time the live audio stream and the
program might go out of sync. This would be due to small (or larger)
glitches on the live audio stream. Say, a lot of 100ms glitches might
resolve to quite a large discrepancy over time. Meaning that the segment
that was suppose to start at 10:30 actually starts at 10:23 in the recorded
audio file.

I have been trying to think of ideas on how to solve this but I'm not
really convinced (or better stated, experienced enough with ffmpeg) to
assume these ideas actually work. E.g. one idea was that maybe ffserver
could solve this problem by recording the live audio stream first before I
then record the output stream from ffserver again with ffmpeg. I was hoping
that somehow ffserver might be able to fill in the missing glitches with
silence or something, i.e. somehow incorporate a time factor.

I hope I explained the issue well enough and that somehow could help me out
with thinking of a solution.

Any help much appreciated.


More information about the ffmpeg-user mailing list