I'm attempting to set headers (as suggested here) for my ffmpeg concat
command like so:
ffmpeg \
-f concat \
-safe 0 \
-protocol_whitelist file,http,https,tcp,tls \
-headers $'Content-Type: audio/wav\r\n' \
-i 'inputs.txt' \
-c 'copy' 'output.wav' \
-v trace
where my input file is structured as such:
file 'https://path/to/file1'
file 'https://path/to/file2'
file 'https://path/to/file3'
However, when I run the command, ffmpeg doesn't set the headers, as seen by the output of -v:
[http @ 0x7fa133d01080] request: GET / HTTP/1.1
User-Agent: Lavf/58.20.100
Accept: */*
Range: bytes=0-
Connection: close
Host: localhost:3001
Icy-MetaData: 1
What's strange is if I set my input not through an input txt and just through -i /path/to file
(as seen below) it works just fine.
ffmpeg \
-f concat \
-safe 0 \
-protocol_whitelist file,http,https,tcp,tls \
-headers $'Content-Type: audio/wav\r\n' \
-i 'https://google.com' \
-c 'copy' 'output.wav' \
-v trace
Output of -v:
[https @ 0x7fed3ac03940] request: GET / HTTP/1.1
User-Agent: Lavf/58.20.100
Accept: */*
Range: bytes=0-
Connection: close
Host: google.com
Icy-MetaData: 1
Content-Type: audio/wav
Not sure why reading the inputs through a file would affect the headers getting sent. For now the workaround is to use a string concatenating all of the inputs (a bit messier than I'd like), but I'm curious if anyone might know why this is happening.
UPDATE: According to this post I have to read inputs through a text file, so I'm back to square one....