1

I'm working on an Electronjs app that needs to play very large videos stored in the user's machine. I've tried both with the vanilla html5 video tag and with other players. Small videos load and play fine, but large ones (1GB and up) only play sound, not images.

<video controls width="1280" height="720">
  <source src="F:\sample.MP4" type="video/mp4" />

  Sorry, your browser doesn't support embedded videos.
</video>

This happens both within the Electron app (Chromium based) and Chrome itself. Edge, on the other hand, plays large videos correctly.

I could not find any documentation on why this could happen, or if Chrome is behind in some video compatibilies...

Where could I look for a solution?

Thanks

Edit: The problem was not the size of the videos, but their codec, h264 played well, hevc (h265) didn't

Kajuna
  • 449
  • 5
  • 20
  • I think the fact that you're getting audio means that the header structure was found. But just to be sure, can you run https://github.com/danielgtaylor/qtfaststart on the file? – snwflk Nov 21 '19 at 20:58
  • @snwflk I did and got an output file that plays expremely choppy and with weird artifacts. Not sure what that means – Kajuna Nov 22 '19 at 00:21
  • So this choppy playback is inside Chrome? Or is it choppy in other players? Qtfaststart only tries to move the header (i.e. index structure) up to the beginning of the file, so that the players know where all the tracks & frames are without scanning until the end of the file. What video codec is the file? – snwflk Nov 22 '19 at 01:20
  • Does Electron store the whole video in memory? Maybe not enough ram to store large video but sound is okay since usually smaller. Also test if `.ts` files work (via some m3u8 playback) because maybe the large video needs chopping into segments. – VC.One Nov 22 '19 at 04:24
  • @snwflk, the choppy playback is on VLC. Chrome still does not play images after the file has gone through gtfaststart – Kajuna Nov 22 '19 at 17:41
  • @VC.One Not sure, will try to find out. Electron is Chromium-based and the problem is present in Chrome too, so if I solve this for Chrome it will be fine on Electron, I guess. – Kajuna Nov 22 '19 at 17:41
  • @snwflk also, the codec is hevc – Kajuna Nov 22 '19 at 18:01
  • 2
    Seems Chrome doesn't support that codec: https://caniuse.com/#feat=hevc – snwflk Nov 23 '19 at 01:11
  • @snwflk That's it. Thanks – Kajuna Nov 24 '19 at 08:26
  • Note that the `` tag does not need and does not use a closing slash in HTML and never has. – Rob Nov 25 '19 at 13:10

1 Answers1

0

@snwflk found the answer in the comments. It's because the hevc codec is not supported in Chrome: https://caniuse.com/#feat=hevc

Edge apparently supports it by offloading the video decoding to the hardware: H.265/HEVC web browser support

Maybe Electron can be compiled in a way that Chromium supports it? https://stackoverflow.com/a/39319614/3362074

Kajuna
  • 449
  • 5
  • 20