tags:

views:

76

answers:

2

I've been using OpenCV under python to record video from a capture device. Two output AVI's are written each hour, at the top of each hour the file names are changed. One of the files is the original capture and one uses some of OpenCV's detection functions.

As always, things change and audio needs to be recorded which wasn't originally a concern. I'm wondering if anyone has any suggestions about how best to do this. Current thought is to separately record the audio track using pyaudio and then use ffmpeg to mux them together after the hour has finished recording although I do have some concerns about keeping accurate lipsync.

I'm wondering if anyone has any better ideas about how to do this accurately and without noticeable gaps in the recording?

A: 

The pyaudio module may fit your needs, it is a wrapper aroung portaudio. On MacOsX, this hack installs the portaudio libray:

svn co https://www.portaudio.com/repos/portaudio/trunk portaudio
cd portaudio/
./configure
make
sudo make install
sudo /usr/bin/install -c -m 644 -m 644 ./include/pa_mac_core.h /usr/local/include/pa_mac_core.h
sudo easy_install pyaudio

Check their website: http://people.csail.mit.edu/hubert/pyaudio/

meduz
Yes, pyaudio is what I've been using so far, I'm just wondering if doing both separately and then joining later on is a good solution or not
Duncan