Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEVC support #2451

Closed
saPhil opened this issue Nov 19, 2019 · 31 comments
Closed

HEVC support #2451

saPhil opened this issue Nov 19, 2019 · 31 comments

Comments

@saPhil
Copy link

saPhil commented Nov 19, 2019

Is there any word on HEVC support coming to hls.js? Without it my project is basically dead in the water, so it would be nice to at least get some sort of feedback on whether it can happen. Looking through I see that there are issues in the project going as far back as 2016 that ask questions about HEVC support, but I can't find any official statement about it.

#619
#1097
#1470
#2209
#1728

@Vladislavik
Copy link

Waiting it too

@SalimF
Copy link

SalimF commented Nov 29, 2019

me too 👦

@robwalch
Copy link
Collaborator

robwalch commented Dec 5, 2019

Me three but we haven't gotten any contributions If you'd like support, please provide more information here like:

If this is priority for your company please dedicate resources to adding support via a PR. It's not on the roadmap for 2020 at JW Player, but that could change. If it does I'll let you know with a PR or breakdown of what needs to change in the player. I assume our mp4 remuxer assumes h264 AVC and just isn't up to snuff yet. Before we embark on this though it needs to be clear which devices or browsers will be able to playback HEVC, and whether or not the browser can even handle multi-codec manifests or not.

@mangui
Copy link
Member

mangui commented Dec 5, 2019

an old fork with PoC HEVC support
xlazom00@db6a875

@andrewaggb
Copy link

I've been looking for hevc as well. As far as I can tell the bitmovin player (paid) may be one of the only ones with support for it from a dash/hls point of view.

Here's an example
https://bitmovin.com/demos/stream-test?format=hls&manifest=https%3A%2F%2Fbitmovin-a.akamaihd.net%2Fcontent%2Fdataset%2Fmulti-codec%2Fhevc%2Fstream_fmp4.m3u8

For my project I wrote an mp4 encoder (it's in c# though based off specs and ffmpeg sources) and I transmit the video already packetized as mp4 over websockets, so it's not helpful here, other than to say practically speaking the bulk of the work is parsing the width/height/codec parameters and whatnot and creating the mp4 header. You also need a valid hev1 mimeType to initialize the media source extensions. This guy has a pretty good link which shows whether your browser supports different codes (or thinks it does).
https://cconcolato.github.io/media-mime-support/

For actual testing, I've been using the new edge with the hevc codec purchased in the windows store (it's a buck or two) and the http://chromium.woolyss.com/ browser (free) with all codecs enabled. The old version of edge with the codec from the store works as well.

I work in IP surveillance and several large vendors are now shipping a webassembly version of ffmpeg, transmitting video over websockets, and decoding to canvas using the webassembly ffmpeg. I'm tempted to try that at some point but I don't have a huge dev team like these guys do so I'm not sure if/when I'll get around to it. They are sending 4MP camera feeds that seem to playback just fine using javascript ffmpeg, so it's apparently fast enough.

@SalimF
Copy link

SalimF commented Feb 10, 2020

They are sending 4MP camera feeds that seem to playback just fine using javascript ffmpeg

Does the data transmitted as H265 codec and encoded by ffmpeg.js or it have other layer of encoding (e.g make it browser compatible )
Since ffmpeg.jsonly support H.264

@andrewaggb
Copy link

andrewaggb commented Feb 10, 2020 via email

@andrewaggb
Copy link

andrewaggb commented Feb 11, 2020

In case it's helpful for people who maybe don't understand the difference - if you don't have to use hls + mpegts and can use mpeg dash + mp4/m4s that should work with edge/safari/etc. Media source extensions native format is mp4/m4s. If you have the choice between hls and dash and just want h265 as an option, dash is easier. hls requires converting mpegts to mp4/m4s and parsing all the hevc headers in javascript (which is not a low effort project). In dash it's already in that format and presumably some other tool or library has done the conversion (eg ffmpeg).

@SalimF
Copy link

SalimF commented Feb 12, 2020

^^Hi I read article were they able to compile ffmpeg.js to support all codec required with WebAssembly , they didn't mention h265 but since ffmpeg.js works as stand alone ffmpeg binary file that will solves h265 encoding support on the browser
https://itnext.io/build-ffmpeg-webassembly-version-ffmpeg-js-part-1-preparation-ed12bf4c8fac

@robwalch
Copy link
Collaborator

We're not going to add ffmpeg to hls.js.

Here's an example
https://bitmovin.com/demos/stream-test?format=hls&manifest=https%3A%2F%2Fbitmovin-a.akamaihd.net%2Fcontent%2Fdataset%2Fmulti-codec%2Fhevc%2Fstream_fmp4.m3u8

That does not work in Chrome. Chrome does not support hevc via MSE.

It works in Safari, and you don't need hls.js in Safari to play HLS files. You can play hevc HLS steams in any video player using video.src = when the browser supports the file format and codec natively.

To contribute to the conversation please answer these questions #2451 (comment)

@robwalch
Copy link
Collaborator

robwalch commented Feb 28, 2020

I have confirmed that hls.js can play the stream mentioned above (HEVC renditions over fmp4) https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8 in Safari. So the support is there, just not over TS (haven't seen a single example), and it's not something we actively test.

Apple's reference stream https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8 still presents issues, so we can do better. is supported as of v1.0.0-beta.3.

@robwalch
Copy link
Collaborator

robwalch commented Jan 15, 2021

HEVC fmp4 is supported in hls.js in Safari as of v1.0.0-beta.3 with #3358

I have not seen any evidence that HEVC in TS is supported in Safari and thus am not planning to support it in hls.js. Test streams provided here and this one I just produced with HEVC in TS do not render video in Safari with src= or in hls.js https://playertest.longtailvideo.com/hevc-mpeg-ts/stream.m3u8

@tkp30
Copy link

tkp30 commented May 25, 2021

Emm......I see the CCTV TV Live didn't use the HLS.js and it can play the hls HEVC live source.Maybe you can refer to the CCTV code and write it yourself.

@Bec-k
Copy link

Bec-k commented Sep 8, 2021

Emm......I see the CCTV TV Live didn't use the HLS.js and it can play the hls HEVC live source.Maybe you can refer to the CCTV code and write it yourself.

Because it is using browser-side decoding. It is using WebAssembly to compile binary which decoding incoming binary blobs.

@Bec-k
Copy link

Bec-k commented Sep 8, 2021

You can check it here https://github.com/strukturag/libde265.js i have tested it and it is working.

@SalimF
Copy link

SalimF commented Sep 11, 2021

https://github.com/strukturag/libde265.js

The demo page works perfectly on my browser I can't believe this ~8 Yrs old project I never hear or able to find it, thanks a lot.

@xlazom00
Copy link

I am testing HEVC with microsoft's new EDGE and when I install HEVC support from Store, HEVC stared to work.
I am testing HEVC with MPEG DASH reference player
https://reference.dashif.org/dash.js/latest/samples/dash-if-reference-player/index.html
stream
https://media.axprod.net/TestVectors/H265/clear_cmaf_1080p_h265/manifest.mpd

@MatteoBuffo
Copy link

Hi! Has anyone here managed to integrate libde265 in hls.js for H.265 playlists playback?

@MatteoBuffo
Copy link

MatteoBuffo commented Apr 5, 2022

an old fork with PoC HEVC support xlazom00@db6a875

Hi @mangui! Is this fork expected to work? I'm loading a H.265, HLS playlist but the player is playing audio only.

@daveisfera
Copy link

This is a separate project, but I stumbled on this:
https://github.com/numberwolf/h265web.js

@MatteoBuffo
Copy link

Hi @daveisfera! Thanks for you reply. I stumbled on that project as well, but the transcoding it applies makes the video look sluggish...

@MatteoBuffo
Copy link

Do you happen to have any other suggestions about it?

@daveisfera
Copy link

I don't believe that it's transcoding anything but doing the decoding in software and that's CPU intensive, so it may not be able to keep up. From my understanding, browsers other than Safari and Edge don't expose the necessary components to decode H.265 with hardware, so this is the only available approach.

@MatteoBuffo
Copy link

Got it. Thank you anyway!

@xlazom00
Copy link

xlazom00 commented Oct 26, 2022

@tangshanghai
Copy link

@xlazom00 Hello, I tried your code( https://github.com/xlazom00/hls.js ), it may be an MP4 format problem, but the browser still reports an error

hevc-sps-parser. js -> this. skipUE is undefined

After comment code “sourceBuffer error”

@xlazom00
Copy link

xlazom00 commented Nov 2, 2022

@tangshanghai sorry I don't remember. I think I hardcoded some stuff(resolution) in the code so whole code work only for specific one file :(

@tangshanghai
Copy link

@xlazom00 oh, I'll try to see if I can modify it。thanks!

@82andre
Copy link

82andre commented Mar 6, 2023

Any update? It's not working for chrome 110 yet.
Feature: Enable HEVC hardware decoding.

@daveisfera
Copy link

I've used H.265 with HLS.js on Chrome 110 and it played back correctly. It started with 107 and the OS has to provide hardware support ( see here )

@robwalch
Copy link
Collaborator

robwalch commented Mar 6, 2023

This issue is closed. For updates on HEVC in MPEG2-TS follow:

Related CODEC and HDR issues are grouped under the 1.5.0 milestone.

@video-dev video-dev locked as resolved and limited conversation to collaborators Mar 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

No branches or pull requests