nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.27k stars 3.88k forks source link

v0.50.0 Chrome87 and VideoDecoder doesn't work in NWJS while working fine in the browser (chrome87) #7624

Open tlecoz opened 3 years ago

tlecoz commented 3 years ago

======== TEMPLATE BUG FORM ========

NWJS Version : 0.50.0 Operating System : windows 10 64 bit

Expected behavior

My demo should works in nwjs the same way it works in the browser

The code of the demo was written by an engineer from Google. You can find the original code here : https://tguilbert-google.github.io/webcodecs/mp4/index.html

The weird thing is that the particular video used in this page works as expected everywhere (in the browser AND in nwjs), but if you try to use another video, it only works in the browser, not in nwjs

Actual behavior

The video chunk are produced by mp4Box and sent to VideoDecoder but VideoDecoder doesn't sent any VideoFrame object, then nothing appears on the screen.

As said previously, the demo works correctly in nwjs if I use this video file used in the demo made by the guy from Google https://tguilbert-google.github.io/webcodecs/mp4/bbb.mp4

How to reproduce

Try to launch the demo in nwjs It will works with this video : https://tguilbert-google.github.io/webcodecs/mp4/bbb.mp4

It will NOT work with this video : http://beginfill.com/out2.mp4

The problem must come from NWJS because every videos works in the browser (with chrome87)

demo.zip

tlecoz commented 3 years ago

I made a video to show you the problem http://beginfill.com/nwjsBug.mp4

rogerwang commented 3 years ago

https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/

tlecoz commented 3 years ago

Thank you for your message, I will try to rebuild nwjs , but why this video works as expected ? https://tguilbert-google.github.io/webcodecs/mp4/bbb.mp4

It's also a H264 video

tlecoz commented 3 years ago

Excuse me to insist but I'm not using FFMPEG in this demo. VideoDecoder is a part of the WebCodecs API

https://github.com/WICG/web-codecs/blob/master/explainer.md

tlecoz commented 3 years ago

I'm sorry to insist (bis) but I read on your page https://nwjs.readthedocs.io/en/latest/For%20Developers/Building%20NW.js/

"Due to the license issue, the prebuilt binaries of NW.js doesn’t support proprietary codecs, like H.264. So you can’t play MP3/MP4 with

But it's not true. I'm building a video-editing-tool with nwjs for months now and I never had any problem with mp3 and mp4 while the whole tool is based on it.

Also, you can see that it works well on this minimalist example :

<html>
<body>
<script>
var video = document.createElement("video");
video.crossOrigin = "anonymous";
video.autoplay = true;
video.src = "https://storage.uk.cloud.ovh.net/v1/AUTH_0e253297897a441d92d9c988a983bf75/klon1/o343528103_9915752.mp4";
document.body.appendChild(video);
</script>
</body>
</html>

So I doubt that the problem come from a H264 limitations

tlecoz commented 3 years ago

I want to precise something important concerning VideoDecoder in NWJS and in chrome.

Last week, chrome87 didn't exist and I used to work with nwjs 0.49 , chrome86 and chrome canary.

At this time, I was forced to re-encode my mp4 with ffmpeg in order to be able to use them with VideoDecoder for chrome86 and nwjs 0.49, and it worked.

2 days ago, chrome 87 (browser) have been released and its now possible to use VideoDecoder with every videos with no need to reencode them with ffmpeg before to use it.

The same day, the last version of nwjs 0.50 has been released including chrome 87 but in this version the demo doesn't work with every mp4 as explained previously.

BUT if you try to launch the demo with NWJS 0.49.2 and this file, it will work fine. http://beginfill.com/out2_.mp4

(it's the video re-encoded by ffmpeg in order to be readable with VideoDecoder in chrome86),

tlecoz commented 3 years ago

Hello

I'm not sure if you changed something in particular but in the nightly build of the version 0.50.1 published today, I'm now able to read this file correctly http://beginfill.com/out2_.mp4

And the video given in the demo from google : https://tguilbert-google.github.io/webcodecs/mp4/bbb.mp4

But not others mp4, it's really weird...

You can find some mp4s unreadable by VideoDecoder with NWJS here : http://beginfill.com/nwjsVideoBug/

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.