shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.06k stars 1.33k forks source link

No playback no errors #6626

Closed markito12 closed 3 months ago

markito12 commented 4 months ago

Have you read the FAQ and checked for duplicate open issues? Yes

If the problem is related to FairPlay, have you read the tutorial? -

What version of Shaka Player are you using? 4.8.4

Can you reproduce the issue with our latest release version? Yes

Can you reproduce the issue with the latest code from main? Didn't try

Are you using the demo app or your own custom app? My own app

If custom app, can you reproduce the issue using our demo app? No

What browser and OS are you using? Computer - Chrome 122 TV - Noblex

For embedded devices (smart TVs, etc.), what model and firmware version are you using? I think it is Opera with vewd

What are the manifest and license server URIs? So at first i was using DRM content with clearkeys and i thought that was the problem, which worked on my computer but not on the tv, but then i tried more samples.

https://media.axprod.net/TestVectors/Dash/not_protected_dash_1080p_h264/manifest.mpd

Works av1.6400xx

https://dash.akamaized.net/dash264/TestCases/2b/qualcomm/1/MultiResMPEG2.mpd

Does not work av1.4d401f (The same codec the DRM streams have)

https://livesim2.dashif.org/livesim2/periods_60/continuous_1/testpic_2s/Manifest.mpd

Works av1.64001e

The interesting thing is that MediaSource.isTypeSupported('video/mp4; codecs="avc1.4d401f"') is true on the TV.

What configuration are you using? What is the output of player.getConfiguration()? Default + mux.js

What did you do? Try to play streams on my tv, then i just get a black screen with no errors.

What did you expect to happen? Get playback

What actually happened? On the logs (LOG_LEVEL=6), they look the same as playing it on my computer but it behaves as if i would have paused the stream after a couple seconds (says "finished fetch and append" a few times and loops on "buffering goal met").

//Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3
//v4.8.4
{
  "manifest": {
    "application/dash+xml": true,
    "video/vnd.mpeg.dash.mpd": true,
    "application/x-mpegurl": true,
    "application/vnd.apple.mpegurl": true,
    "application/vnd.ms-sstr+xml": true,
    "application/x-offline-manifest": true
  },
  "media": {
    "video/mp4; codecs=\"avc1.42E01E\"": true,
    "video/mp4": true,
    "video/mp4; codecs=\"avc3.42E01E\"": true,
    "video/mp4; codecs=\"hev1.1.6.L93.90\"": false,
    "video/mp4; codecs=\"hvc1.1.6.L93.90\"": false,
    "video/mp4; codecs=\"hev1.2.4.L153.B0\"; eotf=\"smpte2084\"": false,
    "video/mp4; codecs=\"hvc1.2.4.L153.B0\"; eotf=\"smpte2084\"": false,
    "video/mp4; codecs=\"vp9\"": false,
    "video/mp4; codecs=\"vp09.00.10.08\"": false,
    "video/mp4; codecs=\"av01.0.01M.08\"": false,
    "video/mp4; codecs=\"dvh1.20.01\"": false,
    "audio/mp4; codecs=\"mp4a.40.2\"": true,
    "audio/mp4": true,
    "audio/mp4; codecs=\"ac-3\"": false,
    "audio/mp4; codecs=\"ec-3\"": false,
    "audio/mp4; codecs=\"ac-4\"": false,
    "audio/mp4; codecs=\"opus\"": false,
    "audio/mp4; codecs=\"flac\"": false,
    "audio/mp4; codecs=\"dtsc\"": false,
    "audio/mp4; codecs=\"dtse\"": false,
    "audio/mp4; codecs=\"dtsx\"": false,
    "video/webm; codecs=\"vp8\"": false,
    "video/webm": false,
    "video/webm; codecs=\"vp9\"": false,
    "video/webm; codecs=\"vp09.00.10.08\"": false,
    "audio/webm; codecs=\"vorbis\"": false,
    "audio/webm": false,
    "audio/webm; codecs=\"opus\"": false,
    "video/mp2t; codecs=\"avc1.42E01E\"": true,
    "video/mp2t": true,
    "video/mp2t; codecs=\"avc3.42E01E\"": true,
    "video/mp2t; codecs=\"hvc1.1.6.L93.90\"": false,
    "video/mp2t; codecs=\"mp4a.40.2\"": true,
    "video/mp2t; codecs=\"ac-3\"": false,
    "video/mp2t; codecs=\"ec-3\"": false,
    "text/vtt": true,
    "application/mp4; codecs=\"wvtt\"": true,
    "application/mp4": true,
    "application/ttml+xml": true,
    "application/mp4; codecs=\"stpp\"": true,
    "audio/aac": true,
    "audio/ac3": false,
    "audio/ec3": false,
    "audio/mpeg": true
  },
  "drm": {
    "org.w3.clearkey": {
      "persistentState": false
    },
    "com.widevine.alpha": {
      "persistentState": false
    },
    "com.microsoft.playready": null,
    "com.microsoft.playready.recommendation": null,
    "com.apple.fps.1_0": null,
    "com.apple.fps": null
  },
  "offline": true
}

MediaSource.isTypeSupported('video/mp4; codecs="avc1.4d401f"') // true
player.addEventListener('error', ...); //outputs nothing

Are you planning send a PR to fix it? -

avelad commented 4 months ago

We do not officially support this type of TV, so any PR is welcome to fix it. I'll leave the issue open to see if anyone in the community is interested in fixing this.

joeyparrish commented 4 months ago

4.8.4 ... Default + mux.js

JFYI, mux.js is not used by Shaka Player v4.8. It shouldn't hurt anything, but it's no longer helpful to include it. It has been replaced by Shaka's internal transmuxing engine.

martinstark commented 3 months ago

@markito12 Are you also catching errors on the load call? player.load().catch(console.error);

listening to error on the player instance via addEventListener will only catch errors during playback, not during initial load

markito12 commented 3 months ago

@martinstark good suggestion but i don't think that would work, because it appends new data to the sourcebuffer it just won't display the content, currentTime and duration stay at 0 and through the logs i can see it downloading new segments as it was playing normally

martinstark commented 3 months ago

@markito12 while I've not specifically experienced something like this on a TV, I have had other instances of Shaka getting stuck with enough buffer to start playing, but video stays stalled. .play() does nothing, and playback rate is a positive value.

Our workaround(s) for this have been to run an interval that checks the videoElement.buffer ranges and, if there is enough buffer, adjust videoElement.currentTime += 1 to kick it into action.

This is, of course, assuming that there's no error other than shaka refusing to kick the stream into action. You should at least be able to see if timeupdate events start ticking, even if nothing is shown on screen.

Another thing, the audio codec is different in the stream that you list as not working. Have you checked that the TV also supports the audio codec in question?

joeyparrish commented 3 months ago

We have seen so many strange behaviors on smart TVs... For example, if I remember the number correctly, on Tizen 3, if your MP4 audio segments contain timestamps greater than 2**48 milliseconds, audio stops rendering but video continues to play. 🤷 🤦

Looking at the H264 video codec strings that do and don't work, 64 is high profile, 4d is main profile. The last characters are the level, so 1e is 3.0 (0x1e == 30), and 1f is 3.1 (0x1f == 31). The middle characters are where it gets interesting. Those are "constraint set flags", which I don't know much about, but here's what I can piece together:

4d401f is main profile, level 3.1, unknown meaning of constraint flags, but these constraints are non-zero. "4240xx" is "constrained baseline profile", which MDN remarks is "primarily a solution for scenarios in which resources are constrained, or resource use needs to be controlled to minimize the odds of the media performing poorly". There is no combination of "4d40xx" listed, however, so this codec string may be bogus.

64001e is high profile, level 3.0, no constraints. So compared to the above, it's a lower level, and there are no constraints. Either of these things could be key to your platform supporting it. (It could have a max level of 3.0, or it could reject the constraint flags of CBP when put with any profile other than the base profile.)

References:

Does this help?

markito12 commented 3 months ago

Thanks for all the recomendations and awesome project :D, sadly old tvs are a headache everytime, tried a few different tvs and they all offer new issues and mine just doesnt want to play av1.4d401f/28/1e.

Incrementing currentTime triggers timeupdate but that's it and audio says supported aswell.