Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support audio visualizations in player #748 #762

Merged
merged 10 commits into from
Jun 25, 2023

Conversation

ElderOrb
Copy link
Collaborator

No description provided.

@dericed
Copy link
Member

dericed commented May 31, 2023

This is a great start and thx for breaking it up into the debug section.

I tested this by enabling Normal, Waveform, Audio Bit Scope, and Audio Volume.

the debug output for that is

*** defined video filters ***: 

format=yuv444p,scale
format=yuv422p10le,waveform=intensity=0.1:mode=column:mirror=1:c=1:f=0:graticule=green:flags=numbers+dots:scale=0
*** defined audio filters ***: 

abitscope,drawgrid=w=iw:h=ih/8:t=1:c=gray@0.9
showvolume
*** VIDEO ***: 


*** layout ***: 

0_0|w0_0|0_h0|w0_h0|0_h0+h1|w0_h0+h1
*** video split ***: 

sws_flags=neighbor;split=2[x1][x2];
*** videoFilterString ***: 

[x1]format=yuv444p,scale[y1];[x2]format=yuv422p10le,waveform=intensity=0.1:mode=column:mirror=1:c=1:f=0:graticule=green:flags=numbers+dots:scale=0[z2];[z2][y1]scale2ref[y2][y1];
*** videoXstackInput ***: 

[y1][y2]
*** result ***: 

sws_flags=neighbor;split=2[x1][x2];[x1]format=yuv444p,scale[y1];[x2]format=yuv422p10le,waveform=intensity=0.1:mode=column:mirror=1:c=1:f=0:graticule=green:flags=numbers+dots:scale=0[z2];[z2][y1]scale2ref[y2][y1];[y1][y2]xstack=fill=slategray:inputs=2:layout=0_0|w0_0|0_h0|w0_h0|0_h0+h1|w0_h0+h1
*** AUDIO ***: 


*** audio split ***: 

asplit=2[a1][a2];
*** audioFilterString ***: 

[a1]abitscope,drawgrid=w=iw:h=ih/8:t=1:c=gray@0.9[b1];[a2]showvolume[b2];
*** audioXstackInput ***: 

[b1][b2]
*** result ***: 

asplit=2[a1][a2];[a1]abitscope,drawgrid=w=iw:h=ih/8:t=1:c=gray@0.9[b1];[a2]showvolume[b2];[b1][b2]xstack=fill=slategray:inputs=2:layout=

So to build the result we need:

  • adjust the xstack of the audioFilterString:result to use a layout fixed to 0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|0_h0+h1+h2+h3+h4 so the result would be
asplit=2[a1][a2];[a1]abitscope,drawgrid=w=iw:h=ih/8:t=1:c=gray@0.9[b1];[a2]showvolume[b2];[b1][b2]xstack=fill=slategray:inputs=2:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|0_h0+h1+h2+h3+h4
  • then if both videoFilterString:result is non-empty and audioFilterString:result is non-empty then do

videoFilterString[VFS];audioFilterString[AFS];[VFS][AFS]xstack=fill=slategray:inputs=2:layout=0_0|0_h0

else just the non-empty result as is. I suppose if both are empty then use Normal, so for above result the full combined audio and video result should be

sws_flags=neighbor;split=2[x1][x2];[x1]format=yuv444p,scale[y1];[x2]format=yuv422p10le,waveform=intensity=0.1:mode=column:mirror=1:c=1:f=0:graticule=green:flags=numbers+dots:scale=0[z2];[z2][y1]scale2ref[y2][y1];[y1][y2]xstack=fill=slategray:inputs=2:layout=0_0|w0_0|0_h0|w0_h0|0_h0+h1|w0_h0+h1[VFS];asplit=2[a1][a2];[a1]abitscope,drawgrid=w=iw:h=ih/8:t=1:c=gray@0.9[b1];[a2]showvolume[b2];[b1][b2]xstack=fill=slategray:inputs=2:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|0_h0+h1+h2+h3+h4[AFS];[VFS][AFS]xstack=fill=slategray:inputs=2:layout=0_0|0_h0

When I try locally with ffmpeg/ffplay, this works:

ffmpeg -i /Betacam_SP_Test_ffv1.mkv -filter_complex "sws_flags=neighbor;split=2[x1][x2];[x1]format=yuv444p,scale[y1];[x2]format=yuv422p10le,waveform=intensity=0.1:mode=column:mirror=1:c=1:f=0:graticule=green:flags=numbers+dots:scale=0[z2];[z2][y1]scale2ref[y2][y1];[y1][y2]xstack=fill=slategray:inputs=2:layout=0_0|w0_0|0_h0|w0_h0|0_h0+h1|w0_h0+h1[VFS];asplit=2[a1][a2];[a1]abitscope,drawgrid=w=iw:h=ih/8:t=1:c=gray@0.9[b1];[a2]showvolume[b2];[b1][b2]xstack=fill=slategray:inputs=2:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|0_h0+h1+h2+h3+h4[AFS];[VFS][AFS]xstack=fill=slategray:inputs=2:layout=0_0|0_h0" -f nut - | ffplay -

@ElderOrb ElderOrb force-pushed the audio_visualizations branch 2 times, most recently from c8f97cf to 08c66f2 Compare June 20, 2023 15:45
@dericed dericed changed the title wip on support audio visualizations in player #748 support audio visualizations in player #748 Jun 20, 2023
@dericed dericed merged commit 1986582 into bavc:main Jun 25, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants