Using Node.js, I'm trying to create a video server which serves only a small part of a larger media file.
Following this gist I've been able to create a video server and feed that to a html5 video player using:
<video controls width="500">
<source src="http://127.0.0.1:1337/" type='video/mp4'>
</video>
However, the range request starts at 0 and potentially buffers beyond a point of interest (if say I only wanted to view under 25 seconds of video).
Ideally I'd the ability to playback from some arbitrary point for a known duration and serve only that content. I know one solution is to seek to a specific point in the video client side and stop playback after a known duration; but is it possible to serve JUST the video content required?
Is the only fool proof way of achieving this to use a tool like FFMpeg to trim a larger clip into smaller chunks?
Thanks in advance,
GW
Digging deeper into the w3c specifications, I found Media Frags.
<video id="video1" controls width="270">
<source src="http://127.0.0.1:1337/#t=9.000001,11" type='video/mp4'>
</video>
It seems strange that I found this difficult to find, but it solves my problem.