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

Digsy

Portal Pro
August 29, 2018
191
19
50
Great Britain (UK) Great Britain (UK)
Country flag
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,431
    2,334
    Germany Germany
    Country flag
    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,209
    3,728
    Lehmden
    Germany Germany
    Country flag
    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
    191
    19
    50
    Great Britain (UK) Great Britain (UK)
    Country flag
    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,431
    2,334
    Germany Germany
    Country flag
    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
    191
    19
    50
    Great Britain (UK) Great Britain (UK)
    Country flag
    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
    191
    19
    50
    Great Britain (UK) Great Britain (UK)
    Country flag
    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

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,431
    2,334
    Germany Germany
    Country flag
    @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,431
    2,334
    Germany Germany
    Country flag
    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
    191
    19
    50
    Great Britain (UK) Great Britain (UK)
    Country flag
    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

    Similar threads
    OP Title Forum Replies Date
    Stephen O'Kane [SOLVED] TV Stream stuttering - both Video and Audio Watch / Listen Media 14
    B some music videos stutter Watch / Listen Media 0
    I Video Playback Stuttering General Support 45
    limpwhizkid 1.22.0 Stutter and or artifact problem when recording and watching the same live tv channel 1.22 2
    P [solved] Analog FM Radio stutter General 11
    W Playback stuttering after upgrade from MP1 on Windows 7 to MP2 on Windows 10 General 2
    AberDino 4k TV Stutter with RTSP General Support 7
    bta489 [solved] Stuttering playback of edited recordings watch/edit Videos 2
    M VPN: Mediaportal TV-Server ist not using all available bandwidth which results in TV stuttering Newcomers Forum 0
    Stephen O'Kane MP1.20 - Stuttering Recordings (EXP-Upgrage_555_MM_Owlsroost) Watch / Listen Media 1
    P 1.26.0 Can't play blu-ray disc Bugreports 1
    doskabouter 1.26.0 Codec question (unable to play video, lv50 codec) Codecs, External Players 24
    W 1.25.0 Blu-ray disks that used to play are no longer playing Watch / Listen Media 2
    joecrow [solved] DVD won't play properly. General Support 7
    M.Hulot MP plays in Internal Blu-ray-Player-mode always first audio stream not the one I chosen in settings General Support 1
    BrownGhost Mepo/MediaInfo takes 59 secunds to open library and start play :o( General Support 26
    I 1.25.0 Videos in HEVC UHD 2160p don't play good watch/edit Videos 8
    CanadianEh MP TV server rebuild with Colossus 2 - Kodi clients receive PMT error when playing videos recoreded by Colossus 2 TV-Server 2
    M [solved] WTV Files does not play on client, MPEG files works well General 1
    A [solved] How to Play All Videos in a List watch/edit Videos 3
    horned_reaper [solved] When playing music Fanart does not shuffle Fanart Handler 20
    horned_reaper [solved] No Fanart when playing Fanart Handler 115
    horned_reaper [solved] When playing music Fanart does not appear immediately after downloading Fanart Handler 272
    B MP 2.2.3 Error playing videos from NAS Submit: Bug Reports 2
    N Play a TV recording needs a double selection - twice ok on remote Television (MyTV frontend and TV-Server) 2

    Similar threads

    Top Bottom