Closed Bug 1006798 Opened 10 years ago Closed 9 years ago

HTML5 videos sometimes stop while audio continues

Categories

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

x86_64
Windows 8
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: r_rom, Unassigned)

References

Details

Often, the video content stops progressing while audio stream continues. And pausing playback becomes impossible.

Using 32.0a1 (2014-05-06). Happened with older versions too.
Severity: normal → major
I've seen this too, I think 2 days ago. But it seems to be pretty rare. I'm on Windows 7.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Could we please get some more info on steps to reproduce?  Example videos seen with etc...
Flags: needinfo?(r_rom)
Flags: firefox-backlog?
I don't have STR, but I know the video I saw the problem: https://www.youtube.com/watch?v=ZG1AT6tylA4
For me, basically, always at some point the video will stop loading... I never can watch it completely without loading problems, but may be a problem with youtube html5, my internet service or Nightly. I haven't investigated the problem. I think that in one of this situations Firefox kept playing the sound, but the video paused showing the loading sign (the circle spinning in the middle of the video).
I can only repeat what Guilherme wrote. He described it well. It's happened for different videos for me, and happens often. 

It APPEARS to happen more frequently with long videos, which makes sense as they provide more chances for things to go wrong.

It also APPEARS that switching from the regular mode to full screen mode (back and forth) is a factor, but I wouldn't bet any amount of money on this.
Flags: needinfo?(r_rom)
This has just happened for this video: https://www.youtube.com/watch?v=w-HYZv6HzAs
happened in the first several seconds. The video stopped progressing, audio continued, the progress animated image in the center kept rotating, pausing the video/audio was impossible, and the audio continued for about 15 seconds after I closed the tab.
It happens with short videos too. E.g. https://www.youtube.com/watch?v=tMGQO8sy2iY.
Component: General → Video/Audio
Product: Firefox → Core
The problem is more serious. It's just happened with a non-Youtube video. With this one: http://www.hayhouseworldsummit.com/home-registered-free/?vid=93181137.

I've paused it a few times during the playback, and then, roughly in the middle of the video, all of a sudden, the video stopped progressing, audio continued, and attempts to pause the whole thing have failed. This lasted for many minutes, until the end of the video.

I will rename this issue to reflect this new info.
Summary: Youtube HTML5 video stops while audio continues → HTML5 videos sometimes stop while audio continues
(In reply to Roman R. from comment #5)
> This has just happened for this video:
> https://www.youtube.com/watch?v=w-HYZv6HzAs

If you open this video in Firefox, and right click on the video, do you see a "About Adobe Flash Player..." menu appear? If so you're not getting the HTML5 player. I only get the Flash version of this video in Firefox.
(In reply to Chris Pearce (:cpearce) from comment #9)
> (In reply to Roman R. from comment #5)
> > This has just happened for this video:
> > https://www.youtube.com/watch?v=w-HYZv6HzAs
> 
> If you open this video in Firefox, and right click on the video, do you see
> a "About Adobe Flash Player..." menu appear? If so you're not getting the
> HTML5 player. I only get the Flash version of this video in Firefox.

I got the HTML5 version.
You need to have a Youtube account and set it to use HTML5 player whenever possible. https://www.youtube.com/html5
I only get a working YouTube HTML5 player if set the pref media.mediasource.enabled to true. Did you do that?
Chris, do nothing with FF's prefs. Log into your Youtube account and then request HTML5 player at https://www.youtube.com/html5
I enabled the HTML5 player.

I realised see why the player wasn't working, I had the fragmented mp4 demuxer exposed.

Roman: What hardware are you playing on? I'd guess that your video decoding isn't keeping up and we're skipping video decoding so that the audio decoding doesn't fall behind.
Chris, I use HP ENVY dv7-7238nr. See if you can find the details you need.

A question to you: why does this never happen with videos played by Flash or VLC Player? Why only in Firefox?
Has just happened with http://rachaeljayne.com/10day/vid4/. All the same symptoms. My computer's resource usage was low enough.

THIS IS A MAJOR FLAW. If a browser can't play videos, the browser's value is low.
Flags: firefox-backlog? → firefox-backlog-
I haven't experienced this in weeks. Youtube has switched to HTML5 mode, and so all videos I've been watching on that site are played with HTML5 player. I haven't experienced this problem on other sites too. Perhaps, something has changed in in this area of Firefox.
We have observed this issue where mp4 videos playing in Firefox will at times freeze while the audio continues for awhile now (almost a year). Videos are formatted in mp4 using HTML5 video tags and displayed full screen using the R-Kiosk 0.9.0 extension. The videos are displayed in public galleries and run from a local Xampp server which hosts our content, so we have reasonably good bandwidth. 

Some videos are supposed to loop continuously, others are selected by visitors from another display. In either case we find that the videos will freeze intermittently, and often several times a week. The problem has not been easy to diagnose in terms of identifying an exact workflow causing the issue because it is so intermittent.  The video freezing does occur regularly, and on average once every 5-10 hours of video. The individual videos themselves are not long, ranging between 10 and 20 minutes.

One idea from another forum suggested it might be the encoding scheme, so various versions of mp4 files have been tested. This started with trying variable bit rates (vbr) anywhere from 5-25mbps down to 1-2mbps. When the problems persisted, constant bit rate (cbr) encoding was also tested with video files reformatted using anywhere from 15, 10, 7 down to 2mpbs. Audio used AAC at 48khz and 96kbps, or 44khz and 80kbps. Video encoding Profile is "Main", not "High", and a typical resolution is 1920x1080. 

It seemed initially that this helped since the initial tests at a lower vbr did not freeze as often, but eventually the videos would freeze up, requiring as always, a manual restart of the browser. This may not sound like it should have been a problematic issue, but it must be kept in mind that these systems were designed to be autonomous, and the freezing video issue has caused considerable inconvenience for everyone concerned.  

In another test we increased the RAM memory on the PC's from 2Gig to 4Gig, but observed no change. The Firefox buffer was also increased to 1024 Megs (Tools->Options->Advanced->Network->Override Cache Management), and the browser was set to clear the cache whenever it closed.  However, the browser was only closed when the PC was shutdown in the evening. Also, the computers are Asus EeeBox w/ Atom D2550, GeForce GT 610M, otherwise very reliable mini-computers.

Solutions to the problem are welcomed, but so are work-arounds.
(In reply to Ian from comment #19)
> Solutions to the problem are welcomed, but so are work-arounds.

I assume you're running Windows? You could try a Firefox Nightly or Aurora build; we made major changes to our decoding backend in Firefox 34 on Windows. These changes haven't shipped in Release builds yet, they're only still in Nightly and Aurora builds.

Please let me know how testing Nightly or Aurora builds go, we made these changes in order to improve our reliably.

You can also try setting the <video> element's "src" attribute to "" (empty string) when you're finished with a video. This will dispose of all the decoding resources. Be aware that this will fire an error event at the video element too, so if you're listening on that event, you will want to remove your listener before setting src="".

Good luck, please let me know it goes!
Hi Chris, 
Thanks for your reply... yes we are using Windows7 SP1. I was most interested to hear about the upcoming releases that might help address these issues.  In the meantime, I will start to experiment with the nightly builds (https://nightly.mozilla.org/).

Regarding the suggestion about using the <video> element and syntax, would an acceptable format include the 'type' attribute?  

<video width="1920" height="1080" >
  <source src="" type="video/mp4">
</video>
Hi Chris,
Just to let you know, I've installed the Nightly build 35.0a1 on one screen, and it has run for about a day now without any interruptions. So far so good. 
Ian
(In reply to Ian from comment #22)
> Hi Chris,
> Just to let you know, I've installed the Nightly build 35.0a1 on one screen,
> and it has run for about a day now without any interruptions. So far so
> good. 
> Ian

Great! Keep me posted.

(In reply to Ian from comment #21)
> Regarding the suggestion about using the <video> element and syntax, would
> an acceptable format include the 'type' attribute?  
> 
> <video width="1920" height="1080" >
>   <source src="" type="video/mp4">
> </video>

No. What I mean is, you need to set the "src" attribute to the empty string ("") when you've finished playback. So something like:

<script>
// Assuming your video has id "video".
document.getElementById("video").onended = function() {
  v.src = ""; // Force video decoder to die when playback reaches end.
};
// ...
</script>
Hi Chris, 
Thank you for the clarification on syntax... that of course makes sense. 

btw, the video in question has been playing now for almost 80 hours without interruption. So that is very good news.   
Thanks again,
Ian
Hi Chris, 
Firefox Nightly finally crashed today, but it was a good run. It restarted fine and is running again. I also submitted a crash report when prompted. If you would also like a copy of the status file when it crashed please let me know. 
Ian
(In reply to Ian from comment #25)

I will follow up via email, to avoid filling up this bug with things related to a different issue. Thanks!
Some more crash reports related to this bug,
Report ID 	Date Submitted
bp-d73f641e-5a4b-47ff-a7ee-1767a2141110	09/11/2014	10:27 PM
bp-82e76926-2835-453c-a0f0-334f42141109	08/11/2014	7:13 PM
bp-35506003-296b-48a5-b22a-053772141109	08/11/2014	7:13 PM
bp-440534cd-11aa-4712-86de-004f62141109	08/11/2014	7:12 PM
bp-214363af-393f-4887-8951-1ce332141109	08/11/2014	7:12 PM
Component: Audio/Video → Audio/Video: Playback
I think this is fixed. Re-open if it isn't.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME

I'm not sure this is fixed. I've been seeing it with increasing regularity. Was there a patch that was meant to have fixed this?

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