-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canvas Rendering creates black background when frames are white #41
Comments
From your description, it sounds like your canvas actually has a transparent background, which ffmpeg replaces with a black background by default. If you add a white background for you canvas (painting a white rectangle over everything before anything else), that should give you a white background on your video. There are also ways of adding a background color in ffmpeg, but I'm not too familiar with how to do that. |
Thanks @tungs, I used CSS to set the background of the canvas to white. I am also setting the background to white using a function provided by the library I am using (matter.js). Will the background of screenshots still be white if the canvas is actually transparent? |
Hi @baljeetrathi, CSS rules don't affect canvas data, which is what timesnap/timecut uses when in canvas capture mode. I took a quick look at matter.js and it looks like it also uses CSS to set the background color. I think you have a few options off the top of my head:
|
Thanks @tungs 👍 I was previously using the following code to change the color to white:
This did not change anything so I used the method specified by you. That also does not work as expected and only creates white background where the objects travel and not the whole canvas. I will create an issue on Matter.js to ask them what's going on. |
I am recording an animation rendered on the canvas using Timecut. The screenshots (frames or temporary images) of the canvas show a white background but when the animation is combined to form the video, the backgorund turns black. How can I keep the background white in the video as well.
Here is the command that I run from the terminal:
Thanks.
The text was updated successfully, but these errors were encountered: