ECToo / lavfilters

Automatically exported from code.google.com/p/lavfilters
GNU General Public License v2.0
0 stars 0 forks source link

Resample Audio in case downstream filter does not accept audios sample rate. #271

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have my own internal audio sink filter that can only accept one audio format 
(PCM, 2ch, 48kHz, 16bit). I advertise exactly that one format in GetMediaType, 
and accept only that one format in CheckMediaType.

I'm testing using a movie that has an audio track at 44.1kHz so there would 
need to be a sample rate conversion done.
If use ffdshow and don't let its audio decode filter resample, DirectShow 
inserts an ACM filter to do the sample rate conversion and it works fine.

During negotiation, I see the LAV Audio Decode filter call CheckMediaType via 
ReceiveConnection with various wave formats until it finally zeroes in on the 
right 48kHz version. The pins do connect.
I then get two calls to QueryAccept asking about 44.1kHz again so I fail. I do 
start getting media samples but they have the 44.1kHz format so I can't accept 
them.

Might be tough for you to reproduce, but I'm really hoping the description 
helps you zero in on it. This will be a showstopper for me using the LAV 
filters instead of ffdshow. That would be a shame, as they seem more robust, 
especially with A/V sync.

LAV Filters Version 0.51.3-x64 in my own application.

Original issue reported on code.google.com by LoopinF...@gmail.com on 28 Sep 2012 at 5:51

GoogleCodeExporter commented 9 years ago
I will be able to provide resampling in one of the upcoming versions which then 
will automatically resample audio if the downstream filter does not accept any 
other format.

LAV Audio will always probes the downstream filter with QueryAccept if the 
mediatype is supported, if it reports a failure there, LAV Audio will then try 
to find a mediatype that works (by resampling, mixing and sample format 
conversion).

Original comment by h.lepp...@gmail.com on 5 Oct 2012 at 9:08