Open Bug 1479203 Opened Last year Updated 23 days ago

Videos encoded with a 5.2+ h264 profile stay black (audio only)

Categories

(Core :: Audio/Video: Playback, defect, P3)

61 Branch
x86_64
Windows 7
defect

Tracking

()

People

(Reporter: eric.debra, Unassigned, NeedInfo)

References

()

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180704003137

Steps to reproduce:

Trying to see this video url : https://web.poecdn.com/public/news/2018-05-02/VLS_news.mp4 or also https://web.poecdn.com/public/news/2018-04-17/NewRainofArrows.mp4


Actual results:

Audio only, video stays black.


Expected results:

Audio + video.

I've opened a discussion here several months ago : https://support.mozilla.org/en-US/questions/1216054
Additional details i could see on my own, with videos that work and the ones that don't : Seems like Imgur (videos work here) uses x264 (http://www.videolan.org/x264.html) to encode their videos (ftypisom : MP4 Base Media v1 [IS0 14496-12:2003]), while GGG (poecdn) used something else (Mainconcept Video Media Handler ; ftypmp42 : MP4 v2 [ISO 14496-14]).
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0
20180704003137

Works for me.
Has STR: --- → yes
Component: Untriaged → Audio/Video: Playback
OS: Unspecified → Windows 7
Product: Firefox → Core
Hardware: Unspecified → x86_64
Troubleshooting Information (stripped of printers info)
jya, do you see anything strange here in the prefs? Is advanced layers supposed to be enabled on Windows 7?
Flags: needinfo?(jyavenard)
Can you try with a refreshed profile ?

https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings

I do not have the hardware/OS to reproduce this problem unfortunately. WFM with Windows 10
Flags: needinfo?(jyavenard) → needinfo?(eric.debra)
(In reply to Jean-Yves Avenard [:jya] from comment #4)
> Can you try with a refreshed profile ?
> 
> https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-
> settings
> 
> I do not have the hardware/OS to reproduce this problem unfortunately. WFM
> with Windows 10

Is there a way to test without losing settings (here extensions : "Extensions and extension data are removed.") ?
In the meantime, i tried on a different computer, without any change in the about:config and totally different add-ons activated, but still on win7 x64. Same issue occured.
(In reply to Eric Debra from comment #5)
> Is there a way to test without losing settings

You can start in a brand new profile. You can afterwards return to your regular profile.
https://support.mozilla.com/kb/profile-manager-create-and-remove-firefox-profiles
(In reply to Gingerbread Man from comment #6)
> (In reply to Eric Debra from comment #5)
> > Is there a way to test without losing settings
> 
> You can start in a brand new profile. You can afterwards return to your
> regular profile.
> https://support.mozilla.com/kb/profile-manager-create-and-remove-firefox-
> profiles

I did that but modified settings in about:config were still there apparently alongside add-ons. I created a "Test" profile and opened it in a new window from about:profiles. I had disabled all add-ons to test, the issue was still there. But then by disabling the add-ons i saw they were also disabled on my current profile in the other window. I then re-enabled them and removed this "Test" profile.

Is the safe mode a good way to test it also instead of refreshing a profile ?
Correction from my last comment: The profile wasn't started in a new window but in a new browser ("Lancer le profil dans un nouveau navigateur", en: Launch the profile in a new browser), cf. option in about:profiles.
(In reply to Eric Debra from comment #7)
> I did that but modified settings in about:config were still there apparently
> alongside add-ons.

Then you didn't start in a brand new profile.

> I created a "Test" profile and opened it in a new window from about:profiles.

You just opened a new window. Bug 1367743 is only fixed in Firefox 63.
Like the support article I linked to earlier directs, please use the separate profile manager, launched via firefox.exe -p

> Is the safe mode a good way to test it also instead of refreshing a profile ?

No. Safe Mode keeps all your customized preferences and disables hardware acceleration.
The videos from web.poecdn.com are not encoded optimally. They are encoded in H.264 level 5.2, which is not supported on Windows 7 with hardware acceleration, see https://docs.microsoft.com/windows/desktop/medfound/h-264-video-decoder. It should work on Windows 8.1 and later, though.

The videos could be encoded just with level 4.2 that is sufficient for 1920x1080@60fps, i.e. the params the web.poecdn.com videos are encoded with (see https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels) and would then work in Firefox on Windows 7 as well.

So essentially three possible outcomes to see the videos on Windows OS:
1. stay on Windows 7 and disable default hardware acceleration support in Firefox
2. upgrade to Windows 10 and keep default hardware acceleration support in Firefox
3. complain to content creators at web.poecdn.com and have them decrease H.264 level for their 1080p content (the fact that they use Mainconcept encoder does not play any role in this) and keep default hardware acceleration support in Firefox

Alternatively. Mozilla could try to switch to software rendering on Windows 7 and 8 for H.264 level 5.2 automatically, but not sure how feasible that is.
@Gingerbread Man (comment #9) : Oh okay, i didn't know it was not functional, i guess it explains what happened then. I just tried again with the profile manager this time but the video didn't show up too.
I also tried during this test to disable hardware accel in Firefox (cf. comment #10 by @Tomas Bucher) to see if the video would show up : not the case.
I did the same test in my default profile without success as expected (since in a fresh profile it didn't work either).

Is there something else (than turning off "use hardware accel when available" in performance settings) to do to disable properly the hardware accel to make it work under Firefox or it'll just never work in Firefox with Windows 7 ?
The only way i could see the video atm is outside of Firefox, with VLC for instance.
Flags: needinfo?(eric.debra)
@Eric Debra
Ah, yes, just disabling hardware acceleration on Windows 7 does not help, you are correct.

Unless Mozilla can work around this Windows Media Foundation limitation on Windows 7, your immediate options have been reduced to just two (which I outlined earlier and confirmed to be working). Stay on Windows 7 and discuss the level encoding issue with content creators or upgrade to Windows 10.
Sounds like this is a rare edge case of content creators using non-ideal H264 profiles causing problem on Windows 7.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Duplicate of this bug: 1565909
Duplicate of this bug: 1577976

(In reply to Nils Ohlmeier [:drno] from comment #13)

Sounds like this is a rare edge case of content creators using non-ideal
H264 profiles causing problem on Windows 7.

idk if it is that rare, i see it on twitter and reddit etc. maybe services that auto-transcode from gif to other formats.

It's not rare anymore as Twitter seems to migrate all its MP4-encoded GIFs to level 5.2 profiles instead of just leaving them at 5.1. That's why you see more and more threads on Reddit and elsewhere with no valid solution as of yet, which isn't "disable hardware acceleration" or "upgrade to Windows 10".

And again, I have to read a valid explanation to why they are transitioning to level 5.2. Nobody has been able to answer yet (their MP4 videos, on the other hand, don't have this problem, only their transcoded GIFs).

I want to chime in noting that this is not just "rare", it is basically half of the animated content I see on Twitter. I'm not counting, exactly, but if someone asked, I would say about half of the animated content on Twitter doesn't play for me right now on my Windows 7. A presidential candidate just tweeted an animation that doesn't play. That's not an "edge case".

Summary: Some (rare) videos encoded with h264 stay black (audio only) → Videos encoded with a 5.2+ h264 profile stay black (audio only)

Ok, clearly this needs more attention. jya, bryce, how hard would it be to use software decoding for h264 on Windows 7 and 8.1? Do we have a path we could reuse?

Flags: needinfo?(jyavenard)
Flags: needinfo?(bvandyk)

As I said in my bug, epic and marathon can both show the vids properly on the same machine that f2f cannot.
The more alarming aspect of the bug is the continuous writes to mediacapabilities - that seems like a bug bug not a Windows 7 can't render this vid bug.

(In reply to Paul Adenot (:padenot) from comment #19)

Ok, clearly this needs more attention. jya, bryce, how hard would it be to use software decoding for h264 on Windows 7 and 8.1? Do we have a path we could reuse?

The solution isn't technical. We can only use the h264 decoder provided by the OS framework

Flags: needinfo?(jyavenard)

(In reply to westsonoma from comment #20)

As I said in my bug, epic and marathon can both show the vids properly on the same machine that f2f cannot.
The more alarming aspect of the bug is the continuous writes to mediacapabilities - that seems like a bug bug not a Windows 7 can't render this vid bug.

Firefox doesn't ship with its own H264 decoder, it is limited to what the windows framework can do.

https://docs.microsoft.com/en-us/windows/win32/medfound/h-264-video-decoder

Windows 7 decoder is also limited to 1920x1088, though with recent WMF updates it can do more.

(In reply to Jean-Yves Avenard [:jya] from comment #22)

(In reply to westsonoma from comment #20)

As I said in my bug, epic and marathon can both show the vids properly on the same machine that f2f cannot.
The more alarming aspect of the bug is the continuous writes to mediacapabilities - that seems like a bug bug not a Windows 7 can't render this vid bug.

Firefox doesn't ship with its own H264 decoder, it is limited to what the windows framework can do.

https://docs.microsoft.com/en-us/windows/win32/medfound/h-264-video-decoder

Windows 7 decoder is also limited to 1920x1088, though with recent WMF updates it can do more.
OK, thanks for explaining that. Epic is Chromium based and none of the other chromium based browsers rendered the vid.
I emailed the epic CEO and will follow up if he replies.

But... That still does not explain why ff writes to mediacapabioities continuously when an "unrenderable" vid is on the screen.
is it a fight loop of something trying and failing to render the vid? And why write to mediacapabilities shouldn't that be a read-only ish db?
Either way it tends to not down the system while doing absolutely nothing as far as the user can see.

ni? :achronop to investigate on why we continuously write in the DB

Flags: needinfo?(achronop)

(In reply to Tomas Bucher from comment #10)

The videos from web.poecdn.com are not encoded optimally. They are encoded
in H.264 level 5.2, which is not supported on Windows 7 with hardware
acceleration, see
https://docs.microsoft.com/windows/desktop/medfound/h-264-video-decoder. It
should work on Windows 8.1 and later, though.

The videos could be encoded just with level 4.2 that is sufficient for
1920x1080@60fps, i.e. the params the web.poecdn.com videos are encoded with
(see https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels) and would then
work in Firefox on Windows 7 as well.

So essentially three possible outcomes to see the videos on Windows OS:

  1. stay on Windows 7 and disable default hardware acceleration support in
    Firefox
  2. upgrade to Windows 10 and keep default hardware acceleration support in
    Firefox
  3. complain to content creators at web.poecdn.com and have them decrease
    H.264 level for their 1080p content (the fact that they use Mainconcept
    encoder does not play any role in this) and keep default hardware
    acceleration support in Firefox

Alternatively. Mozilla could try to switch to software rendering on Windows
7 and 8 for H.264 level 5.2 automatically, but not sure how feasible that is.

I have this issue but with twitter GIFs. They just stay black whenever I click on them and this might be the issue to this. I hope that this is fixed soon.

this is getting ridiculous. firefox need to have it's own decoder otherwise windows 7 to 8.1 users that not willing to upgrade to 10 will just have to switch to chrome.

this issue use to be rare but not anymore, when I browse it is on a level of half the content I have to constantly switch back between chrome and firefox. originally I stick to firefox due to the customization but now its with quantum its becoming more like chrome. if can't do it like chrome then its soon time for us to switch.

I have nothing further to add to :jya's comments above, except to reiterate that this is a licensing issue, not a technical one. We would like to support as broad a range of configurations as we can, but because we rely on the platform we are running on, we cannot support more than that platform does. We cannot ship our own decoders to these platforms due to licensing issues. So pressure needs to be applied to sites to host compatible content, or to platforms to provide better decoders.

If you have examples of media that doesn't work, that may be useful for us to verify that the bug is the one we're discussing. However, if it is, the limitations discussed above remain.

Flags: needinfo?(bvandyk)

(In reply to Bryce Seager van Dyk (:bryce) from comment #27)

I have nothing further to add to :jya's comments above, except to reiterate that this is a licensing issue, not a technical one. We would like to support as broad a range of configurations as we can, but because we rely on the platform we are running on, we cannot support more than that platform does. We cannot ship our own decoders to these platforms due to licensing issues. So pressure needs to be applied to sites to host compatible content, or to platforms to provide better decoders.

If you have examples of media that doesn't work, that may be useful for us to verify that the bug is the one we're discussing. However, if it is, the limitations discussed above remain.

https://twitter.com/i/status/1187300381077860357
https://twitter.com/i/status/1187250649571807232
https://twitter.com/i/status/1187230620167983105

(In reply to westsonoma from comment #28)

https://twitter.com/i/status/1187300381077860357
https://twitter.com/i/status/1187250649571807232
https://twitter.com/i/status/1187230620167983105

It is indeed the same issue. Checking with ffprobe -show_streams on the first video, the level is 5.2.

The use of mediacapabilities database, in this case, is odd indeed. Writing in the mediacapabilities database should happen at the EOS which, in a file on a loop, would happen at the end of each loop. However, since here we have a decoder error I don't know why we get an EOS.

It would help if you can obtain logs while reproducing the error. You can find the instructions bellow.

In a shell, execute:

export MOZ_LOG=timestamp,sync,MediaDecoder:5,MediaFormatReader:5,MediaCapabilities:5
export MOZ_LOG_FILE=/path/to/temp/dir/firefox.log
cd /path/to/firefox/binary
./firefox

note that it will write several log files there, most of them with size 0 but one file will contain all the logs from your run. Also, please mention the link that you use to create the logs.

How did you realize that the mediacapabilities database is being written? Can you please copy here the content of your database. You can do that from about:support page. Under the media section, there is a button that enumerates the database. Copy and paste the results here

Flags: needinfo?(achronop)

I forgot to ni the reporter.

Flags: needinfo?(westsonoma)

(In reply to Bryce Seager van Dyk (:bryce) from comment #27)

because we rely on the platform we are running on, we cannot support more than that platform does.

Firefox has been been superior than internet explorer for the longest time in almost every way, more addons, more features, more customization. firefox definitely can do more than what platform can.

also, firefox doesn't even need to ship with any decoder. simply implement a feature to let user browse/choose codec file to use to decode as they browse the web and that shouldnt even conflict with licensing/legal issue.

add to previous post, simply allow end user to choose between platform decoder or 3rd party decoder that they can download off the internet, problem solved no?

Another recent source of this problem is Periscope. An increasing number of broadcasters are no longer watchable on Windows 7 because the streams are marked AVC level 5.2. This is experienced trying Firefox or Chrome (Periscope has a further bug that prevents using it in IE11). It also appears to be true on Windows 8. AVC 5.2 streams play fine in Firefox on Windows 10, as expected. It's interesting that the previous problem examples were Twitter media as Periscope is now also a Twitter company.

My Windows 7 PC plays 5.2 and HVEC content just fine in MPC-HC and VLC. From what I can find, if Firefox could/would use DirectShow for H.264 and H.265, then it will automatically pick up the installed LAV filters (from K-Lite) and work fine. I found google search references to Firefox options for enabling/disabling Media Foundation and DirectShow, but I do not see any such options in my Firefox 70. Maybe they never existed in released product, or just no longer exist?

I have sent a help message to Periscope identifying this oversight on their part. But who knows what they will do. And more examples will occur as HVEC and higher AVC levels continue to expand. As the limiting to 5.1 in Media Foundation is an artificial one, it's a bit irritating.

You need to log in before you can comment on or make changes to this bug.