1

What I have

My aim is to parse some media file using ffmpeg and provide video and audio playback. Which I do successfully using the OpenGL for video and AudioQueue for audio.

What I need to do I need to change AudioQueue to Audio Unit service, because it does provide several nasty features for Audio manipulations.

Basically I'm confused on integration of Audio Units into ffmpeg run loop. So would like to have some references/samples from you guys where Audio Unit is intergrated with ffmpeg media playback loop i.e. media packet extraction and its pushing into some buffer which Audio Unit can play.

deimus
  • 9,565
  • 12
  • 63
  • 107

1 Answers1

2

Yes, i already used AudioUnit for playing a decoded audio using ffmpeg.

I took Novocaine project from github ( https://github.com/alexbw/novocaine ) and did a some changes (mostly threw code for input and OSX).

See KxAudioManager class from kxmovie project: https://github.com/kolyvan/kxmovie

If you plan to code for iOS, then note about need resampling sound to 44100Hz. A many movies have audio streams with 48000 Hz sample rate. And the best result I got: resample via swr_convert function from libswresample lib.

Kolyvan
  • 501
  • 4
  • 8