For the developers that use FFmpeg in their software.
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.
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.
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