Open mpromonet opened 12 months ago
Note that I’m not the creator of this package, but I have been playing the video using requestAnimationFrame
that will be called each time the screen refreshes. Using the current time and comparing with the time used to start the video, you can easily compute the current frame to display. Of course, syncing with sound is another question… if you know more about sound sync I’m quite curious.
Hi, Thanks. I started from webcodec sample that play at normal speed. Best Regards Michel
Which sample do you use?
Hi,
The video player sample https://github.com/w3c/webcodecs/tree/main/samples/video-decode-display. I made some experimentation in https://github.com/mpromonet/gin-tflite/blob/master/static/video.html
Best Regards, Michel.
The example you show just plays at max speed (but I guess we can easily adapt it to wait before two frames), but someone made me realize also that there is https://webcodecs-samples.netlify.app/audio-video-player/audio_video_player.html to play in real time a video with sound. I also played here to create a mini "player" that plays a video in real time here https://leo-colisson.github.io/blenderpoint-web/index_memory_efficient.html?video=https://leo-colisson.github.io/blenderpoint-web/Demo_24fps.mp4 (source code is https://github.com/leo-colisson/blenderpoint-web)
There is also this really interesting advises I got here https://github.com/w3c/webcodecs/issues/753
Hi,
Thanks for this, it seems really nice. I was wondering if there an easy way to wait for frame.duration between 2 rendering ?
Best Regards, Michel.