Closed Bug 1418660 Opened 7 years ago Closed 7 years ago

Choppy 1080p 60fps video playback when hardware acceleration is enabled.

Categories

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

57 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1408705

People

(Reporter: gercc.91, Unassigned)

Details

Attachments

(1 file)

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

Steps to reproduce:

1 - Enable hardware acceleration 
2 - Open a twitch stream or youtube video (some youtube videos play fine while others will not; on Twitch its 100% reproducible)
3 - Set to play at 1080p and 60fps



Actual results:

Video will decode fine, with no dropped frames, but the framerate will be uneven and stuttery. At 720p and 60fps the video will play fine.


Expected results:

Video playback works fine on other browsers that also use hardware acceleration.


This is happening on a R7 360 gpu (AMD) and I5 4440 CPU on Windows 10 version 1709. iGPU is disabled in BIOS to ensure no conflicts.
Could you please install the media devtools extension available there: https://addons.mozilla.org/en-US/firefox/addon/devtools-media-panel/

Following the instructions for this add-ons, while playing a video with the problem, go to the media devtools. Press refresh, and copy paste the output here..

thank you.
Flags: needinfo?(gercc.91)
IF you have a fast machine, vp9 codec may be enabled (mostly with youtube) which would cause the CPU to be used (none of your list machines support VP9 hardware decoding.

Copying here the result of about:support would help diagnose what the problem could be.
Ok this is what the media tool gave me 

Media Info : [

    0 : {
        url : "https://www.twitch.tv/ramzesdoto"
        mediaElements : [...] 1 item
    }

]

[
  {
    "url": "https://www.twitch.tv/ramzesdoto",
    "mediaElements": [
      {
        "currentSrc": "blob:https://www.twitch.tv/14afdd6c-3cb4-480c-ab57-6b20270372c7",
        "currentTime": 26.83779,
        "readyState": 3,
        "videoPlaybackQuality": {
          "ratio": "98%",
          "droppedVideoFrames": 31,
          "corruptedVideoFrames": 0
        },
        "bufferedRanges": [
          {
            "start": 14.583,
            "end": 14.602
          },
          {
            "start": 14.639,
            "end": 30.583
          }
        ],
        "mozMediaSourceObject": [
          {
            "sourceBuffers": [
              {
                "start": 14.583,
                "end": 30.583
              }
            ]
          },
          {
            "sourceBuffers": [
              {
                "start": 14.583,
                "end": 14.602
              },
              {
                "start": 14.639,
                "end": 30.583
              }
            ]
          }
        ],
        "debugInfo": {
          "Container Type": "MediaSource",
          "Audio Decoder(audio/mp4a-latm)": "wmf audio decoder",
          "Audio Frames Decoded": "1659",
          "Audio State": "ni=0 no=0 wp=0 demuxr=0 demuxq=0 decoder=0 tt=-1.0 tths=-1 in=91 out=90 qs=1 pending=0 wfd=0 eos=0 ds=0 wfk=0 sid=19",
          "Video Decoder(video/avc, 1920x1080 @ 55.55)": "wmf hardware video decoder (remote)",
          "Hardware Video Decoding": "enabled",
          "Video Frames Decoded": "1439 (skipped=0)",
          "Video State": "ni=0 no=0 wp=0 demuxr=0 demuxq=0 decoder=0 tt=-1.0 tths=-1 in=697 out=676 qs=25 pending:4 wfd=0 eos=0 ds=0 wfk=0 sid=18",
          "Dumping Data for Demuxer": "195a0a37000",
          "Dumping Audio Track Buffer(video/mp4)": "mLastAudioTime=28.876333",
          "Audio Track Buffer Details": "NumSamples=750 Size=499913 Evictable=448001 NextGetSampleIndex=670 NextInsertionIndex=750",
          "Audio Track Buffered": "ranges=[(14.583000, 30.583000)]",
          "Dumping Video Track Buffer(video/mp4)": "mLastVideoTime=27.310000",
          "Video Track Buffer Details": "NumSamples=880 Size=7282229 Evictable=5466197 NextGetSampleIndex=697 NextInsertionIndex=880",
          "Video Track Buffered": "ranges=[(14.583000, 14.602000), (14.639000, 30.583000)]",
          "MediaDecoder State": "channels=2 rate=48000 hasAudio=1 hasVideo=1 mPlayState=PLAYING mdsm=19598d96000",
          "MediaDecoderStateMachine State": "GetMediaTime=26837790 GetClock=26847165 mMediaSink=195a6412640 state=DECODING mPlayState=3 mSentFirstFrameLoadedEvent=1 IsPlaying=1 mAudioStatus=idle mVideoStatus=idle mDecodedAudioEndTime=28854999 mDecodedVideoEndTime=26911000mAudioCompleted=0 mVideoCompleted=0mIsPrerolling=0",
          "VideoSink Status": "IsStarted=1 IsPlaying=1 VideoQueue(finished=0 size=4) mVideoFrameEndTime=26855000 mHasVideo=1 mVideoSinkEndRequest.Exists()=0 mEndPromiseHolder.IsEmpty()=0"
        }
      }
    ]
  }
]

Im also attaching a txt file with the about:support details
Flags: needinfo?(gercc.91)
Attached file about:support
Is this a desktop or laptop machines? If a laptop, does this occur if connected to power?

Everything appears correct otherwise, it is hard to understand why you could have an issue.

Can you try changing the layers.mlgpu.enabled preference from true to false in about:config? you'll need to restart firefox after modifying thie preference.

To better understand the problem however, could you make a video capture of playback with the problem? I don't see how you could have uneven frame rate.
Tried changing those settings to no avail.

The issue is not easily seen on video https://streamable.com/0i9wh (forgive the terrible quality), but it's extremely obvious on my browser.

At 1080p it seems to be playing at slightly lower than 60 while at 720p it runs at a steady frame rate.

Also, i noticed that on youtube VP9 videos play fine, it's the mp4 ones that seem to be choppy, not sure what twitch uses.
The last thing to try is disabling the GPU process:
Set layers.gpu-process.enabled and media.gpu-process-decoder to fals. Must restart Firefox...

If still no difference, and as vp9 plays fine, you may want to disable the hardware video decode, you do that in the preferences.
Alright, seems that last change fixed it. Curious why these settings would cause an issue.
(In reply to gercc.91 from comment #8)
> Alright, seems that last change fixed it. Curious why these settings would
> cause an issue.
Which one fixed it? disable the hardware video decode?
(In reply to Blake Wu [:bwu][:blakewu] from comment #9)
> (In reply to gercc.91 from comment #8)
> > Alright, seems that last change fixed it. Curious why these settings would
> > cause an issue.
> Which one fixed it? disable the hardware video decode?

The post prior was about disabling the GPU process, so the reason why playback is bad is now obvious.

We have an existing bug that there's a performance regression when the GPU process is enabled
(In reply to Blake Wu [:bwu][:blakewu] from comment #9)
> (In reply to gercc.91 from comment #8)
> > Alright, seems that last change fixed it. Curious why these settings would
> > cause an issue.
> Which one fixed it? disable the hardware video decode?

layers.gpu-process.enabled and media.gpu-process-decoder Disabling these two fixed it. Hardware acceleration should still be on.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: