pankod / canvas2video

canvas2video is a backend solution for creating and rendering dynamic videos.
https://pankod.com
GNU General Public License v3.0
282 stars 38 forks source link

dynamically change canvas size for render? #15

Closed munge closed 4 years ago

munge commented 4 years ago

when trying to pass width and height dynamically, says rendering stops in runtime with conversion failed status: 'error Error: ffmpeg exited with code 1: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed!'

here is my code: ..... const VideoEncoder = async (res, canvasJSON, cWidth, cHeight) => {

try {
    const stream = await renderer({
        silent: false,
        width: cWidth,
        height: cHeight,
        fps: 30,
        makeScene: (fabric, canvas, anim, compose) => {

......

when width and height is number, not variable works fine

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.72. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

aliemir commented 4 years ago

I tried to reproduce your issue but I couldn't. Can you please check your code to make sure width and height variables are non-zero numbers? If so, please provide a code or a repository with minimal reproduction.

munge commented 4 years ago

as i understand canvas2video renders canvas size next proportion sizes 1:1, 4:3, 16:9 and etc...