60fps H265 video stuttering on Roku Streaming Stick+

Discuss encoding for devices and presets.
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

Hi,

I'm having trouble with video encoded using Handbrake 1.3.3 (2020061300) stuttering when played back on a Roku Streaming Stick+ (Model 3810EU, software v9.4.0 - build 4210-50). The stutter is regular and continuous, making the content look like it's playing at about 5fps. Any help you can offer would be much appreciated.

The video is from a blu ray HD 29.97fps interlaced original, converted to 59.94fps progressive H265 using the Yadif deinterlacing filter set to 'bob'. I first noticed the problem in the PLEX app for Roku. It is possible this is a Roku problem, hence I've posted about this on the Roku forum here, and also the PLEX forum here. One very helpful user on the PLEX forum suggested the problem might be with Handbrake's output.

I've prepared some new samples. The ones referred to in the links above were 10-bit converted from 8-bit leading me to wonder if it was a problem with the specific combination of H265 + 10-bit + 60fps. More testing has shown the problem applies to 8-bit H265 videos also.

Link to samples & logs (dropbox folder)

The samples are numbered as follows with log.txt files as appropriate:

1. 1080p 59.94fps H265 sample from Handbrake (stutter)
2. 1080p 29.97fps H265 sample from Handbrake (no stutter)
3. 720p 59.94fps H265 sample from Handbrake (stutter)
4. 1080p 59.94fps H265 sample from VirtualDub2 (no stutter)*
5. 1080p 59.94fps H264 sample from Handbrake (no stutter)
6. 1080p 59.94fps H265 sample from Handbrake remuxed using MKVToolNix (stutter)

*Note VDub2's FFMPEG H265 encoder does not allow control over profile or level.

Apologies for all the singing :)

Summary of things I've tried so far:

1. Confirmed the video (sample 1) is streaming to the Roku direct without transcoding by the server. Used the Roku media player app connected to PLEX DLNA server. Forced dierct play by editing the RokuDLNA-4400X-7.x.xml profile in the Plex Server folder and double-checked via the Plex dashboard.

2. Checked that bandwidth is not an issue. The Roku client is connected to the network via Wifi (802.11n). Server is wired (1 GBe). Other videos with higher bitrates work fine.

3. Played sample 1 on my PC using VLC, Windows 10 'Films & TV' app, and MediaPortal - no stutter.

4. Played sample 1 on my phone using the Plex app for Android (original quality) - no stutter.

5. Played sample 1 on my phone direct over SMB using the MX player app for Android - no stutter.

6. Encoded the same source into H264 59.94fps with Handbrake using the same bob deinterlacing filter and tried that on the Roku stick - no stutter (sample 5).

7. Downsampled with Handbrake to 1280x720 59.94fps H265 and tried on the Roku stick - still stutters (sample 3).

8. Encoded the same source into H265 29.97fps progressive with Handbrake using the Yadif deinterlacing filter set to 'default' and tried on the Roku stick - no stutter (sample 2).

9. Encoded the same source into H265 59.94fps with VirtualDub2 using the Yadif bob deinterlacing filter and tried that on the Roku stick - no stutter (sample 4).

The problematic combination is therefore Roku playing content encoded using Handbrake into H265 at 59.94fps, irrespective of resolution.

One thing I've noticed is that when opening Handbrake-encoded 59.94fps files in VLC and checking the codec info, they are marked as 29.97fps. But they still play at the correct rate in VLC, Mediaportal, my phone apps etc., and the 59.94fps H264 sample plays fine on the Roku despite being similarly mis-tagged.

To double-check I remuxed sample 1 using MKVToolNix specifying 60000/1001p as the frame rate manually. Result: VLC now shows the correct frame rate, but it still stutters on the Roku - see sample 6.

HD 60fps HEVC (H265) is well within the compatibility matrix for the Rock Streaming Stick+, the question is whether the problem is with Handbrake's output or Roku's player/decoder.

Many thanks.
Deleted User 13735

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Deleted User 13735 »

I guess if I was encoding for a home media server, I wouldn't be using the QSV hardware encoder.
If you use one of the 1080p presets under the General tab, how does it play and look?
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by mduell »

Figure out if it's a transfer problem or a decode problem.

Try lowering the bitrate peaks using vbv.

Try using the fastdecode preset.
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

Thank you for your replies.

@musicvid: All the stuttering samples were encoded with the x265 encoder. H264 at the same frame rate and equivalent settings works fine e.g. sample 5 plays on the Roku no problem.

@mduell: I have made some test samples using the fast decode preset as you suggested - samples 7 & 8 which I've added to the dropbox folder. 7 is HD and 8 I downsampled all the way to 640x360, still H265 59.94fps. Both stutter on the Roku. Not sure what you mean by VBV, please can you explain? I would think the lower res sample would have lower bitrate peaks, is there a way to force it?

By transfer problem do you mean network bandwidth issue? I've just encoded an H264 sample (9) with a CRF of 10 - came out at over 200MB for a 30 second clip. It plays fine on the Roku streamed from my Plex server.
Deleted User 11865

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Deleted User 11865 »

When remuxing with MKVtoolnix, does demuxing first to an elementary stream and then muxing from that help at all?
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

@Rodeo: Hi, thanks for responding. I've just tried demuxing sample 1 using MKVExtract yielding an H264 and AAC stream. I then remuxed them using MKVToolNix (sample 10). Still stutters on the Roku stick.
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

I've asked on the Roku forum if it's possible the Roku stick is trying to bob deinterlace the 59.94fps video - that would produce a ~120fps stream which the Roku might struggle with. It might be doing that due to a Roku bug, or a problem with the files Handbrake is producing. Unfortunately my post doesn't seem to be attracting much attention!
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

@Rodeo: Sorry, I meant HEVC stream, not H264.
Deleted User 11865

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Deleted User 11865 »

Do the HandBrake encodes stutter locally in e.g. VLC as well?
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

Rodeo wrote: Fri Apr 16, 2021 2:05 pm Do the HandBrake encodes stutter locally in e.g. VLC as well?
No not at all. They also play fine on my Android phone's Plex app, streamed from the same server.
Deleted User 11865

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Deleted User 11865 »

Good to know. Not quite sure what the issue could be then.
Deleted User 11865

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Deleted User 11865 »

What happens if, in HandBrake, you set the framerate to 59.94fps, Constant Framerate?
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

Rodeo wrote: Fri Apr 16, 2021 4:11 pm What happens if, in HandBrake, you set the framerate to 59.94fps, Constant Framerate?
OK I've just tried that and it plays properly on the Roku, many thanks :D . Previously I had it set to 'same as source'.

I mentioned that my deinterlaced 59.94fps videos are showing up as 29.97fps in VLC's codec info. MediaInfo also shows 29.97fps (30000/1001). Even remuxing them and forcing the frame rate to 59.94fps didn't help. Is this the correct behaviour for HandBrake with bob deinterlacing enabled?
Deleted User 11865

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Deleted User 11865 »

IIRC libx265 doesn't let us flag bitstreams as VFR like we do for same as source with libx264; we just set the framerate to that of the source without accounting for any filters, which is not ideal. Not sure how we could best work around it though.
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

I see, well I have a workaround at least. Thanks again for your help. I've been banging my head against this problem on and off for months!
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

One more question. In addition to changing the container frame rate, MKVToolNix has an option to 'Fix bitstream timing info'. This seems like just the thing I need to correct these videos without re-encoding them, but it doesn't work. Do you know of any other way to adjust the video stream frame-rate after the fact?
Edddy
Posts: 10
Joined: Thu Apr 15, 2021 11:03 am

Re: 60fps H265 video stuttering on Roku Streaming Stick+

Post by Edddy »

FYI according to the MKVMerge documentation the 'Fix bitstream timing info' feature has only been implemented for H264 at the time of writing.
Post Reply