Vinlic / WebVideoCreator

🌈 A framework for rendering web animations into videos. It's implemented based on Node.js + Puppeteer + Chrome + FFmpeg, utilizing the latest browser APIs.
Apache License 2.0
137 stars 33 forks source link

startTime = Video - startTime #22

Open WebsheetPlugin opened 9 months ago

WebsheetPlugin commented 9 months ago

https://github.com/Vinlic/WebVideoCreator/assets/84451738/298e3ecb-fe89-4b2f-a582-216500504145

First of all - Amazing work with Plugin and Happy Lunar Year to You!

Overall, the plugin works well for all your methods except when trying to use another startTime than 0 combined with a Video element with mp4.

Added like this: <video playsinline="" autoplay="" loop="" type="video/mp4" src="https://ucarecdn.com/fcf8d557-b204-4bc0-82ef-dd0c69061c0c/anime-roman-senator.mp4" class="bl-videoelem" preload="auto"></video>

I noticed a weird behavior, which probably suggests some logical issue. But first, let me explain the issue. When I produce a Video with createSingleVideo, and I set startTime=14s, then the Video stops showing for the last 14s. Which you can see in the attached Video. (The BG Video disappears).

But when I set startTime=3s, then the Video stops showing for the last 3s.

The wanted behavior should be that the produced Video displays from startTime to startTime + duration, while the underlying Video is being played accordingly, and does not stop startTime before end time.

I noticed the same behavior for your other two main methods: multiVideo and chunkVideo I tried to debug your code, but I am kinda lost, I understand that you are using _targetFrameCount and _frameCount, but I can't find where(if) you handle the Video Capturing.

WebsheetPlugin commented 9 months ago

I was able to make it work for my case by setting a high Value for endTime manualy. Please see the image to see what I refer to.

image