canvas
canvas copied to clipboard
What is the pixel format?
I'm using raw canvas data as frames for ffmpeg, and I need to provide the pixel format. I'm assuming it's rgba
, but I would like to be sure.
I'm seeing a slight color shift when encoding into YUV420p format, but that might be due to the color space changes, though I would like to rule out my incorrect assumption about what format the canvas is in.
It should be rgba
unless you specify the colorSpace
attribute in getContext('2d')
: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#colorspace