Lagging and buffering

Server Version#:
Player Version#:
Hello my QNAP TS-451+ (8GB RAM) Is lagging a lot when streaming movies and series. Sometimes it´s possible to watch a movie for 5 minutes and then it start to buffer. It has a 80 Mbit/s connection and when I look at the hardware usage it´s only using like 10-30% of the cpu power and about 25% of the RAM.

Are subtitles involved or in the video and
Are those subtitles SRT / ASS / SSA (text based) and
Is the Player set to Automatic subtitle handling

or

Are image based subtitles PGS / VOBSUB / DVDRIP involved?

If subtitles are involved, PMS must burn the subtitles into the video image using the CPU
(the capability to use the hardware doesn’t exist yet in VA-API but is under development by Intel)

Burning subtitles is a single-threaded task and will use about 25% of a quad core CPU.

Hi Chuck.
The problems is the same with/without subtitles.

let’s recreate it in the logs:

  1. Verify DEBUG logging on, VERBOSE logging off
  2. Start Playback of one you know will have a problem
  3. Play for 30 seconds
  4. Stop playback
  5. Wait for 30 seconds
  6. Settings - Server - Troubleshooting - Download Logs
  7. Hover over the item you just Played -> Expose ellipsis - Get info - View XML
  8. Attach the ZIP and paste in the XML (from the streams only – don’t need genre or artist)

paste using this technique (three back-ticks on the preceding and succeeding lines)
```
paste xml here
```

Let’s see what it’s looking at.

Hi Chuck.
Hope this helps:

<Video ratingKey="5695" key="/library/metadata/5695" guid="com.plexapp.agents.imdb://tt0372784?lang=da" librarySectionTitle="Voksen film" librarySectionID="1" librarySectionKey="/library/sections/1" studio="Warner Bros. Pictures" type="movie" title="Batman Begins" contentRating="PG-13" summary="Efter det brutale mord på hans forældre rejser den desillusionerede industri-arving Bruce Wayne rundt i verden for at lære at forstå, hvordan den kriminelle hjerne fungerer. Han begynder snart på sin rejse at bekæmpe uretfærdighed og skabe frygt blandt dem, der udnytter de svage – samtidig med at han kæmper mod sine egne dæmoner.Da han vender tilbage til Gotham City, opdager han, at byen flyder med organiseret kriminalitet, småforbrydere og moralsk forrådnelse. Bruce slår sig sammen med politibetjenten Jim Gordon og den offentlige anklager Rachel Dawes.Med deres hjælp og en masse støtte fra sin altid trofaste butler Alfred, samt Lucius Fox fra Wayne Enterprises, skaber Bruce sit alter-ego: Batman, en kappeklædt hævner, der bruger sin styrke, sit intellekt og en imponerende række avancerede high-tech gadgets våben i kampen mod det onde." rating="8.3" viewOffset="2080000" lastViewedAt="1571056639" year="2005" thumb="/library/metadata/5695/thumb/1571040576" art="/library/metadata/5695/art/1571040576" duration="8403020" originallyAvailableAt="2005-06-10" addedAt="1570986797" updatedAt="1571040576" chapterSource="media" primaryExtraKey="/library/metadata/5696" ratingImage="imdb://image.rating">
<Media id="8552" duration="8403020" bitrate="16774" width="1920" height="1080" aspectRatio="1.78" audioChannels="6" audioCodec="dca" videoCodec="vc1" videoResolution="1080" container="mkv" videoFrameRate="24p" audioProfile="dts" videoProfile="advanced">
<Part accessible="1" exists="1" id="8576" key="/library/parts/8576/1553949124/file.mkv" duration="8403020" file="/share/CACHEDEV1_DATA/Multimedia/Voksen film/Batman Begins.mkv" size="17619324123" audioProfile="dts" container="mkv" videoProfile="advanced">
<Stream id="31300" streamType="1" codec="vc1" index="0" bitrate="15238" language="English" languageCode="eng" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" colorPrimaries="bt709" colorSpace="bt709" colorTrc="bt709" frameRate="23.976" height="1080" level="3" profile="advanced" refFrames="1" scanType="progressive" width="1920" displayTitle="1080p (VC1)"/>
<Stream id="31301" streamType="2" default="1" codec="dca" index="1" channels="6" bitrate="1536" language="English" languageCode="eng" audioChannelLayout="5.1(side)" bitDepth="24" profile="dts" samplingRate="48000" displayTitle="English (DTS 5.1)"/>
<Stream id="31302" streamType="2" selected="1" codec="truehd" index="2" channels="6" bitrate="1551" language="English" languageCode="eng" audioChannelLayout="5.1(side)" bitDepth="24" samplingRate="48000" title="Surround 5.1" displayTitle="English (TRUEHD 5.1)"/>
<Stream id="31303" streamType="3" selected="1" default="1" codec="srt" index="3" bitrate="0" language="Dansk" languageCode="dan" displayTitle="Dansk (SRT)"/>
<Stream id="31304" streamType="3" codec="srt" index="4" bitrate="0" language="Svenska" languageCode="swe" displayTitle="Svenska (SRT)"/>
<Stream id="31305" streamType="3" codec="srt" index="5" bitrate="0" language="Norsk" languageCode="nor" displayTitle="Norsk (SRT)"/>
<Stream id="31306" streamType="3" codec="srt" index="6" bitrate="0" language="Suomi" languageCode="fin" displayTitle="Suomi (SRT)"/>

Thanks.

VC-1 HW decode got lost. That’s why it lags.

If you look at plex.tv/downloads, you will find an update. 1.18.0.1944
Please test this and you should find the VC-1 hardware decoder is back.

If not, please let me know

No improovement after the update.
The “decode speed” when looking at VERBOSE logging is stil 0,7 - 0,9 and the CPU load is 30 %.

Let me find out what happened to VC-1 HW decode codec.

Without it, VC-1 will be unusable.

Ok, thanks.
I just played the same movie but with Plex Server installed on my laptop (Lenovo T580).
I used QNAP as file server.
I played the movie from my Samsung TV.
Both TV and laptop was connected through wifi.
Transcode speed was about 2,2 - 2,5 an the movie played just fine on the TV.

Shouldent the codec be the same on my laptops and on the QNAP?

The QNAP has the J1900 CPU. it has HW transcoding albeit not as good as the J3455 in the other models.
It should be able to do fine with 1080p (you have) and at that bitrate.
I will need to back and confirm it has VC-1 compatibility.

I was incorrect.

The J1900 does not have VC-1 HW capability. (BayTrail CPU)
Your Lenovo does.

The speed of 2.2x means it can transcode 2.2x faster then realtime playback need.

The J1900 will do H.264, MPEG2 fine. It can’t do the heavy lifting of HEVC / VC-1

Ref: https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video

Hello @ChuckPa,

I also have some lagging and buffering issues although I have a DS918+, and I’m just playing videos directly from my local network without transcoding (connection with RJ45 cable which I checked). May I post my logs here or should I create a new thread?

Thanks.

Yes.

Please make certain to have DEBUG logging enabled, and VERBOSE disabled (these are the defaults)

Start the playback, let it go a little bit (first stutter)
then stop
wait 30 sec.
pull the ZIP file of the logs.

Thanks. Here are the logs: Plex Media Server Logs_2019-10-14_20-04-18.zip (4.5 MB)

It happens here with a 4K movie (and is really not watchable as is) and sometimes even with 1080p.

Bad news.
Do you have any suggestions to a solution?
Can I cobvert the movies?
Shall I buy a new NAS or media server?

@VicDm

You have subtitles involved.

Oct 14, 2019 16:47:09.660 [0x7f9dc2264700] DEBUG - Auth: authenticated user 1 as VicDm
Oct 14, 2019 16:47:09.675 [0x7f9dc2264700] DEBUG - We're going to try to auto-select an audio stream for account 1.
Oct 14, 2019 16:47:09.675 [0x7f9dc2264700] DEBUG - Selecting best audio stream for part ID 6486 (autoselect: 1 language: fr)
Oct 14, 2019 16:47:09.675 [0x7f9dc2264700] DEBUG - We're going to try to auto-select a subtitle.
Oct 14, 2019 16:47:09.675 [0x7f9dc2264700] DEBUG - Selected a foreign audio track: eng
Oct 14, 2019 16:47:09.675 [0x7f9dc2264700] DEBUG - Subtitles: Found a candidate subtitle language [eng] for a foreign film
Oct 14, 2019 16:47:09.675 [0x7f9dc2264700] DEBUG - Audio Stream: 36162, Subtitle Stream: 36165
Oct 14, 2019 16:47:09.677 [0x7f9dc2264700] DEBUG - Codecs: testing h264_vaapi (encoder)
Oct 14, 2019 16:47:09.677 [0x7f9dc2264700] DEBUG - Codecs: hardware transcoding: testing API vaap

Depending on subtitle type, the player, and the player’s settings (automatic, or image formats only) and if the subtitles are TEXT based (SRT, ASS, SSA) you will be ok. Anything else will require the CPU get involved and the J3455 CPU (processor portion) can’t do it. The ASIC can handle the video but the CPU cannot handle burning subtitles We are hoping Intel provides the ability to burn subtitles in hardware but it’s not been released yet.

@Snedkeren86
My best suggestion is to, for as much as I hate to.

  1. Handbrake this file.
    a. Set the output video bitrate manually at 20 Mbps
    b. Set it for 2-pass encoding.
    c. Copy through all the audio tracks
    d. If you want the subtitles, bring them along too.

  2. Test that output - If you like the results, switch them out. Don’t forget to “Analyze” the file in PMS again so it knows you made the change.

By increasing the bitrate artificially in HandBrake then allowing 2-pass encoding, You preserve the quality during the first pass. The second pass refines the image and brings you back to just about where it was when you started. I think you’ll be pleased with the result.

Thanks for your answer.

Right, I just played the most problematic movie without subtitles and it plays much better. By the way I’m displaying information on the image and I see that in this case, video is in Direct Play, whereas with subtitles it’s transcoding. But what is strange is that I’m always using text subtitles (.srt) so transcoding shouldn’t occur. I checked my settings and subtitles are burned only with image based formats. And SRT subtitles are supported by my TV (https://media.flixcar.com/f360cdn/Tpvision-3634264834-55oled803_12_pss_.pdf). So I wonder why Plex is transcoding this movie.

I also checked on others, most of the time it plays directly with the srt subtitles, so the result is fine. However, at times, even without any subtitle enabled, I see some stuttering, it’s not buffering, not pausing, but the movement is not fluid (especially at the start of the playback, it kind of solves and then comes back). I just noticed it (on a playback without subtitles) and exported new logs, if you want to have a look: Plex Media Server Logs_2019-10-14_21-27-15.zip (3.5 MB)

Check the player settings.

The player is in control over what happens to subtitles.
If it can’t handle text overlayed (some can’t) then they must be burned.
Check the player settings. Try “Image Formats Only” for the burning option. SRT will pass directly trough this way. If the player can handle them, you’ll see them. if it can’t, you won’t see any. This is a very definitive way of testing.

I will be able to look at the logs in a bit. I’m trying to catch up on all I missed as well as balance with my need to go easy for a few days (medical ).

Yeah I already tried “Image Formats Only” in the burning options. Ah I just figured that it transcodes the video of this movie when i select srt subtitles + TrueHD audio (transcoded as my TV doesn’t support this audio format). If I choose srt subtitles + AC3 compatibility track, nothing is transcoded. I guess it can’t pass the srt subtitles through while transcoding audio for some reason.

Ok no problem, take care :slight_smile: The stuttering problem seemed to start after I imported my whole collection of films(1400+)/musics(4000+)/episodes(1000+), I’m afraid of some kind of heavy database problem.

It might just be getting all the metadata too. Also remember that if you have chapter indexes enabled, it will be running those tasks too which is a notable load on a smaller processor.