Description
I want to create a dummy 1x1 pixel video that plays nothing for a set durration, I thought MediaSource could be of any help, cuz you can set the duration property and be able to feed the media player with buffers and also be able to seek with it (video.currentTime = x
).
lets say i set some variable to be 01:20:15
, then I want to generate a <video>
tag that plays nothing for 1h 20m and 15s
The lack of skill I'm missing is how could i get this source buffers that i could feed into the MediaSource.
I figure you might have some ideas, cuz i don't know exactly video's are built/constructed
a other thought i had was to generate a Blob that only have one frame that's loops over and over again, with the smallest possible file size kind of like saying "this segment is 1hour long but the frames never changes so there should be no reason for the file to be larger than a few kb and doubling the duration would kind of yield the same filesize - the only thing you have actually changed is some duration or time length property in a segment" if something like that would be possible. then i could just generate a complete video and simply just use DataView
to modify the time.
then i don't even need MediaSource or mux.js, i could just use URL.createObjectURL(blob)
and play that instead
Another question i have is if it's possible to use a same fragment (buffer) over and over again with MediaSource. isn't it like some fragment indexing or currentTime that each "Box" have that makes it impossible append a particular buffer at a particular time?
another dummy video generator i found was this js source code but it didn't work out for me 😞
I would kind of like to what that guy did but possible without the MediaRecorder and the canvas element if i could
I have tried AudioContext also for a bit, but it looks to be too complicated and i can't figure out to create a AudioBuffer that could loop for a set duration and have it play in a <video>
tag, I manage to create a looping audio but i wasn't able to seek/jump and the duration was === infinity