sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.32k stars 2.92k forks source link

H264 does not play with FireFox #2751

Open AppBuilder1984 opened 9 months ago

AppBuilder1984 commented 9 months ago

Hello,

I am very pleased with Plyr, but I have noticed, that some videos won't play with FireFox. Joomla 4 Website running on Linux System (Shared Server). They will play with e.g. latest Internet Explorer (Windows 10):

Format: mp4 Bitrate: 339.0kbps File Size: 33.37 MB Video Encode H264 Video BitRate: 339.0kbps Resolution 1280x720 Aspect Ratio: 16:9 Frame rate: 29.970 fps Audio Encode01: AAC Audio Bitrate: 128.0 kbps Audio Sample Rate: 44.0 KHz

Error:

Details: static MP4Metadata::ResultAndByteBuffer __cdecl mozilla::MP4Metadata::Metadata(ByteStream *): Cannot parse metadata

I know by now, that some codecs are licensed. But why can't Firefox play H264?

AppBuilder1984 commented 9 months ago

Codec: MPEG AAC Audio (mp4a) Typ: Audio Kanäle: Stereo Abtastrate: 44100 Hz Bits pro Sample: 32

Codec: H264 - MPEG-4 AVC (part 10) (avc1) Typ: Video Videoauflösung: 1280x720 Pufferabmessungen: 1280x720 Bildwiederholrate: 29.970628 Decodiertes Format: Ausrichtung: Oben links Grundfarben: ITU-R BT.709 Farbübertragungsfunktion: ITU-R BT.709 Farbraum: ITU-R BT.709 Bereich Farbsättigungslage: Links

Firefox 119.0.: Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006) Details: static MP4Metadata::ResultAndByteBuffer __cdecl mozilla::MP4Metadata::Metadata(ByteStream *): Cannot parse metadata

I only found this: https://stackoverflow.com/questions/40760864/how-to-play-mp4-video-in-firefox#40784948

But no solution so far.

AppBuilder1984 commented 9 months ago

I think the mp4 file was missing the correct container. I have used a converter to get a valid mp4 file and now it is playing. I guess I have to check upon upload, if the mp4 file has a valid container.

URL: https://raspberrypi.stackexchange.com/questions/50194/raspivid-h264-output-cant-be-played-by-firefox-video-player

I think what you're encountering is the difference between the H.264 compression format, and the MP4 container format. Per this Wikipedia entry, linked from Mozilla's own support pages, Firefox supports MP4, but not H.264 without a container.

The easiest eay to fix it is to encode everything as an MP4 (or another suitable container format). The information attached in the container is non-trivial, and not available in the raw H.264 file.