[solved] (Micro)Stutter when playing TV (1 Viewer)

Digsy

Portal Pro
August 29, 2018
206
21
53
Home Country
Great Britain (UK) Great Britain (UK)
Watching live TV indeed is the same than playing any other video file, excerpt for the fact, that this specific video file is created in "real time" while you are watching it. So it is even more weird that you could play the "timeshift" .ts video but not the recording .ts video files... If there is an issue it should have impact on both, live TV and recordings.

Quick question for @Lehmden about this:

When I play a video file on any of my clients (ripped DVD, recorded TV or any other video file), playback us pretty much flawless.

However when I play live TV or timeshifted TV on my client with wired ethernet, the playback stutters very slightly. When I play TV on my tablet over Wifi the stuttering is very noticeable. It looks like some kind of network speed issue but even my tablet play an SD movie streamed over wifi with no problems at all.

Any ideas why this stuttering only affects TV, when in fact as you say it is simply like playing any other video file?
 

HTPCSourcer

Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Any ideas why this stuttering only affects TV, when in fact as you say it is simply like playing any other video file?
    It's not. TV (and ts files) are palyed through a different mechanism. Video files are simply loaded from the server and played locally. TV (and .ts) are permanently written to timeshift files that are read by the client. This is a very timing-sensitive process while the video replay, which is buffered, is not.
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,553
    3,934
    Lehmden
    Home Country
    Germany Germany
    Hi.
    when in fact as you say it is simply like playing any other video file?
    If you have a look into the timeshift folder while you (or someone else) are watching LiveTV you will see a bunch of .ts video files. Name and number depends on your current system but did not matter in this case. If you now copy one of those .ts videos over to another place (don't stop watching live TV while copying as if you do so the files will be deleted instantly) it is a completely "normal" video file. The Server only is playing this temporary but normal video exactly as every other video file and send it to the client like it does with every other video too.

    But Timeshifting is very timing sensitive. The video must be grabbed from antenna, remuxed to contain the wanted streams, written to the timeshift folder by the TV Engine (more or less independently from the server) and read by the server for playback at the same time. And this has to be done for every client watching Live TV at the same time...
    For this the physical disk used for Timeshifting is important. Worst case is if it is the same disk than the OS is installed as Windows constantly is reading and writing on this disk. Best case is a RAM Disk... I always had issues with stuttering Live TV until I changed over to a "dynamic" RAM disk (IMDisk Toolkit)... Ever since then all stutter disappears... So most likely the stutter has it's root cause here...

    It's similar as if 4 or 5 or even more tasks are trying to play different videos from the same disk at the same time. Maybe you can imagine that it is a bit sensitive...
     

    Digsy

    Portal Pro
    August 29, 2018
    206
    21
    53
    Home Country
    Great Britain (UK) Great Britain (UK)
    OK, that makes perfect sense, except for some reason I don't see a massive difference in performance by changing the location of the timeshift folder.

    I have tried it on my server hard drive, which is a dedicated 1TB HDD just for recording TV (so nothing else should be accessing it whn I an running these tests), and also on my system drive which is a 240Gb SSD.
    Finally I have a 1Gb Ramdisk (DataRAM free version). Even moving the timeshift file here made virtually no difference that I could see.

    Performance over WiFi was worse that wired in all three cases (my wired ethernet is 100mbit/s). Obviously HD channels suffer more than SD ones. Of course I do not know what other Wifi traffic there may be going on at the same time.

    I have left it on RAM disk for now as it seems like this should be the solution, even though it isn't right now.
     
    Last edited:

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Performance over WiFi was worse that wired in all three cases (my wired ethernet is 100mbit/s). Obviously HD channels suffer more than SD ones. Of course I do not know what other Wifi traffic there may be going on at the same time.
    TV over WiFi will always give you troubles, at least until you can establish a stable connection that allows a 5-8 MBit/s stream without interruptions. If you would like to further discuss this subject then I'll move the postings to a separate thread.
     

    Digsy

    Portal Pro
    August 29, 2018
    206
    21
    53
    Home Country
    Great Britain (UK) Great Britain (UK)
    If you would like to further discuss this subject then I'll move the postings to a separate thread.

    I'd like to investigate things a little bit further because it also affects my wired client, even if only very slightly.
     

    Digsy

    Portal Pro
    August 29, 2018
    206
    21
    53
    Home Country
    Great Britain (UK) Great Britain (UK)
    Here are a couple of videos of the same programme in SD and HD filmed on my client with wired ethernet. To be honest in the SD clip I struggled to see any problems. The stutter shows up better with scenes with more movement. In the HD clip you might notice the audio going gradually out of sync with the video.
     

    Attachments

    • Live TV test 12-Oct-2018.zip
      8.7 MB

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    @Digsy, please reproduce your observations and post full debug logs of both client and server. The video doesn’t allow any diagnostics.

    Did you verify the CPU load on the client when playing HD? Did you activate the hardware acceleration in the LAV settings? Did you check that it is actually working?

    As I wrote in another of your threads there is not the LAV setting and it may be necessary to do some experiments on the client.

    Also keep in mind that a 100 MBit Ethernet connection can come to its limits if other traffic is happening at the same time in your network, particularly if sent over the same server network interface. HD bitrates can reach 7-8 MB/s which doesn’t leave much room for anything else.
     
    Last edited:

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    One more thing to check: play a HD show and press F10 on your keyboard. The red curve should be smooth, you should get 50 FPS.
     

    Digsy

    Portal Pro
    August 29, 2018
    206
    21
    53
    Home Country
    Great Britain (UK) Great Britain (UK)
    One more thing to check: play a HD show and press F10 on your keyboard. The red curve should be smooth, you should get 50 FPS.

    Did you play the video I posted? In case you didn't realise I filmed the screen with my phone with the F10 diagnostics turned on . You can see the red curve is not completely smooth, especially in the HD version.

    CPU load is 30% when playing SD TV and 70% when playing HD TV.

    Hardware acceleration (Intel QuickSync) is turned on in my client and server but I do not know how to tell if it is working.

    I will create logs later when I can be sure that my client isn't doing anything in the background.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom