However, if I disable multi_threaded_message_loop and use CefDoMessageLoopWork instead, I get a bunch of errors in my CEF log culminating in a divide by zero exception that crashes the browser.
I know that CEF needs to be built with priority codecs to support certain video playback, but why would the behavior differ depending on whether I'm using a multi-threaded message loop?
Here are the logs in each case for comparison.
With multi-threaded message loop (video plays fine):
- Code: Select all
[0124/145112.546:INFO:chunk_demuxer.cc(472)] ChunkDemuxer
[0124/145113.394:INFO:chunk_demuxer.cc(472)] ChunkDemuxer
[0124/145114.603:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=ex3C1-5Dhb8 (0)
[0124/145114.921:INFO:decoder_stream.cc(442)] Selected FFmpegAudioDecoder for audio decoding, config: codec: opus, profile: unknown, bytes_per_channel: 4, channel_layout: STEREO, channels: 2, samples_per_second: 48000, sample_format: Float 32-bit, bytes_per_frame: 8, seek_preroll: 80000us, codec_delay: 312, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: STEREO, target_output_sample_format: Unknown sample format, has aac extra data: false
[0124/145114.921:INFO:decoder_selector.cc(315)] Cannot select DecryptingVideoDecoder for video decoding
[0124/145114.921:INFO:decoder_selector.cc(315)] Cannot select D3D11VideoDecoder for video decoding
[0124/145114.921:INFO:decoder_selector.cc(315)] Cannot select VpxVideoDecoder for video decoding
[0124/145114.924:INFO:decoder_stream.cc(442)] Selected Dav1dVideoDecoder for video decoding, config: codec: av1, profile: av1 profile main, level: not available, alpha_mode: is_opaque, coded size: [854,480], visible rect: [0,0,854,480], natural size: [854,480], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
[0124/145114.930:INFO:web_media_player_impl.cc(1071)] Effective playback rate changed from 0 to 1
[0124/145123.168:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=ex3C1-5Dhb8 (0)
[0124/145124.308:INFO:decoder_stream.cc(851)] video decoder config changed midstream, new config: codec: av1, profile: av1 profile main, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
[0124/145124.313:INFO:decoder_stream.cc(442)] Selected Dav1dVideoDecoder for video decoding, config: codec: av1, profile: av1 profile main, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
[0124/145129.686:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=ex3C1-5Dhb8 (0)
Without multi-threaded message loop (crashes browser):
- Code: Select all
[0124/145922.236:INFO:web_media_player_impl.cc(1071)] Effective playback rate changed from 0 to 1
[0124/145922.267:INFO:ffmpeg_demuxer.cc(214)] Warning, FFmpegDemuxer failed to create a valid/supported audio decoder configuration from muxed stream, config:codec: aac, profile: unknown, bytes_per_channel: 0, channel_layout: MONO, channels: 1, samples_per_second: 44100, sample_format: Unknown sample format, bytes_per_frame: 0, seek_preroll: 0us, codec_delay: 0, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: NONE, target_output_sample_format: Unknown sample format, has aac extra data: false
[0124/145922.267:INFO:ffmpeg_demuxer.cc(1365)] FFmpegDemuxer: skipping invalid or unsupported audio track
[0124/145922.267:ERROR:ffmpeg_demuxer.cc(1470)] FFmpegDemuxer: no supported streams
[0124/145922.267:INFO:ffmpeg_demuxer.cc(214)] Warning, FFmpegDemuxer failed to create a valid/supported audio decoder configuration from muxed stream, config:codec: aac, profile: unknown, bytes_per_channel: 0, channel_layout: MONO, channels: 1, samples_per_second: 44100, sample_format: Unknown sample format, bytes_per_frame: 0, seek_preroll: 0us, codec_delay: 0, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: NONE, target_output_sample_format: Unknown sample format, has aac extra data: false
[0124/145922.268:INFO:ffmpeg_demuxer.cc(1365)] FFmpegDemuxer: skipping invalid or unsupported audio track
[0124/145922.268:ERROR:ffmpeg_demuxer.cc(1470)] FFmpegDemuxer: no supported streams
[0124/145922.268:INFO:ffmpeg_demuxer.cc(214)] Warning, FFmpegDemuxer failed to create a valid/supported audio decoder configuration from muxed stream, config:codec: aac, profile: unknown, bytes_per_channel: 0, channel_layout: MONO, channels: 1, samples_per_second: 44100, sample_format: Unknown sample format, bytes_per_frame: 0, seek_preroll: 0us, codec_delay: 0, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: NONE, target_output_sample_format: Unknown sample format, has aac extra data: false
[0124/145922.268:INFO:ffmpeg_demuxer.cc(1365)] FFmpegDemuxer: skipping invalid or unsupported audio track
[0124/145922.268:ERROR:ffmpeg_demuxer.cc(1470)] FFmpegDemuxer: no supported streams
[0124/145922.269:INFO:ffmpeg_demuxer.cc(214)] Warning, FFmpegDemuxer failed to create a valid/supported audio decoder configuration from muxed stream, config:codec: aac, profile: unknown, bytes_per_channel: 0, channel_layout: MONO, channels: 1, samples_per_second: 44100, sample_format: Unknown sample format, bytes_per_frame: 0, seek_preroll: 0us, codec_delay: 0, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: NONE, target_output_sample_format: Unknown sample format, has aac extra data: false
[0124/145922.269:INFO:ffmpeg_demuxer.cc(1365)] FFmpegDemuxer: skipping invalid or unsupported audio track
[0124/145922.269:ERROR:ffmpeg_demuxer.cc(1470)] FFmpegDemuxer: no supported streams
[0124/145922.286:INFO:decoder_stream.cc(442)] Selected FFmpegAudioDecoder for audio decoding, config: codec: opus, profile: unknown, bytes_per_channel: 4, channel_layout: STEREO, channels: 2, samples_per_second: 48000, sample_format: Float 32-bit, bytes_per_frame: 8, seek_preroll: 80000us, codec_delay: 312, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: STEREO, target_output_sample_format: Unknown sample format, has aac extra data: false
[0124/145922.286:INFO:decoder_selector.cc(315)] Cannot select DecryptingVideoDecoder for video decoding
[0124/145922.288:ERROR:html_media_element.cc(4867)] SetError: {code=4, message="DEMUXER_ERROR_NO_SUPPORTED_STREAMS: FFmpegDemuxer: no supported streams"}
[0124/145922.289:ERROR:html_media_element.cc(4867)] SetError: {code=4, message="DEMUXER_ERROR_NO_SUPPORTED_STREAMS: FFmpegDemuxer: no supported streams"}
[0124/145922.289:ERROR:html_media_element.cc(4867)] SetError: {code=4, message="DEMUXER_ERROR_NO_SUPPORTED_STREAMS: FFmpegDemuxer: no supported streams"}
[0124/145922.289:ERROR:html_media_element.cc(4867)] SetError: {code=4, message="DEMUXER_ERROR_NO_SUPPORTED_STREAMS: FFmpegDemuxer: no supported streams"}
[0124/145922.297:INFO:d3d11_decoder_configurator.cc(130)] D3D11VideoDecoder is using vp9 profile0 / 4:2:0
[0124/145922.297:INFO:d3d11_texture_selector.cc(93)] D3D11VideoDecoder producing NV12
[0124/145922.297:INFO:d3d11_texture_selector.cc(102)] D3D11VideoDecoder: Selected NV12
[0124/145922.297:INFO:d3d11_texture_selector.cc(170)] D3D11VideoDecoder output color space: (same as input)
[0124/145922.297:INFO:d3d11_texture_selector.cc(182)] D3D11VideoDecoder is binding textures
[0124/145922.299:INFO:d3d11_video_decoder.cc(307)] D3D11VideoDecoder is using single textures
[0124/145922.308:INFO:d3d11_video_decoder.cc(1069)] Selected D3D11VideoDecoder adapter LUID:{0, 51718}
[0124/145922.308:INFO:d3d11_video_decoder.cc(433)] Video is supported by D3D11VideoDecoder
[0124/145922.309:INFO:decoder_stream.cc(442)] Selected D3D11VideoDecoder for video decoding, config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [854,480], visible rect: [0,0,854,480], natural size: [854,480], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
[0124/145922.312:INFO:d3d11_video_decoder.cc(657)] D3D11VideoDecoder config change: profile: vp9 profile0, chroma_sampling_format: 4:2:0, coded_size: 854x480, bit_depth: 8, color_space: {primary=1, transfer=1, matrix=1, range=1}
[0124/145922.313:INFO:d3d11_decoder_configurator.cc(130)] D3D11VideoDecoder is using vp9 profile0 / 4:2:0
[0124/145922.313:INFO:d3d11_texture_selector.cc(93)] D3D11VideoDecoder producing NV12
[0124/145922.313:INFO:d3d11_texture_selector.cc(102)] D3D11VideoDecoder: Selected NV12
[0124/145922.313:INFO:d3d11_texture_selector.cc(170)] D3D11VideoDecoder output color space: (same as input)
[0124/145922.313:INFO:d3d11_texture_selector.cc(182)] D3D11VideoDecoder is binding textures
[0124/145922.315:INFO:d3d11_video_decoder.cc(307)] D3D11VideoDecoder is using single textures
[0124/145936.973:INFO:decoder_stream.cc(851)] video decoder config changed midstream, new config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
[0124/145936.974:INFO:d3d11_decoder_configurator.cc(130)] D3D11VideoDecoder is using vp9 profile0 / 4:2:0
[0124/145936.974:INFO:d3d11_texture_selector.cc(93)] D3D11VideoDecoder producing NV12
[0124/145936.975:INFO:d3d11_texture_selector.cc(102)] D3D11VideoDecoder: Selected NV12
[0124/145936.975:INFO:d3d11_texture_selector.cc(170)] D3D11VideoDecoder output color space: (same as input)
[0124/145936.975:INFO:d3d11_texture_selector.cc(182)] D3D11VideoDecoder is binding textures
[0124/145936.977:INFO:d3d11_video_decoder.cc(307)] D3D11VideoDecoder is using single textures
[0124/145936.986:INFO:d3d11_video_decoder.cc(1069)] Selected D3D11VideoDecoder adapter LUID:{0, 51718}
[0124/145936.986:INFO:d3d11_video_decoder.cc(433)] Video is supported by D3D11VideoDecoder
[0124/145936.986:INFO:decoder_stream.cc(442)] Selected D3D11VideoDecoder for video decoding, config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
[0124/145937.006:INFO:d3d11_video_decoder.cc(657)] D3D11VideoDecoder config change: profile: vp9 profile0, chroma_sampling_format: 4:2:0, coded_size: 1280x720, bit_depth: 8, color_space: {primary=1, transfer=1, matrix=1, range=1}
[0124/145937.007:INFO:d3d11_decoder_configurator.cc(130)] D3D11VideoDecoder is using vp9 profile0 / 4:2:0
[0124/145937.007:INFO:d3d11_texture_selector.cc(93)] D3D11VideoDecoder producing NV12
[0124/145937.007:INFO:d3d11_texture_selector.cc(102)] D3D11VideoDecoder: Selected NV12
[0124/145937.007:INFO:d3d11_texture_selector.cc(170)] D3D11VideoDecoder output color space: (same as input)
[0124/145937.007:INFO:d3d11_texture_selector.cc(182)] D3D11VideoDecoder is binding textures
[0124/145937.008:INFO:d3d11_video_decoder.cc(307)] D3D11VideoDecoder is using single textures
[0124/145959.966:FATAL:context.cc(345)] Check failed: false. context not valid