Re: DirectShow Video Realtime Ptich
- From: Iain <Iain@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 6 May 2005 07:27:35 +0100
On Fri, 06 May 2005 00:19:53 GMT, gman wrote:
> Hey Guys,
>
> I have been trying to write a directshow filter for a couple months now that
> will allow me to change the pitch of a video in realtime. So in other words
> I want the same effect as SetRate, but without having the music interrupt
> whenever I change the rate.
>
> I have played with creating my own custom reference clock, changing the
> timestamps in the sample grabber and in an in place transform filter. I just
> can't seem to change the rate of the audio and video together. Either I get
> the audio to change rates properly, but then the something happens to the
> video or vise versa.
>
> I know this can be done because winamp has the in_dshow.dll filter that
> allows the playback of videos that can be used in conjuction with their dsp
> plugins (pitch change, tempo change, etc) without the video and audio
> getting out of synch.
>
> I am out of ideas on how to get this to work. Is there someone that can tell
> me exactly what I have to do to the audio and video streams in a filter in
> order to get a realtime pitch change to work with videos?
>
> Thanks in advance,
> gman
I'm not entirely sure if you want to speed up the video whilst the audio
pitch remains the same, or if you wish to change the pitch of the audio
whilst the video runs at normal speed. (Or something I've missed!)
Whichever you are trying to do involves essentially the same techniques.
There are two ways to do this (broadly), time domain and frequency domain.
The time domain solution is about resampling (for pitch change) and then
adding (duplicating) or removing segments of the audio signal to bring the
duration back to the original.
The frequency domain involves analysing the frequencies in the signal (with
Fourier Analysis), workign out what frequencies the new sample should have
and resynthesising the waveform. Usually this is done by something called
a phase vocoder which can estimate the frequencies more accurately than
simple fourier analysis.
Personally, I would buy in a solution. Ianier Munoz of chronotron has both
time and frequency domain solutions - the former is low resource and low
quality, the latter is higher quality but uses more processor.
If you want to write your own, a starting point is dspdimension which has a
lot of material on pitch shift including some source code.
Iain
--
Iain Downs (DirectShow MVP)
Software Product Consultant
www.idcl.co.uk
.
- References:
- DirectShow Video Realtime Ptich
- From: gman
- DirectShow Video Realtime Ptich
- Prev by Date: Re: custom source filter implementation
- Next by Date: Re: Setting programmatically generated data source for Directshow
- Previous by thread: DirectShow Video Realtime Ptich
- Next by thread: I have problems in Media Type negotiations.....
- Index(es):
Relevant Pages
|