Page 1 of 1

Filterchain issue

Posted: Sun Jan 15, 2017 3:33 pm
by Muxson
I'm trying to identify if a stereo file is actually a "dual mono" or a "true stereo", i.e. exactly the same content on the Left and Right channel or not.

Here is my process. If you have a better idea, let me know...
1. take a subset of the InFile (to reduce processing time)
2. Invert the phase of the 2nd channel
3. Add Left and Right.
4. Get stats to find out if the signal is completely cancelled (dual mono) or not (true stereo).

So fare I managed to run the steps 1-3 and create a file, then run astats on the file for step 4.
Running the 4 steps in one call does not work for me.

Here is the code that works:

Code: Select all

ffmpeg -ss 30 -t 1 -i "in" -af "aeval=val(0)|-val(1)" -ac 1 "sub"
ffmpeg -i "sub" -af astats -f null -
Or

Code: Select all

ffmpeg -ss 30 -t 1 -i "in" -af "aeval=val(0)-val(1)" "sub"
ffmpeg -i "sub" -af astats -f null -
But the combination of both does not work:

Code: Select all

ffmpeg -ss 30 -t 1 -i "in" -af "aeval=val(0)|-val(1)" -ac 1 -af astats -f null -
What am I doing wrong?

I tried piping but probably made a syntax error...

Code: Select all

ffmpeg -ss 30 -t 1 -i "in" -af "aeval=val(0)|-val(1)" -ac 1 pipe:1 | ffmpeg -i pipe:0 -af astats -f null -
Thanks for any help!
(And yes, I did read the documentation and visited forums...)

Re: Filterchain issue

Posted: Sun Jan 15, 2017 8:50 pm
by richardpl
You can only use one -af.

Try this:

Code: Select all

ffmpeg -ss 30 -t 1 -i "in" -af "aeval=val(0)|-val(1),channelsplit,amix,astats -f null -

Re: Filterchain issue

Posted: Sun Jan 15, 2017 9:58 pm
by Muxson
Wow, thanks richardpl! That's it!

I didn't know
richardpl wrote:You can only use one -af.
The following code works now:

Code: Select all

ffmpeg -ss 30 -t 1 -i "in" -af "aeval=val(0)|-val(1)",channelsplit,amix,astats -f null -
(There was just a " missing)

Many thanks!

Re: Filterchain issue

Posted: Mon Jul 10, 2017 6:39 am
by Johnsturrock
I am using ffmpeg js for highlighting code.

CODE: SELECT ALL
ffmpeg -ss 30 -t 1 -i "in" -af "aeval=val(0)|-val(1),channelsplit,amix,astats -f null -

Re: Filterchain issue

Posted: Mon Jul 31, 2017 10:05 pm
by Muxson
Hi John,

Thanks for your input but I can't make sense of it.
Can you be a bit more explicit please?

Thank you,
Muxson