kweb3 projeckktor raspberry pi memory leak - raspberry-pi

I am using Kweb3 in kiosk mode with projekktor on raspberry pi to play html5 mp4 video files. The time I play 5-6 files, it keeps on increasing virtual memory & hence the time it reaches 500mb, browser start showing loader & nothing happens (basically goes out of memory/memory leak is happening). How can this memory issue be fixed? it is not removing the older video from memory. I also tried the iframe way of doing it. no luck. Please help.

I note your question was asked a long time but there is a solution to this.
We had the same problem and the solution is to:
Play the video in an iframe within your application
When the video has finished, remove the iframe from the DOM
This effectively creates a fresh page and then destroys that page once it is removed. This causes it to be freed up from memory.
We were able to play 12 videos consecutively (in a single page app) after finally finding this fix.

Related

Web Audio API Maximum Number of Sources?

I'm designing a web app with Electron to play back pipe organ sample files. Whenever concurrent note polyphony nears ~1024, the sound completely drops out, including subsequent reverb nodes. After the sounds would theoretically stop playing in the background (because I have released the key), the audio eventually comes back in.
Is this a hard limit on the Web Audio API? I also notice high CPU usage for that tab when it seems to be jammed. Is there a way to enable more concurrent audio sources? Ideally, I need to have tens of thousands for proper polyphony (although many of them are the same audio files being repeated)
I'm currently looping the samples with Tone.js, if that makes a difference.
Since you mentioned that you're building an Electron app I think it should be possible to run the same code in Chrome as well. Which means you could also profile it like any other code running in Chrome.
Here is the official guide from the Chrome team on profiling: Profiling Web Audio apps in Chrome.
Doing that hopefully allows you to spot any bottlenecks or performance problems in your app.

Force GPU usage with copying video sample buffers via AVAssetReader/AVSampleBufferDisplayLayer

I am looping 1 second mp4/h264 videos with no audio on an M1 Mac Mini. AVPlayer was causing hitches with scrolling.
Now I read videos using AVAssetReader and feed those CMSampleBuffers into a AVSampleBufferDisplayLayer.
To get it to seamlessly loop without having to create a new AVAssetReader, I just cache all of those samples in an array and create copies with new timing via CMSampleBufferCreateCopyWithNewTiming. These are short videos so it's not a lot of data.
It all works pretty great now with no hitches. However the VTDecoderXPCService is going nuts on the CPU. I was expecting the GPU to be doing most of the work for decoding.
Is copying those samples from memory via CMSampleBufferCreateCopyWithNewTiming causing it? Is there a better way?

Mp4 video not working on iPad *in Offline Mode*

I'm getting a weird problem when embedding an mp4 onto a webpage in iOS Safari. I am embedding it with a video tag:
<video src='gizmo.mp4' width=560 height=320></video>
However, on the page, I'm getting the 'video not available' placeholder graphic (play button with a slash through it)
However, when I go to the direct video on my server (http://www.example.com/gizmo.mp4), the video works perfectly.
I am using the video from here to test this out, I don't have the final video files yet. I have also replaced the gizmo.mp4 file with a gizmo.m4v file that Quicktime generated when I hit "Export for Web." I get the same result.
I am only interested in targeting iOS, so specific solutions for iPhone/iPad are welcome (even if they wouldn't work in the web at large)
Thanks in advance!
-Esa
EDIT: Did a bit more testing. Since this is an offline app that I am working on, I was completely offline for this, relying on the manifest. However, the videos worked once I took the manifest out and was working completely online again. So it looks like something up with iOS not caching video resources? The video in question is 748kB, so it's not a cache size issue (though, when I tries with a 13MB movie online, Safari automatically asked to cache the content)
Videos are regarded by the browser as a streaming resource and are not cached - even when referenced directly in the .appcache manifest file. I think the only way you could get this to work is to package the HTML 5 application up as a native app, using one of the many available tools for this (https://trigger.io, Accelerator etc).

Flash movies are played like in slow motion

All flash movies are played like in slow motion... I reinstalled windows but this happens again.. how I can fix this problem?
The problem is most likely your Flash version. The same thing has been happening with me since I upgraded it, so try an earlier version. Of course, the best way to fix the problem is to stop everyone from distributing video content in Flash. It is not a video player, never has been, and never will be. It can consume at least 5x the resources of a good video player, so if you have an older computer like I do, it sometimes makes websites SO SLOW.

JW Player with Cloudfront on iOS not working

I'm having an issue using JW Player 5.4 with Amazon Cloudfront. I am using the JW Player Javascript Embed method to fall back to an HTML5 player on iOS. This is working great, except sometimes the videos don't load properly from Cloudfront. The player appears with a disabled play button.
The strange thing is that this seems to happen sporadically. We are almost getting a 50/50 chance now. I've set up a page where I have two players loading the exact same video file. The top is loading from the local server, while the bottom from Cloudfront.
http://dj.jomrx.com/video/
If you view this page on an iPhone (4 in my tests), the top player always works correctly. However the bottom has the issue described above. If you refresh a bunch of times you'll (hopefully) see what I am experiencing.
Someone suggested that the loading of the video metadata is timing out. However I thought Cloudfront was supposed to be fast as a CDN and wouldn't expect a timeout / latency issue. Any other ideas on what might be causing the issue? I've searched and searched but haven't found any good results yet.
Thanks a bunch!
More info (JW Player support topic): http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/17781/video-on-iphone-issue-flash-player-with-html5-fallback/
Update: Looks like this might not be an issue with JW Player. Same issue with hard-coded HTML5 video tags. http://dj.jomrx.com/video/index2.php
Update 2: After some help from AWS Premium Support, it looks like the issue was HTTPS. I don't know many of the technical details and I'm not sure why, but apparently AWS says that Mobile Safari is "sometimes" rejecting the SSL certificated served by Cloudfront. We switched to just regular HTTP and everything is fine now.