video image freezes for a few seconds (maybe video decoding bug)




Audio/Video: Playback
2 months ago
11 days ago


(Reporter: Djfe, Assigned: alfredo)




Firefox Tracking Flags

(firefox57 affected, firefox58 affected, firefox59 affected)



(2 attachments)



2 months ago
Created attachment 8929828 [details]

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
Build ID: 20171118220429

Steps to reproduce:

I played a video on Telegram, that I had uploaded earlier from my smartphone. (attached)
(I also played it in a new tab using a fresh profile to be sure)

Actual results:

The first few seconds of video of all those videos aren't decoded properly (audio is)
Or atleast the image doesn't update.

the amount of time that the image freezes seems to be of the same duration regardless of total video length, so I'll upload a short video.

Expected results:

It should've shown the full video.

Comment 1

2 months ago
I'm using Firefox Nightly 64bit on Win 10 Education Edition
Latest updates are installed (OS and nightly)


2 months ago
Summary: first few seconds of video aren't decoded correctly → video image freezes for a few seconds (maybe video decoding bug)
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
This problem can be seen on my windows laptop with Firefox 57, 58, and 59. 
Chrome can play the video well.
status-firefox57: --- → affected
status-firefox58: --- → affected
status-firefox59: --- → affected
Keywords: compat
Priority: -- → P2


2 months ago
Flags: needinfo?(ayang)


12 days ago
Assignee: nobody → ayang
Flags: needinfo?(ayang)

Comment 3

12 days ago

this video has an invalid keyframe at the beginning so the first few seconds can't be decoded. (depending on error handle of the decoder. In Safari, it can't be played at all.)
I'll see anything we can do here.
BTW, which device you use to record this video?
Flags: needinfo?(felix.bau)

Comment 4

12 days ago
Hi Alfredo,

well that explains it, and why why this bug occured consistenly across all videos, that I encoded this way. :)
FFmpeg's decoder doesn't seem to give a **** and decodes that frame without a warning (I wasn't using verbose logging though)

I used the telegram android app back then to send videos and it automatically reencoded the video to save some space (Opt-out).
After that I was wondering, why it had playback issues on Firefox (accessing the messages from the Telegram Web app) but not in VLC.

I'll retest, if this issue still exists in current versions of the app and send them another bug report if that's the case.

Until then: Is this fixable? should this be fixed or not? what do you think?
(EDGE hat issues with the video, too)
Flags: needinfo?(felix.bau)

Comment 5

11 days ago
(In reply to Djfe from comment #4)
> Until then: Is this fixable? should this be fixed or not? what do you think?
> (EDGE hat issues with the video, too)

Thanks for the info.

I tried to ignore the error, even it could play smoothly but there are broken frames at the beginning, you could see some strange green block in the attachment. For this case, I think it is a video content error.

We knew FFmpeg has better error handle than most decoders. We can't use FFmpeg due to patent issue. Instead, Firefox uses system platform decoder, it is WMF on Windows. That explains why Edge has issues to play it.

A keyframe its first NALUnit type should be IDR (5) or SEI (6) with recovery point. In this video, it has SEI type but no recovery point, so Firefox marks it non-keyframe and then following frames couldn't be decoded until the real keyframe arrives.
Last Resolved: 11 days ago
Resolution: --- → INVALID

Comment 6

11 days ago
Created attachment 8941007 [details]
You need to log in before you can comment on or make changes to this bug.