ammen99 / wf-recorder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default h264 videos do not play anymore in Firefox

apiraino opened this issue · comments

When recording with wf-recorder -f out.mp4 (leaving all defaults), the generated file does not play anymore in Firefox (tested with Firefox v102 and v99) and pipewire 0.3.52. With wf-recorder v0.2.1 it worked.

I can't reproduce the issue on Chromium v103 on another machine though, so I guess it's a Firefox issue? I've diffed the code changes for 0.2.1..0.3.0 but didn't immediately identify the reason.

By diffing the output of ffmpeg -i on two test files I see this (not sure if relevant):

# (v0.2.1) wf-recorder -f out.mp4
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 786x220, 122 kb/s, 60.09 fps, 60 tbr, 90k tbn, 120 tbc (default)

# (0.3.0) wf-recorder -f out.mp4
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuvj444p(pc), 2560x1440 [SAR 1:1 DAR 16:9], 6135 kb/s, 6.05 fps, 90k tbr, 90k tbn, 2000k tbc (default)

I'm fine with handtuning wf-recorder to restore the previous behaviour if I knew which knob to use. Any suggestion?

thanks

Does wf-recorder -t -f out.mp4 help?

fantastic, It works! :)

Now, just out of curiosity, can you also detail why? Why is the profile High 4:4:4 Predictive problematic or is that an issue of Firefox? What's the actual effect of "[...] convert the data in software, before sending it to the GPU" (as per the man page)?

By inspecting the two files metadata with mediainfo I only see this perhaps relevant difference:

# Baseline
< Color space                              : YUV
< Chroma subsampling                       : 4:2:0

# Hi444pp
> Chroma subsampling                       : 4:4:4

And by looking at the h264 profiles wikipedia page I can infer that the "Constrained Baseline" is a kind of a common denominator, the "High 4:4:4 Predictive" must have something that not all browsers support. Makes sense?

fantastic, It works! :)

Glad to hear it.

Now, just out of curiosity, can you also detail why? Why is the profile High 4:4:4 Predictive problematic or is that an issue of Firefox? What's the actual effect of "[...] convert the data in software, before sending it to the GPU" (as per the man page)?

By inspecting the two files metadata with mediainfo I only see this perhaps relevant difference:

# Baseline
< Color space                              : YUV
< Chroma subsampling                       : 4:2:0

# Hi444pp
> Chroma subsampling                       : 4:4:4

And by looking at the h264 profiles wikipedia page I can infer that the "Constrained Baseline" is a kind of a common denominator, the "High 4:4:4 Predictive" must have something that not all browsers support. Makes sense?

All I can suggest is maybe this because the video plays fine with mpv here, so it must be a firefox issue.

so it must be a firefox issue.

Ok, so despite what Firefox declares, the YUV 444 chroma subsampling is not supported anymore, and on Linux it was removed to be consistent with Windows 😅