![](/img/trans.png)
[英]What is the fastest way to create HTML table with data from JavaScript array?
[英]Fastest way to create a video from image array
從圖像陣列創建 1 秒視頻的最快方法是什么:
var frames = []
function capture(time) {
canvas.getContext('2d').drawImage(player, 0, 0, 640, 480);
preview.getContext('2d').drawImage(canvas, 0, 0, 640, 480);
var imgString = canvas.toDataURL('image/webp', 1);
frames.push(imgString);
requestAnimationFrame(capture)
}
requestAnimationFrame(capture)
上面的代碼不斷地“捕獲”來自實時 stream player
的圖像。 為這種連續圖像捕獲連續創建視頻塊的最快方法是什么?
假設您只想制作視頻,而不是專門在 javascript 代碼中執行此操作,則將使用 ffmpeg。
請參閱: 如何使用 FFmpeg 從圖像創建視頻?
請注意,仔細閱讀后,這可能不適用於連續的 output,我認為您表示想要。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.