Okay! After many hours I am making some progress (if anyone is interested).
This extracts the channels, recognises the ac3 and decodes it but there
are errors thrown from time to time and the rate is not constant.
ffmpeg -f avfoundation -capture_raw_data true -i :2 -filter_complex "\
[0:a]pan=1C|c0=c0[a0];\
[0:a]pan=1C|c0=c1[a1];\
[a0][a1]amerge=inputs=2[a3]" -map '[a3]' \
-f s16le - \
| ffmpeg -loglevel debug \
-acodec ac3 -i - \
-af 'pan=5.1|c0=FL|c1=FR|c4=FC|c5=LFE|c2=SL|c3=SR' \
-ar 48000 -y output.wav
How can I clean this up and make it more stable?
Thanks
-Fred
On 28/10/2023 15:36, Fred Rotbart wrote:
Here is one of my many other attempts. It should be clear that I am a
beginner with ffmpeg.
No matter what I try, ffmpeg seems to merge all the 32 USB channels
into 6.
For example:
ffmpeg -ac 2 -c ac3 -loglevel debug -f avfoundation -i :2 -af
'pan=5.1' output.wav
Part of the output:
Splitting the commandline.
Reading option '-ac' ... matched as option 'ac' (set number of audio
channels) with argument '2'.
Reading option '-c' ... matched as option 'c' (codec name) with
argument 'ac3'.
Reading option '-loglevel' ... matched as option 'loglevel' (set
logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with
argument 'avfoundation'.
Reading option '-i' ... matched as input url with argument ':2'.
Reading option '-af' ... matched as option 'af' (set audio filters)
with argument 'pan=5.1'.
Reading option 'output.wav' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url :2.
Applying option ac (set number of audio channels) with argument 2.
Applying option c (codec name) with argument ac3.
Applying option f (force format) with argument avfoundation.
Successfully parsed a group of options.
Opening an input file: :2.
[avfoundation @ 0x7f96400041c0] audio device 'Digiface USB (24162724)'
opened
For transform of length 128, inverse, mdct_float, flags: [aligned,
out_of_place], found 3 matches:
1: mdct_inv_float_avx2 - type: mdct_float, len: [16, ∞],
factors[2]: [2, any], flags: [aligned, out_of_place, inv_only], prio: 544
2: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]:
[2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
3: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞],
factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only],
prio: -130976
For transform of length 64, inverse, fft_float, flags: [aligned,
inplace, preshuf, asm_call], found 3 matches:
1: fft_sr_asm_float_avx2 - type: fft_float, len: [64, 131072],
factor: 2, flags: [aligned, inplace, out_of_place, preshuf, asm_call],
prio: 480
2: fft_sr_asm_float_fma3 - type: fft_float, len: [64, 131072],
factor: 2, flags: [aligned, inplace, out_of_place, preshuf, asm_call],
prio: 448
3: fft_sr_asm_float_avx - type: fft_float, len: [64, 131072],
factor: 2, flags: [aligned, inplace, out_of_place, preshuf, asm_call],
prio: 416
Transform tree:
mdct_inv_float_avx2 - type: mdct_float, len: 128, factors[2]: [2,
any], flags: [aligned, out_of_place, inv_only]
fft_sr_asm_float_avx2 - type: fft_float, len: 64, factor: 2,
flags: [aligned, inplace, out_of_place, preshuf, asm_call]
For transform of length 256, inverse, mdct_float, flags: [aligned,
out_of_place], found 3 matches:
1: mdct_inv_float_avx2 - type: mdct_float, len: [16, ∞],
factors[2]: [2, any], flags: [aligned, out_of_place, inv_only], prio: 544
2: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]:
[2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
3: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞],
factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only],
prio: -130976
For transform of length 128, inverse, fft_float, flags: [aligned,
inplace, preshuf, asm_call], found 3 matches:
1: fft_sr_asm_float_avx2 - type: fft_float, len: [64, 131072],
factor: 2, flags: [aligned, inplace, out_of_place, preshuf, asm_call],
prio: 480
2: fft_sr_asm_float_fma3 - type: fft_float, len: [64, 131072],
factor: 2, flags: [aligned, inplace, out_of_place, preshuf, asm_call],
prio: 448
3: fft_sr_asm_float_avx - type: fft_float, len: [64, 131072],
factor: 2, flags: [aligned, inplace, out_of_place, preshuf, asm_call],
prio: 416
Transform tree:
mdct_inv_float_avx2 - type: mdct_float, len: 256, factors[2]: [2,
any], flags: [aligned, out_of_place, inv_only]
fft_sr_asm_float_avx2 - type: fft_float, len: 128, factor: 2,
flags: [aligned, inplace, out_of_place, preshuf, asm_call]
[avfoundation @ 0x7f96400041c0] All info found
Input #0, avfoundation, from ':2':
Duration: N/A, start: 1307454.032041, bitrate: N/A
Stream #0:0, 1, 1/100: Audio: ac3, 44100 Hz, 32 channels, fltp
Successfully opened the file.