-
Notifications
You must be signed in to change notification settings - Fork 0
/
live-audio-filter-test-scripts.txt
165 lines (111 loc) · 9.51 KB
/
live-audio-filter-test-scripts.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
## Audio ffprobe
ffprobe -f lavfi -i "amovie=/Users/aweaver/Desktop/Downbeats.mp3,astats=metadata=1:reset=1:length=0.4[out]" -show_frames -show_versions -of xml=x=1:q=1 -noprivate | gzip > input_file.qctools.xml.gz
##Cue Sheet Ideas/Examples
seconds to date command
date -j -v0H -f %s "${start_time}" "+%M:%S:00" 2> /dev/null
Basic Cue Sheet layout
FILE "waseumc_barton15007_vandals.flac" WAVE
TRACK 01 AUDIO
INDEX 01 00:00:00
TRACK 02 AUDIO
INDEX 01 02:25:00
TRACK 03 AUDIO
INDEX 01 04:49:00
Array idea for silence detect
start_time=($(ffprobe -v 0 -f lavfi amovie="/Users/aweaver/Desktop/waseumc_barton15007_vandals.flac",silencedetect=noise=-57dB:d=2 -show_entries frame_tags=lavfi.silence_start,lavfi.silence_end -of default=nk=0:nw=1 | grep TAG:lavfi.silence_end | cut -d'=' -f2 | tr "\n" " "))
array loop
for i in "${start_time[@]}"; do date -j -v0H -f %s "$i" "+%M:%S:00" 2> /dev/null; done
##Current working recording using FFplay
ffmpeg -f avfoundation -i 'none:0' -f wav -c:a pcm_s24le -ar 96000 -y PIPE2REC -f wav -c:a pcm_s16le -ar 44100 - |\
ffplay -window_title "Skookum Player" -f lavfi \
"amovie='pipe\:0',asplit=6[out1][a][b][c][d][e],\
[e]showvolume=w=700:c=0xff0000:r=30[e1],\
[a]showfreqs=mode=bar:cmode=separate:size=300x300:colors=magenta|yellow[a1],\
[a1]drawbox=12:0:3:300:white@0.2[a2],[a2]drawbox=66:0:3:300:white@0.2[a3],[a3]drawbox=135:0:3:300:white@0.2[a4],[a4]drawbox=202:0:3:300:white@0.2[a5],[a5]drawbox=271:0:3:300:white@0.2[aa],\
[b]avectorscope=s=300x300:r=30:zoom=5[b1],\
[b1]drawgrid=x=150:y=150:c=white@0.3[bb],\
[c]showspectrum=s=400x600:mode=combined:color=rainbow:scale=lin:saturation=4[cc],\
[d]astats=metadata=1:reset=1,adrawgraph=lavfi.astats.Overall.Peak_level:max=0:min=-30.0:size=700x256:bg=Black[dd],\
[dd]drawbox=0:0:700:42:hotpink@0.2:t=42[ddd],\
[aa][bb]vstack[aabb],[aabb][cc]hstack[aabbcc],[aabbcc][ddd]vstack[aabbccdd],[e1][aabbccdd]vstack[z],\
[z]drawtext=fontfile=/Library/Fonts/Andale Mono.ttf: text='%{pts \\: hms}':x=460: y=50:fontcolor=white:fontsize=30:box=1:boxcolor=0x00000000@1[fps],[fps]fps=fps=30[out0]" | ffmpeg -i PIPE2REC -c copy -y test.wav
##Current working recording
ffmpeg -f avfoundation -i 'none:0' -f wav -c:a pcm_s24le -ar 96000 OUT.wav -f wav -c:a pcm_s16le -ar 44100 - |\
mpv - --title="Skookum Player" --autofit=90%x90% -lavfi-complex "[aid1]asplit=6[ao][a][b][c][d][e],\
[e]showvolume=w=700:r=30[e1],\
[a]showfreqs=mode=bar:cmode=separate:size=300x300:colors=magenta|yellow[a1],\
[a1]drawbox=12:0:3:300:white@0.2[a2],[a2]drawbox=66:0:3:300:white@0.2[a3],[a3]drawbox=135:0:3:300:white@0.2[a4],[a4]drawbox=202:0:3:300:white@0.2[a5],[a5]drawbox=271:0:3:300:white@0.2[aa],\
[b]avectorscope=s=300x300:r=30:zoom=5[b1],\
[b1]drawgrid=x=150:y=150:c=white@0.3[bb],\
[c]showspectrum=s=400x600:mode=combined:color=rainbow:scale=lin:saturation=4[cc],\
[d]astats=metadata=1:reset=2,adrawgraph=lavfi.astats.Overall.Peak_level:max=0:min=-30.0:size=700x256:bg=Black[dd],\
[dd]drawbox=0:0:700:42:hotpink@0.2:t=42[ddd],\
[aa][bb]vstack[aabb],[aabb][cc]hstack[aabbcc],[aabbcc][ddd]vstack[aabbccdd],[e1][aabbccdd]vstack[z],\
[z]drawtext=fontfile=/Library/Fonts/Andale Mono.ttf: text='%{pts \\: hms}':x=460: y=50:fontcolor=white:fontsize=30:box=1:boxcolor=0x00000000@1[fps],[fps]fps=fps=30[vo]"
##Current build w/kexp input
ffmpeg -i http://live-mp3-128.kexp.org/ -f flac -ar 48000 pipe:1 | ffplay -window_title "Skookum Player" -f lavfi \
"amovie='pipe\:0',asplit=6[out1][a][b][c][d][e],\
[e]showvolume=w=700:c=0xff0000:r=60[e1],\
[a]showfreqs=mode=bar:cmode=separate:size=300x300:colors=magenta|yellow[a1],\
[a1]drawbox=12:0:3:300:white@0.2[a2],[a2]drawbox=66:0:3:300:white@0.2[a3],[a3]drawbox=135:0:3:300:white@0.2[a4],[a4]drawbox=202:0:3:300:white@0.2[a5],[a5]drawbox=271:0:3:300:white@0.2[aa],\
[b]avectorscope=s=300x300:r=60:zoom=5[b1],\
[b1]drawgrid=x=150:y=150:c=white@0.3[bb],\
[c]showspectrum=s=400x600:mode=combined:color=rainbow:scale=log[cc],\
[d]astats=metadata=1:reset=1,adrawgraph=lavfi.astats.Overall.Peak_level:max=0:min=-30.0:size=700x256:bg=Black[dd],\
[dd]drawbox=0:0:700:42:hotpink@0.2:t=42[ddd],\
[aa][bb]vstack[aabb],[aabb][cc]hstack[aabbcc],[aabbcc][ddd]vstack[aabbccdd],[e1][aabbccdd]vstack[z],\
[z]drawtext=fontfile=/Library/Fonts/Andale Mono.ttf: text='%{pts \\: hms}':x=460: y=50:fontcolor=white:fontsize=30:box=1:boxcolor=0x00000000@1[out0]"
##MPV Current Graph w/kexp input
mpv http://live-mp3-128.kexp.org/ --title="Skookum Player" -lavfi-complex "[aid1]asplit=6[ao][a][b][c][d][e],\
[e]showvolume=w=700:r=60[e1],\
[a]showfreqs=mode=bar:cmode=separate:size=300x300:colors=magenta|yellow[a1],\
[a1]drawbox=12:0:3:300:white@0.2[a2],[a2]drawbox=66:0:3:300:white@0.2[a3],[a3]drawbox=135:0:3:300:white@0.2[a4],[a4]drawbox=202:0:3:300:white@0.2[a5],[a5]drawbox=271:0:3:300:white@0.2[aa],\
[b]avectorscope=s=300x300:r=60:zoom=5[b1],\
[b1]drawgrid=x=150:y=150:c=white@0.3[bb],\
[c]showspectrum=s=400x600:mode=combined:color=rainbow:scale=log[cc],\
[d]astats=metadata=1:reset=1,adrawgraph=lavfi.astats.Overall.Peak_level:max=0:min=-30.0:size=700x256:bg=Black[dd],\
[dd]drawbox=0:0:700:42:hotpink@0.2:t=42[ddd],\
[aa][bb]vstack[aabb],[aabb][cc]hstack[aabbcc],[aabbcc][ddd]vstack[aabbccdd],[e1][aabbccdd]vstack[z],\
[z]drawtext=fontfile=/Library/Fonts/Andale Mono.ttf: text='%{pts \\: hms}':x=460: y=50:fontcolor=white:fontsize=30:box=1:boxcolor=0x00000000@1[vo]"
##Current Recording build w/kexp input
ffmpeg -i http://live-mp3-128.kexp.org/ -f wav -c:a pcm_s24le -ar 96000 -y PIPE2REC -f flac -ar 48000 -y PIPE2PLAY | ffplay -window_title "Skookum Player" -f lavfi \
"amovie='PIPE2PLAY',asplit=6[out1][a][b][c][d][e],\
[e]showvolume=w=700:c=0xff0000:r=60[e1],\
[a]showfreqs=mode=bar:cmode=separate:size=300x300:colors=magenta|yellow[a1],\
[a1]drawbox=12:0:3:300:white@0.2[a2],[a2]drawbox=66:0:3:300:white@0.2[a3],[a3]drawbox=135:0:3:300:white@0.2[a4],[a4]drawbox=202:0:3:300:white@0.2[a5],[a5]drawbox=271:0:3:300:white@0.2[aa],\
[b]avectorscope=s=300x300:r=60:zoom=5[b1],\
[b1]drawgrid=x=150:y=150:c=white@0.3[bb],\
[c]showspectrum=s=400x600:mode=combined:color=rainbow:scale=log[cc],\
[d]astats=metadata=1:reset=1,adrawgraph=lavfi.astats.Overall.Peak_level:max=0:min=-30.0:size=700x256:bg=Black[dd],\
[dd]drawbox=0:0:700:42:hotpink@0.2:t=42[ddd],\
[aa][bb]vstack[aabb],[aabb][cc]hstack[aabbcc],[aabbcc][ddd]vstack[aabbccdd],[e1][aabbccdd]vstack[z],\
[z]drawtext=fontfile=/Library/Fonts/Andale Mono.ttf: text='%{pts \\: hms}':x=460: y=50:fontcolor=white:fontsize=30:box=1:boxcolor=0x00000000@1[out0]" | ffmpeg -i PIPE2REC -c copy ~/desktop/test.wav
##Messing with colors
ffmpeg -i http://live-mp3-128.kexp.org/ -f flac -ar 48000 pipe:1 | ffplay -window_title "Skookum Player" -f lavfi \
"amovie='pipe\:0',asplit=6[out1][a][b][c][d][e],\
[e]showvolume=w=700:c=0xff0000:r=60[e1],\
[a]showfreqs=mode=bar:cmode=separate:size=300x300:colors=magenta|yellow[a1],\
[a1]drawbox=12:0:3:300:white@0.2[a2],[a2]drawbox=66:0:3:300:white@0.2[a3],[a3]drawbox=135:0:3:300:white@0.2[a4],[a4]drawbox=202:0:3:300:white@0.2[a5],[a5]drawbox=271:0:3:300:white@0.2[aa],\
[b]avectorscope=s=300x300:r=60:zoom=5[bb],\
[c]showspectrum=s=400x600:mode=combined:color=rainbow:scale=log[cc],\
[d]astats=metadata=1:reset=1,adrawgraph=lavfi.astats.Overall.Peak_level:max=2.0:min=-20.0:size=700x256:bg=DimGray[dd],\
[aa][bb]vstack[aabb],[aabb][cc]hstack[aabbcc],[aabbcc][dd]vstack[aabbccdd],[e1][aabbccdd]vstack[z],\
[z]drawtext=fontfile=/Library/Fonts/Andale Mono.ttf: text='%{pts \\: hms}':x=460: y=50: fontcolor=white:fontsize=30:box=1: boxcolor=0x00000000@1[zz],\
[zz]drawbox=0:640:700:20:white@0.3:t=max[out0]"
ffmpeg -f avfoundation -i ":0" -f nut pipe:1 | ffplay -f lavfi "amovie='pipe\:0',asplit=2[out1][a],[a]avectorscope[out0]"
Random example
ffmpeg -f avfoundation -i ":0" -f flac -ar 48000 pipe:1 | ffplay -window_title "Skookum Player" -f lavfi "amovie='pipe\:0',asplit=4[out1][a][b][c],[a]showfreqs=mode=line:cmode=separate:size=400x400:colors=magenta[aa],[b]avectorscope=r=60:zoom=5[bb],[c]showspectrum=s=400x800:mode=combined:color=rainbow:scale=log[cc],[aa][bb]vstack[aabb],[aabb][cc]hstack[out0]"
Example with KEXP for input signal
ffmpeg -i http://live-mp3-128.kexp.org/ -f flac -ar 48000 pipe:1 | ffplay -window_title "Skookum Player" -f lavfi "amovie='pipe\:0',asplit=4[out1][a][b][c],[a]showfreqs=mode=line:cmode=separate:size=400x400:colors=magenta|yellow[aa],[b]avectorscope=r=60:zoom=5[bb],[c]showspectrum=s=400x800:mode=combined:color=rainbow:scale=log[cc],[aa][bb]vstack[aabb],[aabb][cc]hstack[out0]"
Example with KEXP and Mean_diff graph
ffmpeg -i http://live-mp3-128.kexp.org/ -f flac -ar 48000 pipe:1 | ffplay -window_title "Skookum Player" -f lavfi "amovie='pipe\:0',asplit=5[out1][a][b][c][d],[a]showfreqs=mode=line:cmode=separate:size=300x300:colors=magenta|yellow[aa],[b]avectorscope=s=300x300:r=60:zoom=5[bb],[c]showspectrum=s=400x600:mode=combined:color=rainbow:scale=log[cc],[d]astats=metadata=1:reset=1,adrawgraph=lavfi.astats.Overall.Mean_difference:max=8000:size=700x256[dd],[aa][bb]vstack[aabb],[aabb][cc]hstack[aabbcc],[aabbcc][dd]vstack[out0]"
Example of showfreqs
-f lavfi "amovie='input',showfreqs=mode=line:size=400x400:colors=magenta[out]"
example of adrawgraphs for maxdiff (needs refinemen to be useful)
astats=metadata=1:reset=1,adrawgraph=lavfi.astats.Overall.Max_difference:max=1000
Generate and pipe sine wave
ffmpeg -f lavfi -i "sine=frequency=400" -f flac pipe:1 |
Timecode example:
"drawtext=fontfile=/Library/Fonts/Andale Mono.ttf: timecode='00\:00\:00\:00':r=100:x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1"
Timecode example 2:
"drawtext=fontfile=/Library/Fonts/Andale Mono.ttf:text='%{pts \\: hms}':fontcolor=white@0.8"