I am thinking about some sort of VJ tool kind of software where I want video (mov mp4, like that) be the base of the app. So I would like to do audio analysis on a video containing audio.
I am aware of the ofSoundGetSpectrum(…) for audio but cant find a way of doing something similar on the audio part of a video.
I thought about ‘splitting’ the audio from the video and directly analyse that and use it, but since it will be a ‘live’ thing that will be pretty hard to do without delays I assume…
Yeah if it isn’t possible that will be my fallback solution. (Or otherwise I could maybe use the approximate light in the video as a variable)
But I’m a bit reluctant to go into the direction of using multiple files, because the app is going to be used by someone to generate promotional material from it. And I want to keep the app stupid simple, video in, add my layers, video out.
Maybe there are some other c++ libraries that have the capability of reading the audio of a video file or I could use some commandline tools to separate the file in the background, but if there is any OF way of doing this that would definitely be great!
OF doesn’t support this right away but using gstreamer you can access the audio stream by setting your own pipeline and in the audio part using a tee to send the audio both to the normal audio sink and to for example an appsink so you can read the audio stream from the application or even use the spectrum plugin https://gstreamer.freedesktop.org/documentation/spectrum/index.html?gi-language=c + appsink to directly get the fft analisys. it’s not very straightforward but is possible to do it
Ah awesome, i came across your ofxGStreamer addon looking for solutions.
I definitely need to read into the GStreamer framework though but it looks comprehensive and worth getting into!
I have a Axis P1343 with build in mic and I can hear the audio through my computer speakers well.
I also have a P3245 with attached external mic which only plays audio for the first 2 seconds and then the audio stream get noisy.
question 1:
is there anything in terms of audio sampleRate that can be set for the gStreamer?
question 2:
just like the previous posters I am interested in accessing the audio stream, in order to record them along with the video. Since the gStreamer does not show up as an audio device I think can’t use ofSoundStream to pipe the audio in to my ofxFFmpegRecorder.