[FFmpeg-devel] [PATCH] ALSA for libavdevice

Luca Abeni lucabe72
Mon Dec 29 10:03:16 CET 2008

Hi Michael,

On Mon, 2008-12-29 at 04:03 +0100, Michael Niedermayer wrote:
> > > I am pondering the best way to implement a robust generic timestamp filter
> > > that will allow to just use av_gettime.
> > I think that your current code is the best solution in the long term,
> > but we really need a fallback solution until alsa lib is fixed (or we
> > need to document how to use "pcm_hw" instead of "pcm_dsnoop").
> > Maybe a possible solution is to have a configure check for the presence
> > of snd_pcm_htimestamp(), and to provide some mechanism for allowing the
> > user to disable the usage of such function (if alsalib provides it, but
> > it is broken)...

Sorry, I did not express myself very well (some hours of alsa debugging
can be devastating)... I did not want to say anything against
implementing the timestamp filter; I was just thinking about the build
issue (compilation is broken with "too old" alsa libraries) and the hang
I reported in previous emails.

> I think you are missing a small detail here, V4L and OSS support in ffmpeg
> currently IS broken, and can under some circumstances generate invalid
> files without the users knowledge. (invalid in the sense of flaky timestamps)

Well, I do not know what changed in the last two years, but I know for
sure that about 2 years ago ffmpeg was able to capture perfectly
synchronised audio and video using v4l2+oss (the result was ok for
professional broadcasters). The only cases in which A/V desynch was
noticed, it was due to drivers' bugs, and changing the capture card
fixed the issue. And I think that if timestamps are not correct/precise
enough then A/V synch will result incorrect, right?
(yes, I know that using v4l+oss things are much more complex and correct
synchronisation is not always possible).

Anyway, if there is something broken in the v4l2 input I'd like to know
it, so that I can try to fix it...

> the timestamp filter might fix or at least reduce this issue.
> having alsalib fixed upstream is the correct thing for alsa but its not going
> to help with OSS/V4L
> so i think we will need that timestamp filter anyway ...

I agree with this; sorry if I've been unclear in my previous email. I
was just considering the timestamp filter as a separate component (I
think it could be useful for other inputs than alsa).


More information about the ffmpeg-devel mailing list