[solved] - (Micro)Stutter when playing TV

Discussion in 'General' started by Digsy, October 12, 2018.

  1. Digsy

    Digsy Portal Pro

    Joined:
    August 29, 2018
    Messages:
    165
    Likes Received:
    11
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Great Britain (UK) Great Britain (UK)
    Show System Specs
    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?


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,519
    Likes Received:
    1,106
    Gender:
    Male
    Ratings:
    +2,375 / 21
    Home Country:
    Germany Germany
    Show System Specs
    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.
     
    • Thank You! Thank You! x 1
  4. Lehmden
    • Team MediaPortal

    Lehmden Retired Team Member

    Joined:
    December 17, 2010
    Messages:
    11,776
    Likes Received:
    2,143
    Gender:
    Male
    Location:
    Lehmden
    Ratings:
    +3,600 / 28
    Home Country:
    Germany Germany
    Show System Specs
    Hi.
    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...
     
    • Thank You! Thank You! x 1
  5. Digsy

    Digsy Portal Pro

    Joined:
    August 29, 2018
    Messages:
    165
    Likes Received:
    11
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Great Britain (UK) Great Britain (UK)
    Show System Specs
    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: October 12, 2018
  6. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,519
    Likes Received:
    1,106
    Gender:
    Male
    Ratings:
    +2,375 / 21
    Home Country:
    Germany Germany
    Show System Specs
    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.
     
    • Agree Agree x 1
  7. Digsy

    Digsy Portal Pro

    Joined:
    August 29, 2018
    Messages:
    165
    Likes Received:
    11
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Great Britain (UK) Great Britain (UK)
    Show System Specs
    I'd like to investigate things a little bit further because it also affects my wired client, even if only very slightly.
     
  8. Digsy

    Digsy Portal Pro

    Joined:
    August 29, 2018
    Messages:
    165
    Likes Received:
    11
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Great Britain (UK) Great Britain (UK)
    Show System Specs
    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.
     

    Attached Files:

  9. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,519
    Likes Received:
    1,106
    Gender:
    Male
    Ratings:
    +2,375 / 21
    Home Country:
    Germany Germany
    Show System Specs
    @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: October 12, 2018
    • Thank You! Thank You! x 1
  10. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,519
    Likes Received:
    1,106
    Gender:
    Male
    Ratings:
    +2,375 / 21
    Home Country:
    Germany Germany
    Show System Specs
    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.
     
  11. Digsy

    Digsy Portal Pro

    Joined:
    August 29, 2018
    Messages:
    165
    Likes Received:
    11
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Great Britain (UK) Great Britain (UK)
    Show System Specs
    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: October 12, 2018
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!