Skip to content

stream.ffmpegmux: show warning if unavailable #4781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2022

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Aug 28, 2022

There is way too much confusion about FFmpeg and muxed streams.

The problem is that it's not transparent at all which streams are muxed and which are not. This is due to how streams get returned, as a mapping of name->stream dicts or tuples with "alt" deduplications already done by the Stream implementations themselves or the plugin.streams() method, and only names get shown by the CLI.

The HLS implementation with external audio streams is also not ideal, because it silently falls back to streams without external audio. That needs to be changed, ideally with the implementation of alternative video streams (#3579).

So in order to at least give the user some feedback, let's add warning messages when FFmpeg is not available on the system.
The warning messages get only shown once if multiple checks are done, thanks to the caching added recently.

I decided to add two warning messages and tried to make them as short and precise as possible. Referring to the CLI argument name is not 100% correct, but since the session option does have the same name, it's fine. The empty set is also always a subset, so that should be fine, too.


UStreamTV plugin which requires FFmpeg:

$ streamlink 'https://www.ustream.tv/nasahdtv'
[cli][info] Found matching plugin ustreamtv for URL https://www.ustream.tv/nasahdtv
Available streams: 252p+a84k (worst), 252p+a95k, 360p+a84k, 360p+a95k, 486p+a84k, 486p+a95k, 720p+a84k, 720p+a95k (best)

$ streamlink --ffmpeg-ffmpeg=/dev/null 'https://www.ustream.tv/nasahdtv'
[cli][info] Found matching plugin ustreamtv for URL https://www.ustream.tv/nasahdtv
[stream.ffmpegmux][warning] FFmpeg was not found. See the --ffmpeg-ffmpeg option.
[stream.ffmpegmux][warning] Muxing streams is unsupported! Only a subset of the available streams can be returned!
error: No playable streams found on this URL: https://www.ustream.tv/nasahdtv

YouTube plugin with adaptive streams - #4777:

$ streamlink 'https://www.youtube.com/watch?v=0Jt8Wu1osgI'
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/watch?v=0Jt8Wu1osgI
Available streams: audio_mp4a, audio_opus, 144p (worst), 240p, 360p, 480p, 720p, 720p60, 1080p60, 1440p60, 2160p60 (best)

$ streamlink --ffmpeg-ffmpeg=/dev/null 'https://www.youtube.com/watch?v=0Jt8Wu1osgI'
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/watch?v=0Jt8Wu1osgI
[stream.ffmpegmux][warning] FFmpeg was not found. See the --ffmpeg-ffmpeg option.
[stream.ffmpegmux][warning] Muxing streams is unsupported! Only a subset of the available streams can be returned!
Available streams: audio_mp4a, audio_opus, 360p (worst), 720p (best)

HLS streams with external audio:

$ streamlink 'https://www.france.tv/france-2/direct.html'
[cli][info] Found matching plugin pluzz for URL https://www.france.tv/france-2/direct.html
Available streams: 144p (worst), 216p, 360p, 540p, 720p (best)

$ streamlink --ffmpeg-ffmpeg=/dev/null 'https://www.france.tv/france-2/direct.html'
[cli][info] Found matching plugin pluzz for URL https://www.france.tv/france-2/direct.html
[stream.ffmpegmux][warning] FFmpeg was not found. See the --ffmpeg-ffmpeg option.
[stream.ffmpegmux][warning] Muxing streams is unsupported! Only a subset of the available streams can be returned!
Available streams: 144p (worst), 216p, 360p, 540p, 720p (best)

@gravyboat
Copy link
Member

Great addition @bastimeyer. Hopefully this will cut down on people not having FFmpeg and asking for help.

@gravyboat gravyboat merged commit cc0f978 into streamlink:master Aug 28, 2022
@bastimeyer bastimeyer deleted the stream/ffmpegmux/warning branch August 28, 2022 19:19
@bastimeyer bastimeyer mentioned this pull request Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants