stream.dash: fix missing FFMPEGMuxer.is_usable() #6306
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DASH streams currently fail with an ugly error traceback if FFmpeg is unavailable or can't be used.
This is because the
FFMPEGMuxer
instance which is created inDASHStream.open()
checks forFFMPEGMuxer.is_usable()
itself in its constructor and raises aStreamError
if FFmpeg is unavailable. This is bad for multiple reasons, because the substreams were already opened and don't get closed properly in this case, and their respective worker threads still try to enqueue new segments, leading to the error. On top of that, some class attributes are uninitialized and another thread-join call fails too.As a simple solution for now, check for the FFmpeg availabilty in
DASHStream.open()
before opening any substreams. This fix also has the side-effect of falling through to video-only or audio-only streams if FFmpeg is unavailable, which the warning message from the availability check already implies, so this is actually preferred.This is all far from ideal though and the entire FFMPEGMuxer implementation needs to be rewritten from scratch. I've explained that in the stream selection overhaul thread.
Going to have another look at the changes later before merging...
master
PR (video-only stream output)