Created attachment 8512947 [details] FIREFOX_WONT_PLAY_THIS_VIA_HTML5_VIDEO.mp4 User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0 Build ID: 20141027150301 Steps to reproduce: Signed H264 videos cannot be played by the HTML5 video player. Google Chrome will play these files, so this appears to be a legitimate bug. VLC also plays them. Safari on iOS 7+ also plays them successfully. Safari on OSX also plays them successfully. The most likely cause of this issue is that the parser of the mp4 wrapper fails when it encounters meta-data that it does not expect rather than ignoring the meta-data and proceeding to play the file as the working browsers do. These files are signed using the ONVIF Export File Format Specification, http://www.onvif.org/specs/stream/ONVIF-ExportFileFormat-Spec-v101.pdf The file structure of the mp4 wrapper appears as follows (Obtained via the http://sourceforge.net/projects/oxfplayer/): File.mp4 ftyp free mdat moov meta Note that the only difference between a signed file and an otherwise playable H264 file with the mp4 wrapper is the presence of the “meta” entry in the file wrapper. If this field was simply ignored by the video parser, then the video would be completely playable. An example video that can be played in the aformentioned browsers but not FireFox will be attached to this bug. Repro: Use an HTML video element (<video/>) to play the file in FireFox with type "video/mp4". e.g. <video controls="" preload="auto" width="763" height="480"> <source src="URL_TO_VIDEO_FILE.mp4" type='video/mp4' /> </video> Actual results: File is not played, HTML5 video element shows "No video with the supported format and MIME type found." Expected results: The video should be successfully played by the HTML5 video player. Chrome plays it (mobile and desktop). Safari plays it (mobile and OSX). VLC plays it. IE does not play it (heh). A file to repro this is attached.
Component: Untriaged → Video/Audio
Product: Firefox → Core
Plays for me in Firefox on Windows in Nightly builds and in Release Firefox. Are you testing on MacOSX?
This behavior was repro'd on Windows 7 (fully updated) and Firefox 33.0.2. First, thanks for taking a look at this! I'm assuming that the HTML5 player has no external dependencies that could affect what it is able to decode, i.e. it's 100% self contained and all codecs ship with the Firefox builds? Could Windows 7 fail to play this but not 8.1? (we have not tested this but will find out) What gets me is that the same markup and video fails to play in Firefox and IE but does play in Chrome, so something is definitely going on there. Furthermore, if we remove the signing from a video then the video does play in Firefox and IE with the markup being the same. It's for those reasons that we believed this to be a Firefox bug. In any case, we will do some more testing and get back to you so as not to waste any more of your time in case the issue is not with Firefox despite the clues making it appear to be an issue with the specific video format. The markup we're using for playing the video includes a fallback to a flash player (which was not being invoked in the test) so perhaps there is something going on there even though that didn't seem to be the case. Thanks again for taking a look. I'll update the comments after another round of tests.
OK, that was easy. I began by testing with the latest nightly "36.0a1 (2014-10-28)" and this issue is indeed resolved there. So the fix is somewhere between 33.0.2 and 36.0a1. We'll be eagerly awaiting the release version that has the fix, and next time we'll test against the nightly builds if and when we encounter a Firefox issue. Thanks!
Spoke too soon. Still seeing an issue even in the nightly for some videos generated with a Linux build of ffmpeg. The Windows build of ffmpeg generates videos that play fine. Both builds appear to have the correct flags included (e.g. H264 support, etc.). This issue is different in that the mp4s are played but they appear corrupted, odd, dark. (Will attach screenshot.) On one PC playback immediately skipped to the end of the file and the video content was blac. On another (both with the same latest nightly) playback appeared corrupted. One might argue that the fix should be in how the H264 mp4s are generated, but Chrome again plays the same videos successfully. Will comment back after another round of testing. If this 'new' playback issue should be in a separate bug then consider this closed.
Created attachment 8513627 [details] Corrupted playback image
Attachment #8513624 - Attachment is obsolete: true
Also wanted to add: The video you have is the Linux ffmpeg version which makes this all the more interesting since you did not repro the issue but that same video fails to play for us. Again, will do more testing and comment back.
The ffmpeg build was a red herring. In case this helps here is the exact test markup being used: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> </head> <body> <video controls="" preload="auto" width="763" height="480"> <source src="FIREFOX_WONT_PLAY_THIS_VIA_HTML5_VIDEO.mp4" type="video/mp4" /> </video> </body> </html> The most puzzling thing is that you were able to play this video successfully but we are not, even on the lastest nightly (36.0a1 (2014-10-28))
OK, so this is interesting. The video appears corrupted every time the page is initially loaded and the play button is clicked. But if I stop and seek anywhere, then the player seems to reset and the video plays correctly. So right before the video plays correctly (after I've seeked to a new location in the video), I see the animated "loading" wheel and the control seems to flash (as if it is resetting/initializing again) and then the video plays fine.
So in conclusion, there appears to be a legitimate bug related to the initialization of the video. Once I get it to initialize correctly, by seeking, it plays just fine for the duration of the control/page. 36.0a1 (2014-10-28)
Component: Audio/Video → Audio/Video: Playback
Works for me. Re-open if the problem persists.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.