Filterchain issue

Anything that does not fit into the other categories.
Post Reply
Muxson
Posts: 20
Joined: Wed Nov 23, 2016 3:03 pm

Filterchain issue

Post by Muxson » Sun Jan 15, 2017 3:33 pm

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...)

richardpl
Posts: 20
Joined: Sat Aug 01, 2015 6:35 pm

Re: Filterchain issue

Post by richardpl » Sun Jan 15, 2017 8:50 pm

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 -

Muxson
Posts: 20
Joined: Wed Nov 23, 2016 3:03 pm

Re: Filterchain issue

Post by Muxson » Sun Jan 15, 2017 9:58 pm

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!

Johnsturrock
Posts: 1
Joined: Mon Jul 10, 2017 6:34 am

Re: Filterchain issue

Post by Johnsturrock » Mon Jul 10, 2017 6:39 am

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 -

Muxson
Posts: 20
Joined: Wed Nov 23, 2016 3:03 pm

Re: Filterchain issue

Post by Muxson » Mon Jul 31, 2017 10:05 pm

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

Post Reply