We have a Webdev mounted network folder serving up mp4 files to Perspective sessions using the Video Player component. Users record and upload videos and then other users watch them later.
When the user clicks a video link, the video begins loading and eventually is ready to play. It works great on a computer with Chrome with any size file, it works ok on my newer-gen Samsung phone, and larger videos (~300mb) don’t ever load on our company ipads. The smaller videos load ok but the larger ones just load and load forever.
Is there a way to begin playing once the video is partially loaded (the way youtube does with buffering)?
It would be possible (but quite a bit of effort) to do this using a Python webdev endpoint, but this is definitely something we should do better first-party.
If you don’t mind the drawbacks (e.g. inflated project size), the file webdev resource type does implement range requests, which should give you a much better experience with videos.
Consider using a segmenting tool like
ffmpeg to break your video into fragments a few seconds long with a “playlist” file as the actual URL. Modern players will grab the fragments intelligently, yielding superior performance even with pause/rewind/forwarding operations.
Are you saying we could mount a file directly through webdev to increase performance?
If so, can that be done dynamically every time a video is uploaded?
Could we unmount them as needed also?
We’re making sort of a company Youtube for training videos.
That is a really cool idea. I wish we could do it all natively in ignition vs adding external resources and scripting and the maintenance that goes along with that, but that’s a cool idea.
The file resource type can’t be created dynamically, but does return content-range headers.
So it would work ‘properly’ as far as returning the right values, but is too limited in other ways.
The only way to have both flexibility and content-range headers at present is a Python endpoint. Or to script your upload process to do what Phil mentioned.
Ignition could call out to
ffmpeg with ProcessBuilder to run the segmenting process after upload. Such a process could also load the fragments and playlist into database blobs to make it compatible with my Blob Server module.
Can you point me to a link about ProcessBuilder? I’ve never heard of it and I don’t see it in ignition help or on top forum search results.
I see the word in the Java docs, but is there any documentation more specifically about integrating it into ignition?
Ignition’s jython can use java classes pretty much just like native jython.
In a script:
from java.lang import ProcessBuilder
myProcess = ProcessBuilder().command('ffmpeg', '-i', 'inputFile', ....).start()
Hi Paul, any idea why video won't play on mobile devices with file resource? tried both IOS and Android. But when I used the source path on the mobile browser, it played automatically.
Appreciate any help!