celluloid
celluloid copied to clipboard
Can't open RTSP stream with Basic Auth from CLI
Description: Cannot open RTSP stream from CLI that requires username and password
Steps to Reproduce:
- Run
$ celluloid 'rtsp://username:password@host'
Actual Results: Video does not open, showing the error "Playback was terminated abnormally. Reason: unrecognized file format."
Expected Results: Video stream opens in the app.
Version: Celluloid 0.21, MPV 0.33.1-dirty, FFmpeg n4.4
Additional Information: Here's the output from a real run with MPV logging ($ celluloid 'rtsp://admin:[email protected]' --mpv-msg-level=all=v
):
celluloid-Message: 09:26:21.124: [cplayer] Set property: volume=100.000000 -> 1
celluloid-Message: 09:26:21.124: [cplayer] Set property: loop-playlist="no" -> 1
celluloid-Message: 09:26:21.124: [cplayer] Set property: pause=true -> 1
celluloid-Message: 09:26:21.124: [cplayer] Set property: pause=false -> 1
celluloid-Message: 09:26:21.124: [cplayer] Set property: pause=false -> 1
celluloid-Message: 09:26:21.124: [cplayer] Running hook: ytdl_hook/on_load
celluloid-Message: 09:26:21.124: [ytdl_hook] ytdl:// hook
celluloid-Message: 09:26:21.124: [ytdl_hook] not a ytdl:// url
celluloid-Message: 09:26:21.124: [ffmpeg] Opening rtsp://[email protected]/
celluloid-Message: 09:26:21.124: [demux] Trying demuxers for level=request.
celluloid-Message: 09:26:21.135: [lavf] Found 'rtsp' at score=100 size=0 (forced).
celluloid-Message: 09:26:21.135: [lavf] Broken FFmpeg RTSP API => not setting timeout.
celluloid-Message: 09:26:21.150: [cplayer] Set property: window-maximized=true -> 1
celluloid-Message: 09:26:21.205: [ffmpeg/demuxer] rtsp: method OPTIONS failed: 401 Unauthorized
celluloid-Message: 09:26:21.205: [lavf] avformat_open_input() failed
celluloid-Message: 09:26:21.205: [cplayer] Opening failed or was aborted: rtsp://[email protected]/
celluloid-Message: 09:26:21.205: [cplayer] Running hook: ytdl_hook/on_load_fail
celluloid-Message: 09:26:21.205: [ytdl_hook] full hook
celluloid-Message: 09:26:21.205: [cplayer] finished playback, unrecognized file format (reason 4)
celluloid-Message: 09:26:21.205: [cplayer] Failed to recognize file format.
celluloid-Message: 09:26:21.205: [cplayer] Set property: pause=true -> 1
celluloid-Message: 09:26:21.205: [cplayer] Set property: pause=true -> 1
celluloid-Message: 09:26:21.225: [ffmpeg/demuxer] rtsp: method OPTIONS failed: 401 Unauthorized
celluloid-Message: 09:26:21.456: [cplayer] Set property: window-scale=783.000000 -> -4
celluloid-Message: 09:27:02.989: [cplayer] Shift+Super_L is not a valid input name.
This shows the reason for the error: the authentication failed ("401 Unauthorized"). It looks like auth fails because the password isn't getting sent to MPV -- it says "[ffmpeg] Opening rtsp://[email protected]/", where I would expect it to say "[ffmpeg] Opening rtsp://admin:[email protected]/".
When I run the same command with mpv
directly ($ mpv 'rtsp://admin:[email protected]' --msg-level=all=v
), the output includes "[ffmpeg] Opening rtsp://admin:[email protected]"
I'm guessing Celluloid is parsing the given file URL, then reconstructing it when it passes it off to MPV, and just forgot to include the password?
Update: Didn't think to try this before, but turns out that opening the stream from the "Open Location..." dialog when the app is already running works as expected and correctly opens the stream with the same URI ("rtsp://admin:[email protected]")
Confirmed. The password got removed when the URL is converted to GFile
and back.
after switch to archlinux, same issue, what's the status?
celluloid-0.24-2