Reading audio of a video file

Hi everybody,

I need the audio track of a video file for mixing into our own DAW.

I am aware of the tow VideoComponents, QuickTimeVideoComponent and DirectShowComponent, but they don’t provide the audio as AudioSource. Is there a way to route that audio into an AudioSource or something similar?

How is the status of the AVFoundation implementation @jules mentioned in other threads?

Or is there an AudioFormatReader that reads a video format? Any other idea?


We don’t currently have anything to do that - it’s probably something best done with ffmpeg, so isn’t something we’d be able to add to juce very easily.

Thank you, I hoped the answer was different, but that’s life… :wink:

Would it be a problem (for juce or anybody else) to provide an open source ffmpeg wrapping audioSource or FFmpegComponent?
Did someone eventually write that already and would be willing to share?


Many video production companies work with the Apple ProRes codec. FFmpeg has a codec for ProRes, but it is reverse-engineered (by Elvis Presley :slight_smile: ). I really don’t know if it is a good idea (from a legal point of view) to use such a codec in a commercial product.

A codec for ProRes comes with QuickTime for OS X. On Windows you only get a decoder for ProRes with QuickTime. And even worse, development on QuickTime for Windows has been stopped recently (after some security concerns). -> Maybe only offer ProRes support on OS X?

Thanks Samuel, that’s indeed a good point. One more time that the big enterprises let the developers suffer for their politics.

Will the AVFoundation be crossplattform though?
It is supposed to supersede QuickTime, isn’t it?


I haven’t encountered any clue about an upcoming AVFoundation for Windows from Apple, other than the cease of Quicktime for Windows. Maybe Apple will announce something later this year. Who knows…

From Wikipedia:
As of OS X Lion, the underlying media framework for QuickTime, QTKit, is deprecated in favor of a newer graphics framework, AV Foundation.

Ok, I read a little into the documentation and I will tackle a wrapper to FFmpeg or libAV.

One question, is it a difference to use FFmpeg or the fork libAV? I already found differences in the API like AVoptions, so it won’t work as exchangable solution…
Which is the preferred?

Opinions and insights wanted.
The result will be on github, when the initial version works…

1 Like

IIRC Libav is a fork of FFmpeg started around 2011 from a bunch of developers leaving FFmpeg because of leadership issues. A few confusing actions followed, but basically there are now different developers working on these two projects which resulted in slightly different APIs. VideoLAN is still using FFmpeg. Not sure which one I would pick without further investigation.

If you create a wrapper class where you can set useFFmpeg or useLibav it would enable you to compare/profile/debug them directly in your project. You could even give beta testers different builds to figure out if you should go with FFmpeg or Libav.

Unfortunately it’s not only syntactic differences but complete structs and ways to interact, so in that case I would create two different AudioFormat classes, like LibAVAudieFormat and FFmpegAudioFormat with the accompaning Reader and Writer classes. But that’s double work…

But that sounds like what I found out, that there is no big difference like one or the other is dead or bad maintained…