Measuring audio cross correlation

Questions and answers on how to get the most out of FFAStrans
Post Reply
Pogle
Posts: 12
Joined: Fri Mar 27, 2020 10:03 am

Measuring audio cross correlation

Post by Pogle »

Hello everyone,

I've used FFAStrans for some days now and I'm quite enthusiastic about this tool. I realized some simple workflows. But now I'm struggling.
In our archive we have video files with problematic audio channels. Those audio channels (ch.1 and 2 only) have a negative cross correlation (nearly to exactly inverted phase polarity). I'd like to measure the cross correlation of audio ch. 1 and 2 initially and evaluate it in a conditional node to feed the affected files to a different node (e.g. to a channel mapper).
I found the axcorrelate filter in FFmpeg but it is not working / I don't know how to use it correctly ("No such filter: axcorrelate"). Additionally I tried the Aphasemeter filter.
With "-i source.wav -af aphasemeter=video=0,ametadata=print:file=sourcecorrelation.txt -f null -" I can write the cross correlation data into a textfile. But I don't know how (I don't have enough scripting skills yet) to extract these values, calculate the average and feed it back to a conditional node of FFAStrans.
Does anyone have an idea how to realize such a workflow?

Greetings
Pogle
admin
Site Admin
Posts: 1680
Joined: Sat Feb 08, 2014 10:39 pm

Re: Measuring audio cross correlation

Post by admin »

Hi Pogle,

The "axcorrelate" is not available in the shipped build of ffmpeg which is from October 2019. The filter was added late last year (2019) and so it should be available in newer builds. However, I've never looked at this but your question is in no doubt interesting analyzing that should live well as a FFAStrans node. In time, I will take look at a way to implement it. But for now, as you write, getting these values into FFAStrans now will take some scripting. Maybe someone would like to take a shot at this? Of not, I will see when I have time.

-steinar
Pogle
Posts: 12
Joined: Fri Mar 27, 2020 10:03 am

Re: Measuring audio cross correlation

Post by Pogle »

Hello Steinar,

thank you for your quick response and your willingness to help!
Post Reply