createImageBitmap creates an untranslated version of videos
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
People
(Reporter: mossop, Unassigned)
Details
(Keywords: parity-chrome)
MP4 videos can include a matrix to translate the rendered video. This is commonly used to rotate the video to portrait for a video recorded as landscape. Firefox and Chrome correctly apply this matrix when rendering in a <video> element. However using createImageBitmap to capture a frame of a video that is translated in this fashion behaves differently in Firefox and Chrome.
In Chrome you get an ImageBitmap containing the translated image and width/height, so exactly what you see in the page. Rendering it in a canvas shows the same image.
In Firefox you get an ImageBitmap containing the untranslated image and the untranslated withd/height. I.e. for a landscape image that is translated to display as portrait the generated ImageBitmap is landscape. Rendering it to a canvas shows a rotated version of the frame.
The spec for createImageBitmap doesn't cover what should happen in this case but Chrome's behaviour makes the most sense to me, I would expect capturing a frame from a playing video to give a bitmap the same shape as the video.
Reporter | ||
Comment 1•6 years ago
|
||
Looks like this also impacts ctx.drawImage(video_element) on a canvas element.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•3 years ago
|
Description
•