3

Any videos of this type play fine if I open it in Chrome. I used the same HTML as Chrome in my Electron quick-start index.html:

<video id="v" controls autoplay>
     <source src="file:///D:/---/New/Replay%202018-03-27%2016-35-57.mp4" type="video/mp4">
  </video>

Here are the video's stats:

 Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.84.100
  Duration: 00:01:59.18, start: 0.000000, bitrate: 30411 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 1280x
720 [SAR 1:1 DAR 16:9], 30012 kb/s, 60 fps, 60 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:3(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 128 kb/s
    Metadata:
      handler_name    : SoundHandler

The video plays up until about 1min 19sec, then freezes and the timeline skips to the end. I can skip further on the timeline, but it can still have these freezing problems later.

Some version info:

Windows7 64bit Electron v1.8.4 Chromium v59.0.3071.115 Node v8.2.1 v8 v5.9.211.38

I'm also running the app through a .bat file if that's of any use:

C:\Users\---\node_modules\electron\dist\electron.exe C:\Users\---\Documents\GitHub\electron-quick-start
HTR
  • 31
  • 1
  • Try setting the `src` to a http:// url instead of file:// ? A lot of web tech just acts weird in Electron because of the different protocol. – ppajer Mar 29 '18 at 12:19
  • @ppajer The same thing happens unfortunately. Something that has changed, is the timeline now shows how much has buffered(?). The RAM usage of Electron starts at about 227,000K, then as it passes the "buffer" point it drops rapidly bellow 100,000K then freezes and skips to the end. [RAMusage.png](https://i.imgur.com/0MKIbpC.png) – HTR Mar 29 '18 at 12:41
  • Yeah that sounds like electron is trying to load the video until it hits a memory limit and just dumps the whole thing when it's unable to fetch further chunks - maybe [try increasing the memory limit](https://stackoverflow.com/questions/43933951/how-to-increase-the-max-memory-limit-for-the-app-built-by-electron-builder) ? I'm in the office right now so can only come up with suggestions instead of a solution :) – ppajer Mar 29 '18 at 13:05
  • 1
    @ppajer Thanks for the suggestion :). I was just looking at that when I saw your reply. I tried adding `app.commandLine.appendSwitch('js-flags', '--max-old-space-size=4096');` before `on ready` in `main.js`, and logged the RAM usage with `app.getAppMetrics()` and nothing seems to change; along with the video still freezing. (Is that the right function for RAM usage?). I even set `max-old-space` to a low value of `512` with no change. [ConsoleLog.png](https://cdn.discordapp.com/attachments/354611051578261504/428907637904637953/unknown.png) – HTR Mar 29 '18 at 13:50

0 Answers0