scenejs-render icon indicating copy to clipboard operation
scenejs-render copied to clipboard

Render with a transparent background?

Open mirkobunse opened this issue 3 years ago • 5 comments

I want to render a video with a transparent background, to use it as an overlay on another video.

I have tried setting all backgrounds of the scene to a transparent color (the last two digits 00 specifying the opacity).

* {
    background: #12345600;
}

scenejs-render produces a white background in the video output, like my Firefox does when I open the scene as a web page. No transparency is shown. The white backgrounds are already present in the .scene_cache/, so ffmpeg is not (yet?) causing the issue.

Is there a solution already or would transparency be a new feature? In any case, thanks for making scenejs and scenejs-render such a beautiful product, already!

mirkobunse avatar Jul 22 '21 11:07 mirkobunse

@mirkobunse I'm sorry. transparent is not processed yet.

I'm also thinking about this part.

daybrush avatar Sep 10 '21 11:09 daybrush

Is there any idea how to embed a video in scene.js?

ironyee avatar Apr 05 '22 19:04 ironyee

upvote for this feature :)

slucha avatar Nov 03 '22 09:11 slucha

@ironyee Video and audio features are already supported by this awesome library. Here is how to do it

const mediaScene = new MediaScene();
    mediaScene
        .addMedia("background", "./background.mp3")
        .seek(0, 40.79);
    
    mediaScene
        .addMedia("video", "./video.mp4")
        .seek(0, 40.79)
        .setVolume(1)
        .setPlaySpeed(1)
        .setDelay(startTime);

    scene.setItem("video",mediaScene);

usmanpakistan avatar Jun 17 '23 18:06 usmanpakistan

That's amazing, thanks! Indeed, your solution will solve the problem I had. :)

A transparent background, though, would allow users to overlay scenejs clips in other software, like video editors. Therefore, I suggest to keep this issue open.

mirkobunse avatar Jun 18 '23 07:06 mirkobunse