New DVB subtitle filter (TsReader based) (1 Viewer)

tourettes

Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    The file was already available on the ftp: "DR1_3rd_subtitle.ts". The issue is a massive memory leak. When stopping the .ts memory usage increases by ~100 MB. No issues with plain TsReader. I tested the file on two machines running dvbsub2.ax and they both produce the leak.

    I tried to reproduce that leak but the memory usage stays at the same level compared to the time when the .ts file is started. Really odd as if it's caused by the DVBSub.ax then it should be reproduced every time on my dev PC also.

    Maybe it's timing related when did you press the stop? I tried different positions (and also let the MP play the complete file) but nothing did trigger the memory leak.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Just memory, and also the handle count seems to increase slightly with each .ts file being played (if that is important).

    As MP is a C# application the garbage collector might take a while to clean up the resource usage, so there could be small deviations with the MediaPortal memory usage after playing some file. But if you start & stop some file for example 20 times there shouldn't be big deviations in memory usage.

    The handle leak can be notised also when playing back .avi files. It's most likely something that is leaked on the MediaPortal side. I'll try to see if can what is leaking.
     

    pmcguire

    Portal Pro
    November 25, 2006
    213
    0
    51
    Home Country
    Finland Finland
    YLE in Finland are driving me in to an early grave, I yesterday recorded "The Serrano Family" while I was in work, machine woke up, recorded and the subs were in the recording. :D

    So far so good, did the same thing today with exactly the same config and the subs didn't record. :mad:
    Any ideas what could be causing this?
     

    Seidelin

    Retired Team Member
  • Premium Supporter
  • August 14, 2006
    1,755
    652
    Kgs. Lyngby
    Home Country
    Denmark Denmark
    I tried to reproduce that leak but the memory usage stays at the same level compared to the time when the .ts file is started. Really odd as if it's caused by the DVBSub.ax then it should be reproduced every time on my dev PC also.

    Maybe it's timing related when did you press the stop? I tried different positions (and also let the MP play the complete file) but nothing did trigger the memory leak.

    For some reason I cannot reproduce the leak right now, so I'll close down that bug (for now, but I'll keep an eye on to see if it pops up again). The only issue remaining as I see it (not counting TsReader bugs), is the delay after seeking. My post on first page has been updated accordingly.

    Regards
    Seidelin
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    YLE in Finland are driving me in to an early grave, I yesterday recorded "The Serrano Family" while I was in work, machine woke up, recorded and the subs were in the recording. :D

    So far so good, did the same thing today with exactly the same config and the subs didn't record. :mad:
    Any ideas what could be causing this?

    YLE is using dynamic subtitle PIDs (and sometimes audio also). Sometimes they seem to leave the subtitle PID active (software bug on their side?) and then the TVE3 is able to record subtitles correctly.

    here's some more info (and there is an experimental TsWriter.ax for the TVE3 that should solve the missing subtitles issue) https://forum.team-mediaportal.com/ts_recording_format_data_missing-t19316.html?p=170214#post170214
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I tried to reproduce that leak but the memory usage stays at the same level compared to the time when the .ts file is started. Really odd as if it's caused by the DVBSub.ax then it should be reproduced every time on my dev PC also.

    Maybe it's timing related when did you press the stop? I tried different positions (and also let the MP play the complete file) but nothing did trigger the memory leak.

    For some reason I cannot reproduce the leak right now, so I'll close down that bug (for now, but I'll keep an eye on to see if it pops up again). The only issue remaining as I see it (not counting TsReader bugs), is the delay after seeking. My post on first page has been updated accordingly.

    Could you confirm that the delay is approx 0.5 seconds long? I tested running VLC and MP side to side and after seeking the MP was displaying subtitles with a small delay.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    YLE in Finland are driving me in to an early grave, I yesterday recorded "The Serrano Family" while I was in work, machine woke up, recorded and the subs were in the recording. :D

    So far so good, did the same thing today with exactly the same config and the subs didn't record. :mad:
    Any ideas what could be causing this?

    YLE is using dynamic subtitle PIDs (and sometimes audio also). Sometimes they seem to leave the subtitle PID active (software bug on their side?) and then the TVE3 is able to record subtitles correctly.

    here's some more info (and there is an experimental TsWriter.ax for the TVE3 that should solve the missing subtitles issue) https://forum.team-mediaportal.com/ts_recording_format_data_missing-t19316.html?p=170214#post170214

    hmm... to me it looks like the seeking is not needed. Looks like the subtitles are always 0.0 - 0.5 second late compared to VLC output. Dunno what is causing it as subtitle filter at least thinks that no subtitles were received late. Maybe there is a slight delay when subtitle is received on MP side and that's visible to the user then. I'll try to optimize the subtitle TS sample delivery from the TsReader to the DVB Subfilter. Currently it's done by using 188 byte long TS packets, but it would be more optimal to transfer bigger samples (only one sample per PES packet)...
     

    Seidelin

    Retired Team Member
  • Premium Supporter
  • August 14, 2006
    1,755
    652
    Kgs. Lyngby
    Home Country
    Denmark Denmark
    hmm... to me it looks like the seeking is not needed. Looks like the subtitles are always 0.0 - 0.5 second late compared to VLC output. Dunno what is causing it as subtitle filter at least thinks that no subtitles were received late. Maybe there is a slight delay when subtitle is received on MP side and that's visible to the user then. I'll try to optimize the subtitle TS sample delivery from the TsReader to the DVB Subfilter. Currently it's done by using 188 byte long TS packets, but it would be more optimal to transfer bigger samples (only one sample per PES packet)...

    I have made a screen capture using hypercam2 (i-loop used it to make tve3 installation instructions). I captured playback of a test video using 3 scenarios (using xvid realtime compression) :

    1: Playback from start no seeking. No pausing. -> No delay
    2: Seeking back to start -> subs are delayed ~0.4s
    3: Restart playback and pause. Subtitles are delayed about the same after a pause.

    I used VirtualDub to analyze the videos. I have made a .doc containing screenshots of first subtitled frame (framerate of capture is only 10 fps, so forgive minor differences - not major between scenarios.)

    Video and .pdf containing preliminary analysis attached. Let me know if you want me to accurately determine more exact delays.

    Regards
    Seidelin
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I tried to reproduce that leak but the memory usage stays at the same level compared to the time when the .ts file is started. Really odd as if it's caused by the DVBSub.ax then it should be reproduced every time on my dev PC also.

    Maybe it's timing related when did you press the stop? I tried different positions (and also let the MP play the complete file) but nothing did trigger the memory leak.

    For some reason I cannot reproduce the leak right now, so I'll close down that bug (for now, but I'll keep an eye on to see if it pops up again). The only issue remaining as I see it (not counting TsReader bugs), is the delay after seeking. My post on first page has been updated accordingly.

    Could you test the subtitle delay issue (after pause & seeking) with following MP core.dll?
     

    Users who are viewing this thread

    Top Bottom