Page 1 of 1

Measuring audio cross correlation

Posted: Mon Apr 13, 2020 6:56 pm
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

Re: Measuring audio cross correlation

Posted: Mon Apr 13, 2020 9:54 pm
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

Re: Measuring audio cross correlation

Posted: Wed Apr 15, 2020 8:09 am
by Pogle
Hello Steinar,

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