streamlink \ --player=mpv \ --twitch-proxy-playlist=https://as.luminous.dev \…
- User
streamlink
--player=mpv
--twitch-proxy-playlist=https://as.luminous.dev
--twitch-api-header Client-ID=ue6666qo983tsx6so1t0vnawi233wa
-O FILEPATH - Assistant
streamlink
--player=mpv
--twitch-proxy-playlist=https://as.luminous.dev
--twitch-api-header Client-ID=ue6666qo983tsx6so1t0vnawi233wa
-O FILEPATH
gives
[in#0 @ 0x3d9bed00] Error opening input: Invalid data found when processing input Error opening input file pipe:0. Error opening input files: Invalid data found when processing input
The error message:
[in#0 @ 0x3d9bed00] Error opening input: Invalid data found when processing input
Error opening input file pipe:0.
Error opening input files: Invalid data found when processing input.
means that ffmpeg is trying to read from the pipe: input but the data received is either invalid or in a format it can't recognize.
streamlink is being asked to output -O which means "output the raw stream to stdout".ffmpeg via pipe:.streamlink might not be a raw media stream but a playlist (e.g., HLS, m3u8).ffmpeg expects a recognizable video/audio stream but instead it's getting playlist text, or the stream format is different from what it expects.streamlink outputsstreamlink --player=none -O $URL > test.dump
file test.dump
head -20 test.dump
test.dump so you can verify if it's binary data or just a playlist text (like an m3u8 playlist).ffmpeg can't read the playlist text. Instead, ffmpeg needs the media URLs or raw transport stream data.Let streamlink play with mpv and save the stream separately
Alternatively, if you want ffmpeg to segment and encode, you can use streamlink to get the direct stream URL and give that URL to ffmpeg.
Possible fix: Avoid -O and let streamlink play the stream in mpv or directly feed the stream URL
Use streamlink to get the direct stream URL:
You can do:
streamlink --stream-url $URL best
This returns the direct media stream URL that you can feed into ffmpeg directly.
Example:
stream_url=$(streamlink --stream-url $URL best)
ffmpeg -i "$stream_url" -c:v copy -c:a aac -f segment -segment_time 180 -segment_wrap 4 $FILEPATH
streamlink -O outputs the stream content directly, but sometimes the format isn't playing well through a pipe.streamlink --stream-url outputs the URL of the stream.ffmpeg can stream directly from URLs (like HLS) more reliably.Try the following change:
stream_url=$(streamlink --twitch-proxy-playlist=https://as.luminous.dev \
--twitch-api-header Client-ID=ue6666qo983tsx6so1t0vnawi233wa \
--stream-url $URL best)
ffmpeg -nostats -y -i "$stream_url" -c:v copy -c:a aac -f segment -segment_time 180 -segment_wrap 4 $FILEPATH
This should fix the issue by letting ffmpeg open a proper stream URL rather than a pipe of potentially unrecognized stream data.
If you want to keep the pipe method, it's more complicated and depends on stream formats. Often ffmpeg used with streamlink -O requires explicit demuxers/decoders and may fail if streamlink outputs fragmented data or metadata packets.
Let me know if you want help debugging the exact format of the streamlink -O output!
Not yet included in a published release.