dshow webcam and microphone capture
-
- Posts: 1878
- Joined: Fri Aug 05, 2011 9:56 pm
Re: dshow webcam and microphone capture
just wondering if there's some trick to speeding ffmpeg in there somewhere...
Re: dshow webcam and microphone capture
It actually only separates AV decoding and encoding. That's important when recording from a live source like webcam or microphone to ensure you do not lose any packets. I.e. if you use complex codec the time program spends encoding may be high, and some packets will never reach program's input during that time. I'm not sure if ffmpeg internally handles this, but w/o threading I had tons of lost packets.rogerdpack wrote:just wondering if there's some trick to speeding ffmpeg in there somewhere...
Basically you put all incoming packets into a deque (two of them: for audio and video) and then process it in a separate thread maintaining audio-video synchronization. You should also minimize operations on deque to minimize time program spends in mutex lock waiting for other thread.
-
- Posts: 1878
- Joined: Fri Aug 05, 2011 9:56 pm
Re: dshow webcam and microphone capture
Interesting idea. Thanks!
(I know dshow has an rtbufsize you can set, but it may not be as good that, especially re-ordering wise).
(I know dshow has an rtbufsize you can set, but it may not be as good that, especially re-ordering wise).
Re: dshow webcam and microphone capture
fuwaneko wrote: ↑Mon Aug 27, 2012 3:00 amI don't know if this helps. But here is my old source file. It features:
- DShow capture from webcam and microphone
- encoding via VFW dll
- basic usage of ffmpeg api.
Sorry it's poorly commented, but general idea should be clear. Also features multithreaded encoding with boost.thread. If you have any questions I'd be glad to help, it's really hard to find anything good on ffmpeg api.
Hi,
I tried to use this code but just to capture microphone audio as mp3. The captured audio has low pitch sound of the microphone. Can you help me with this issue ?
link for the recorded file https://drive.google.com/file/d/0BwEbdh ... sp=sharing
-
- Posts: 1878
- Joined: Fri Aug 05, 2011 9:56 pm
Re: dshow webcam and microphone capture
what command line? what if you save as .wav? unfortunately it works OK here hmm