[Approved] Fix for stuttering/corrupted streaming of live tv (1 Viewer)

disaster123

MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Fix for stuttering/corrupted streaming of live tv

    What is about a sleep 10-50ms and then a retry 5 or 10 times? If it detects EOF?
     

    micko

    Portal Pro
    May 27, 2006
    258
    51
    Home Country
    Finland Finland
    Lately I have noticed stuttering when streaming (RTSP) over network even with SD material. Local (singleseat) client can play live and recorded tv fluidly, but on remote clients there is sometimes quite bad stuttering and discontinuities. I shared that recording folder and I can play those ts-files (in myVideos) over network without any problems. Stuttering happens only when same videos are played in TV section.

    Tested binaries shared here and there is some improvement, but there could be some other problems too.

    This might not be the right place to ask, but thinking you guys have experience with this thing and you might have something on your mind already.. meaning what I can check next?
     

    miroslav22

    Development Group Member
  • Premium Supporter
  • September 4, 2009
    703
    460
    Warwick
    Home Country
    United Kingdom United Kingdom
    I have attached the version 2 patch and binaries to the first post for anyone who would like to test this.

    Thanks for all the testing and feedback so far.
     

    DJBlu

    Portal Pro
    August 14, 2007
    1,670
    813
    Llanelli
    Home Country
    United Kingdom United Kingdom
    I have attached the version 2 patch and binaries to the first post for anyone who would like to test this.

    Thanks for all the testing and feedback so far.

    Thanks m8,

    will test it later.

    P.S. Looking for a little help on the Sky Thread if you can help.
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    I have attached the version 2 patch and binaries to the first post for anyone who would like to test this.

    Thanks for all the testing and feedback so far.

    Are the binaries compiled for latest SVN?
    If not, could you provide then? I only need .ax (DirectShowFilters) binaries.. :)
     

    Mr Hipp

    Retired Team Member
  • Premium Supporter
  • April 2, 2006
    1,261
    188
    56
    Malmö
    Home Country
    Sweden Sweden
    In version 2 I see that you have decided to use two buffer sizes 10 & 172.
    I think a better solution would be to adapt the #of buffers to the bitrate, so the playback time keept in the buffers are constant i.e low bitrate - low # of buffers, high bitrate - high # of buffers. A easy solution to this would be to measure the bitrate and calcuate # of buffers.

    void CDiskRecorder::Write(byte* buffer,int len)
    {
    ...
    if(m_MyPacketCounter == 0)
    m_iFirstPacketGetTime = timeGetTime();
    else if (m_MyPacketCounter == 10000) // calc after 10000 packets
    {
    DWORD now = timeGetTime();
    unsigned int bytesPerMsSec;
    unsigned int bufferSize;
    // Handle wrap
    if(now > m_iFirstPacketGetTime)
    bytesPerMsSec = (10000*188)/(now-m_iFirstPacketGetTime);
    else
    bytesPerMsSec = (10000*188)/(m_iFirstPacketGetTime-now);
    // Arbitary scaling
    bufferSize = bytesPerMsSec/25;

    if (bufferSize<10)
    m_iBufferSize=10*188;
    else if(bufferSize>100)
    m_iBufferSize = 100*188;
    else
    m_iBufferSize = bufferSize*188;
    }
    m_MyPacketCounter++;
    }

    A side benifit would be that the patch would not be so intrusive.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    A side benifit would be that the patch would not be so intrusive.

    It wouldn't require as much changes since radio and tv would be handled the same way. No need to pass the radio/tv information from C# side.

    I smell a debug setting for the:

    Code:
    bufferSize = bytesPerMsSec/25;

    ...it would help people to troubleshoot issues (TsReader input drying on some PCs, old HDDs not keeping up with small buffer size on multiple simultaneous recordings).
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Re: Fix for stuttering/corrupted streaming of live tv

    I have attached the version 2 patch and binaries to the first post for anyone who would like to test this.

    Thanks for all the testing and feedback so far.

    thanks! But could you perhaps tell us / me what are the differences to the 1st version?
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Re: AW: Re: Fix for stuttering/corrupted streaming of live tv

    I have attached the version 2 patch and binaries to the first post for anyone who would like to test this.

    Thanks for all the testing and feedback so far.

    thanks! But could you perhaps tell us / me what are the differences to the 1st version?

    Look at first post :)
     

    Users who are viewing this thread

    Top Bottom