Closed Bug 1923537 Opened 1 year ago Closed 1 year ago

Fail to encode a GPUVideoImage VideoFrame on Linux

Categories

(Core :: Audio/Video: Web Codecs, defect, P1)

Desktop
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: chunmin, Assigned: chunmin)

References

(Blocks 2 open bugs)

Details

Nightly crashes when running the encode test page below.

Step-to-reproduce

  1. Go to https://chunminchang.github.io/playground/webcodecs/encode-from-video.html
  2. Click "Start Encoding"

Expected result

get the test result

Actual result

crash

Logs
[Child 82976, Main Thread] WARNING: '!surface', file /home/cm/Work/gecko-dev/dom/canvas/ImageUtils.cpp:133
[Child 82976: Main Thread]: D/WebCodecs VideoFrame 72b8d825ff50 ctor
[Child 82976: Main Thread]: W/WebCodecs Create a VideoFrame with an unrecognized image format
[Child 82976: Main Thread]: D/WebCodecs VideoFrame 72b8d825ff50, start monitoring resource release
[Child 82976: DOM Worker]: D/WebCodecs VideoFrame 72b8da09b0e0 ctor
[Child 82976: DOM Worker]: W/WebCodecs Create a VideoFrame with an unrecognized image format
...
[Child 82976, Main Thread] WARNING: '!surface', file /home/cm/Work/gecko-dev/dom/canvas/ImageUtils.cpp:133
[Child 82976: Main Thread]: D/WebCodecs VideoFrame 72b8d2ffb3a0 ctor
[Child 82976: Main Thread]: W/WebCodecs Create a VideoFrame with an unrecognized image format
[Child 82976: Main Thread]: D/WebCodecs VideoFrame 72b8d2ffb3a0, start monitoring resource release
...

It looks like the format obtained from ImageUtils is Nothing() since the GetAsSourceSurface from the given layers::Image is nullptr, then the crash happens somewhere in the pipeline.

The crash is caused by calling the PixelFormat() on mFormat whose value Nothing() in VideoFrame::ToString().

The reason why the format is Nothing() (and conversion error later in ConvertToI420) is GPUVideoImage::GetAsSourceSurface() returns nullptr, since RemoteDecoderManagerChild::Readback's SurfaceDescriptor is invalid

See Also: → 1923729

(In reply to C.M.Chang[:chunmin] from comment #1)

The crash is caused by calling the PixelFormat() on mFormat whose value Nothing() in VideoFrame::ToString().

I am going to fix this first in bug 1923729, and fix the encode failure later

Summary: Fail to encode an unknown-format VideoFrame → Fail to encode a GPUVideoImage VideoFrame on Linux
Severity: S2 → S3

I can no longer reproduce this issue, which was likely fixed by another bug.

Status: NEW → RESOLVED
Closed: 1 year ago
Flags: needinfo?(sotaro.ikeda.g)
Resolution: --- → WORKSFORME
Flags: needinfo?(sotaro.ikeda.g)
You need to log in before you can comment on or make changes to this bug.