createImageBitmap cropping is not persisted in VideoFrame
Categories
(Core :: Audio/Video: Web Codecs, defect)
Tracking
()
People
(Reporter: github, Assigned: tnibler, NeedInfo)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Steps to reproduce:
I am cropping ImageBitmaps using the createImageBitmap(image, sx, sy, sw, sh) API. When I want to use the cropped Image in a VideoFrame, the videoFrame will have the dimensions of the original, uncropped image.
const originalBitmap = createTestBitmap(50, 50); // Original 50x50 Bitmap
const croppedBitmap = await createImageBitmap(originalBitmap, 0, 0, 10, 10); // Crop to 10x10
const videoFrame = new VideoFrame(croppedBitmap, { timestamp: 0 }); // expected: 10x10 Videoframe
I created a jsBin with a minimal reproduction: https://jsbin.com/daxepogere/edit?html,js,output
I tested this on Firefox Windows, Linux and Android and all share this behavior.
Chromium based browsers use the cropped dimensions in the video frame.
Actual results:
The videoFrame has the dimensions of the original Bitmap instead of the cropped dimensions.
Expected results:
The videoFrame has the dimensions of the cropped Bitmap.
Comment 1•1 year ago
|
||
Not sure if this is on the video frame side, or the create image bitmap side (graphics). Chun-Min, any thoughts?
Updated•1 year ago
|
| Assignee | ||
Comment 2•14 days ago
|
||
If required, copy the cropped image portion to a new SourceSurface to
create the frame.
Updated•14 days ago
|
Updated•8 days ago
|
Description
•