Skip to content

No Error Event Attempting to Play Unsupported Video #5011

Closed

Description

@mattzucker

What version of Hls.js are you using?

v1.2.4

What browser (including version) are you using?

Chrome Version 106.0.5249.91 (Official Build) (64-bit)

What OS (including version) are you using?

Linux CentOS 7

Test stream

https://raw.githubusercontent.com/mattzucker/hls-test-data/main/bigbuckbunny.m3u8

Configuration

{debug:true, enableWorker:true}

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Load a stream with a video format that is not supported, for example an MPEG2 video.

Expected behaviour

An error event is triggered that explains the video format is not supported.

What actually happened?

With enableWorker:true, I see the same error as reported here #4958. As suggested in that ticket, I updated to the latest version from master. Now I am seeing this error:

ERROR {details: "internalException",
error: Error: Uncaught TypeError: Getter must be a function: d (blob:http://localhost:8080/7a252a65-61f3-4214-8d7d-b5b4326dc7da:8393) at TransmuxerInterface.worker.onerror (http://localhost:8080/VAT/vendor.d7a240a89f75d44bc2e6.js:18625:20)
message: "Uncaught TypeError: Getter must be a function: d  (blob:http://localhost:8080/7a252a65-61f3-4214-8d7d-b5b4326dc7da:8393)"
stack: "Error: Uncaught TypeError: Getter must be a function: d  (blob:http://localhost:8080/7a252a65-61f3-4214-8d7d-b5b4326dc7da:8393)\n    at TransmuxerInterface.worker.onerror (http://localhost:8080/VAT/vendor.d7a240a89f75d44bc2e6.js:18625:20)"
event: "demuxerWorker"
fatal: true
type: "otherError"}

To get more information, I set enableWorker:false. Now I do not see any error, and the video fails to play.

Console output

With `{debug:true, enableWorker:false}` and using the latest from master, the output is:

[log] > Debug logs enabled for "Hls instance"
hls-dev.js:18092 [log] > stopLoad
hls-dev.js:18055 [log] > loadSource:https://localhost:8443/VAWS/current/rest/mission/93555/m3u8
hls-dev.js:9985 [log] > [stream-controller]: Trigger BUFFER_RESET
hls-dev.js:18026 [log] > attachMedia
hls-dev.js:4118 [log] > [buffer-controller]: Media source opened
hls-dev.js:4042 [log] > [subtitle-stream-controller]: STOPPED->IDLE
hls-dev.js:8506 [log] > [level-controller]: manifest loaded, 1 level(s) found, first bitrate: 0
hls-dev.js:4215 [log] > 1 bufferCodec event(s) expected
hls-dev.js:18081 [log] > startLoad(-1)
hls-dev.js:8881 [log] > [level-controller]: switching to level 0 from -1
hls-dev.js:4042 [log] > [stream-controller]: STOPPED->IDLE
hls-dev.js:4042 [log] > [subtitle-stream-controller]: IDLE->STOPPED
hls-dev.js:4042 [log] > [subtitle-stream-controller]: STOPPED->IDLE
hls-dev.js:10049 [log] > [stream-controller]: Level 0 loaded [0,29], cc [0, 29] duration:884.8639999999999
hls-dev.js:4719 [log] > [buffer-controller]: Updating Media Source duration to 884.864
hls-dev.js:3320 [log] > [stream-controller]: Loading fragment 0 cc: 0 of [0-29] level: 0, target: 0
hls-dev.js:4042 [log] > [stream-controller]: IDLE->FRAG_LOADING
hls-dev.js:15310 [log] > [transmuxer-interface, main]: Starting new transmux session for sn: 0 p: -1 level: 0 id: 1
        discontinuity: true
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 0
        initSegmentChange: true
hls-dev.js:15970 [warn] > Failed to find demuxer by probing frag, treating as mp4 passthrough
hls-dev.js:4042 [log] > [stream-controller]: FRAG_LOADING->PARSING
hls-dev.js:3085 [log] > [stream-controller]: Loaded fragment 0 of level 0
hls-dev.js:15852 [log] > [transmuxer.ts]: Flushed fragment 0 of level 0
hls-dev.js:4014 [warn] > [stream-controller]: Found no media in fragment 0 of level 0 resetting transmuxer to fallback to playlist timing
hls-dev.js:4042 [log] > [stream-controller]: PARSING->PARSED
hls-dev.js:4578 [warn] > Fragments must have at least one ElementaryStreamType set. type: main level: 0 sn: 0
hls-dev.js:4915 [log] > [buffer-controller]: Blocking operation requested, but no SourceBuffers exist
hls-dev.js:3205 [log] > [stream-controller]: Buffered main sn: 0 of level 0 
hls-dev.js:4042 [log] > [stream-controller]: PARSED->IDLE
hls-dev.js:3320 [log] > [stream-controller]: Loading fragment 1 cc: 1 of [0-29] level: 0, target: 27.868
hls-dev.js:4042 [log] > [stream-controller]: IDLE->FRAG_LOADING
hls-dev.js:15310 [log] > [transmuxer-interface, main]: Starting new transmux session for sn: 1 p: -1 level: 0 id: 1
        discontinuity: true
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 27.868000000000002
        initSegmentChange: true
hls-dev.js:15970 [warn] > Failed to find demuxer by probing frag, treating as mp4 passthrough
hls-dev.js:4042 [log] > [stream-controller]: FRAG_LOADING->PARSING
hls-dev.js:3085 [log] > [stream-controller]: Loaded fragment 1 of level 0
hls-dev.js:15852 [log] > [transmuxer.ts]: Flushed fragment 1 of level 0
hls-dev.js:4014 [warn] > [stream-controller]: Found no media in fragment 1 of level 0 resetting transmuxer to fallback to playlist timing
hls-dev.js:4042 [log] > [stream-controller]: PARSING->PARSED
hls-dev.js:4578 [warn] > Fragments must have at least one ElementaryStreamType set. type: main level: 0 sn: 1
hls-dev.js:4915 [log] > [buffer-controller]: Blocking operation requested, but no SourceBuffers exist
hls-dev.js:3205 [log] > [stream-controller]: Buffered main sn: 1 of level 0 
hls-dev.js:4042 [log] > [stream-controller]: PARSED->IDLE

Chrome media internals output

No response

Activity

  1. added
    Needs Triage
    on Nov 7, 2022
  2. mattzucker commented on Nov 7, 2022

    @mattzucker
    ContributorAuthor

    To clarify, there are 2 issues I see. The first is a bug that only occurs when enableWorker is true. The second is a request to add an error event for unsupported video formats.

    From the 3 warning logs I see, I would like if one of those could throw an error that I can respond to and gracefully tell the user that the video format is not supported. Perhaps the last one is the best place to do it?
    Fragments must have at least one ElementaryStreamType set

    Suggest changing that from warning to error and throwing an appropriately typed event.

  3. robwalch commented on Nov 9, 2022

    @robwalch
    Collaborator

    To clarify, there are 2 issues I see. The first is a bug that only occurs when enableWorker is true.

    See comments in #5015, and please direct worker related failures to that issue.

    second is a request to add an error event for unsupported video formats.

    Please provide a sample stream that reproduces the issue.

    The player supports empty segments since v1.2.0 with #4800. I agree that in this case we should produce a fatal error if there are no alternate renditions available - but only if:

    1. Both Failed to find demuxer by probing frag, treating as mp4 passthrough AND Found no media in fragment occur (probing failing is a sign that this is an unsupported container)
    2. More than 1 (how many TBD?) segments have no media (so that we continue to support the use-case Emit FRAG_PARSED when parsed fragment has no media #4800 was added for but don't let the free pass on empty results run indefinitely)
  4. added and removed
    Needs Triage
    on Nov 9, 2022
  5. mattzucker commented on Nov 10, 2022

    @mattzucker
    ContributorAuthor

    Sample stream: https://raw.githubusercontent.com/mattzucker/hls-test-data/main/bigbuckbunny.m3u8

    Thank you for the link to the other issue. I didn't see it when I looked through open bug tickets.
    The sample stream that I posted has the behavior of the warning message Fragments must have at least one ElementaryStreamType set without any additional configuration (besides debug:true).

    More than 1 (how many TBD?) segments have no media (so that we continue to support the use-case #4800 was added for but don't let the free pass on empty results run indefinitely)

    I don't expect any segments to have no media. I suppose HLS.js thinks it has no media because the format is not supported. In that case, I don't understand the reasoning behind #4800 because it seems like no media should be an error, but perhaps you could throw a non-fatal error instead?

    That would support gracefully handling segments with no media but also give an option for a convenient hook where I might want to put up a warning to tell the user something may be wrong with their video stream.

  6. robwalch commented on Nov 10, 2022

    @robwalch
    Collaborator

    I don't expect any segments to have no media. I suppose HLS.js thinks it has no media because the format is not supported.

    Failed to find demuxer by probing frag, treating as mp4 passthrough means HLS.js is treating the segment data as fragmented mp4 even though it couldn't identify it as an mp4 fragment.

    In that case, I don't understand the reasoning behind #4800 because it seems like no media should be an error,

    A user had a library of legacy streams with MPEG2-TS segments where occasionally a segment would not contain any media samples. Other popular HLS players made it across this content without failing so #4800 was implemented to do the same.

    but perhaps you could throw a non-fatal error instead?
    That would support gracefully handling segments with no media but also give an option for a convenient hook where I might want to put up a warning to tell the user something may be wrong with their video stream.

    In that case we would just emit a non-fatal FRAG_PARSING_ERROR when logging Fragments must have at least one ElementaryStreamType set.

    The difference here is that the segment type could not be identified, AND we could not find any media in it. Either case should be allowed exclusively, but when both occur a fatal error must be raised.

  7. 10 remaining items

  8. added this to the 1.4.0 milestone on Feb 18, 2023
  9. added 4 commits that reference this issue on Feb 18, 2023
    f749488
    66345fc
    2f43728
    4e62f3e
  10. robwalch commented on Feb 22, 2023

    @robwalch
    Collaborator

    Not a Contribution

    You can preview the fix here https://deploy-preview-5241--hls-js-dev.netlify.app/demo/

    The player will produce several FRAG_PARSING_ERRORs (up to fragLoadPolicy maxNumRetry) with the last one being fatal and stopping loading (this allows level switching and on the lowest level skipping of bad fragments before failing after several unsuccessful attempts).

  11. added a commit that references this issue on Feb 27, 2023
    8063580
  12. added
    Verify Fixed
    on Feb 27, 2023
  13. removed
    Verify Fixed
    on Apr 26, 2023
  14. bondipathshala commented on Jul 14, 2024

    @bondipathshala

    the issue is persist and happend with encryption and decryption

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConfirmedEnhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions