Daniel
Daniel

Reputation: 2592

Invalid video decoder config in MediaSource

I'm using MSE to play fragmented MP4 streams (H264 video) in browser(s).

The concept is working, there is a MediaSource and SourceBuffer, and I'm pushing data to SourceBuffer, and MediaSource is being displayed on the HTML page correctly.

However I've now found a stream which my configuration simply can't play.

I'd like to emphasize, that my MSE configuration is good and working for most of the streams - for all the streams I've tried until now. So I'd just skip the details of implementation for sake of simplicity.

There is an error message with a lot of details:

CHUNK_DEMUXER_ERROR_APPEND_FAILED: Invalid video decoder config: codec: h264, profile: h264 baseline, level: not available, alpha_mode: is_opaque, coded size: [0,0], visible rect: [0,0,0,0], natural size: [0,0], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}

It seems the video itself doesn't have the correct size information.

So the obvious question: (How) is it possible to configure the MediaSource's video decoder to update the stream's size (width and height) parameters?

Upvotes: 0

Views: 410

Answers (1)

jmsn
jmsn

Reputation: 1080

This looks like a problem with the video bitstream of that particular piece of content. More specifically, in the decoder initialization config which usually is contained in special NAL units (SPS and PPS) of the initialization segment(s).

You probably won't be able to work around that. If you were to fix it you'd most likely have to re-write those NAL units in the bitstream which is not typically something to do on the client side. It's a content authoring issue.

Also, you might want to cross-validate with https://conformance.dashif.org/ or the dash.js reference player.

Upvotes: 0

Related Questions