I just found that Video mp4 is very broken on the latest Sigil builds because our custom url handler does not properly handle byte ranges that only get used for audio and video when loaded via a custom scheme:.
Here is a related bug report:
Quote:
When serving media files over custom resource handlers Chromium's media system (E.g. the <audio> tag) requests partial ranges of the target files. The exact partial ranges that it requests depends on the media file and the scheme that is being served over.
For example when using a custom HTTPS handler (E.g. https://resource/myfile.ogg) the media system treats the media file as a streaming object and requests the superfluous range of Range: bytes=0-, and when using a custom scheme handler (E.g. resource://localhost/myfile.ogg) the media file is treated as a non-streamed object and the media system requests more exact partial ranges such as Range: bytes=294912-.
In both cases FFmpeg errors are emitted to the log along the lines of following when attempting to play the media files:
MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"FFmpegDemuxer: open context failed"}
MediaEvent: PIPELINE_ERROR DEMUXER_ERROR_COULD_NOT_OPEN
or
MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"FFmpegDemuxer: data source error"}
MediaEvent: PIPELINE_ERROR PIPELINE_ERROR_READ
The root cause of these errors is due to CEF's StreamReaderURLLoader class not properly handling the partial ranges which sends incorrect data upstream to Chromium's media internals. In the case of Range: bytes=0- CEF incorrectly sets the expected_content_length in StreamReaderURLLoader::OnReaderSkipCompleted() to 0 instead of -1 which prevents the handler from writing the real content length to the response object in later code. I have not tested other possible ranges in detail as they have not yet shown up in my particular use case.
All of my testing was on a customized 3945 build on macOS but according to several forum threads it looks like it also affects other platforms and branches as wel
|
I will look into adding some sort of byte range streaming for our sigil scheme. Silly really since we offer up the entire file in a buffer but obviously needed with later Qt versions given our change to a url scheme handler.