[Libav-user] Need audio help, runnable sample (Was: Posting a sample project on Github)

Brad O'Hearne brado at bighillsoftware.com
Sat Mar 23 04:07:44 CET 2013

On Mar 13, 2013, at 3:30 PM, Oleg <mybrokenbeat at gmail.com> wrote:

> And about solving your problem, first find where is the problem: In mic? In QTKit API? In ffmpeg API? Don't try to "repair" whole system when you don't know what exactly doesn't work.

Understood, in fact, that's the motivation for posting the example. At this point, there are no errors being returned anywhere along the way -- all works, the audio is just junk. My belief is that the problem is not with the capture or the streaming, but rather likely with the conversion of the audio from its source sample format. 

I've finally gotten a runnable app w/source -- I tried to put some time into this so as to deliver a UI and source that would clearly demonstrate the problem I'm experiencing. I would really appreciate it if someone could take a look and let me know what the problem with it is, which most certainly is centered in the audio processing. Here's the source to a runnable Mac app on GitHub: 



- The app presents a UI that shows a video preview and audio level for video/audio being captured by QTKit. Clicking the "Start Streaming" button will open an output format context and will write an FLV file (my target format) to your Desktop. ***NOTE: This app also outputs a log file to the Application Support directory -- I am outputting this log for ease in log storage/exchange -- I just thought I'd mention that in case someone who helps out wants to get rid of the leftovers once removing this app. 


- If I write *only* video frames using the av_write_frame call, the resulting FLV video seems fine (no audio of course, which I need). 

- If I write both audio and video, the resulting FLV when played gives me audio that is ear-piercing junk, and the video seems to stream fine for about 15 seconds, and then just freezes. 

- If I write *only* audio, the resulting audio in the FLV is ear-piercing junk. 

I would be very grateful if any experts out there could just pull this thing and run it, and then take a look at the source. The crux of the FFmpeg API usage is in the class called QTFFAVStreamer. Please do not hesitate to ask me any questions, and feel free to contact me either with a reply to this thread, or offline at my email address of brado at bighillsoftware.com. 

Again, thank you very much for your help. 



More information about the Libav-user mailing list