Jump to content

DVBViewer playback time is approximate when playing .TS files


Carlos T.

Recommended Posts

Posted

Unfortunately, the playback time reported by DVBViewer when playing .TS files, and therefore the value returned by the #currentplaytime property, does not appear to be exact but only approximate. From what I have read in the forum, this may be related to VBR recordings.

It is a pity that the playback time is not fully accurate. I am currently developing a small VBS script that adds commercial-skipping functionality using EDL files generated by Comskip. The prototype is fully operational, but during testing I noticed that the skip points did not align correctly with the commercial breaks. At first, I thought the issue was caused by Comskip, but after validating the same EDL files with other applications such as VLC and Kodi, it seems that the discrepancy originates from DVBViewer.

To verify this, you can simply start playing any recording and compare DVBViewer's playback time with the Windows Stopwatch. After a short period, a growing time offset becomes noticeable.

This is unfortunate because, if the reported playback time is not accurate, reliable support for EDL-based commercial skipping will be very difficult to achieve.

I hope this thread is not taken the wrong way. DVBViewer is a fantastic piece of software that I have been using for many years, and my intention with this post is simply to help improve it if possible.

 

image.thumb.jpeg.47c0747b97059d196a9e19a3dcad2cf6.jpeg

Posted

After reviewing all the options and with some help from chatgpt, I've found a way to track time accurately. You have to uncheck this option in .ts. Sorry for the inconvenience.

 

image.thumb.png.bc1ae6779dd99396e4392cf6f4cfab8f.png

Posted
vor 11 Stunden schrieb Carlos T.:

After a short period, a growing time offset becomes noticeable.

 

If the DVBViewer Filter is used, DVBViewer simply calculates an average data rate = file size / file duration and henceforth uses it for calculating the time position = file position / average rate, or file position = desired time position * average rate. The result is not accurate in case of a variable (video) data rate, of course. This particularly causes problems if there are external .srt subtitles that have to by synced with video/audio playback. Maybe there will be a better solution in future...

 

vor 7 Stunden schrieb Carlos T.:

You have to uncheck this option in .ts

 

That's the way to go. It lets DVBViewer use another Source Filter / Splitter for .ts file playback. Recommended: LAV Filters, so the LAV Source Filter can be used.

 

Please note that this setting does not apply to live playback and ongoing recordings / timeshift, because third party DirectShow source filters are usually not able to handle growing files correctly. Additionally, they don't support detecting / reading EPG data or Teletext / TTML / WebVTT subtitles  embedded in TS files. TTML subtitles are frequently used for MPEG Dash streams, WebVTT subtitles for HLS.

 

  • Like 1
  • Thanks 1
Posted

P.S. I just found out that it's quite easy to let DVBViewer display/report the correct time position, at least for .mpg and .ts files. I've already done this several years ago in the TSPlayer (see Download Area -> Tools). It only requires DVBViewer to find and remember the first Audio PTS (Presentation Time Stamp) or PCR (Program Clock Reference) in the file - this is done anyway for calculating the accurate file duration = last PTS - first PTS. All that is left to do during playback is querying the DVBViewer Filter, that monitors PTS and PCR values, repeatedly for the current PTS, yielding the current time position = current PTS - first PTS. There are some pitfalls that have to be considered, e.g. that time stamps may wrap around to zero or may be corrupted, but in general it works quite nicely.

 

However, the hard part is to set the file position to an accurate time position, because that means searching a certain PTS in the file. In the TSPlayer you can see, that it displays the inaccurate time position while the position slider is dragged, but the display jumps to the accurate position as soon as you stop seeking. Ask the Google AI for

 

"how can a certain time position be found efficiently in a TS file"

 

and you will see. It requires quite some efforts and reading forth and back in the file, which is very slow, even when you are using a binary search. The LAV Source Filter is doing it this way (by using the FFmpeg binary search). The inaccurate, but simple algorithm used with the DVBViewer Filter is much faster. You can see it when dragging the control bar slider during playback. With the DVBViewer filter the displayed still video frames follow the slider position more or less immediately. With the LAV Source Filter it is quite sluggish.

 

Everything has its pros and cons...

 

  • Like 2
Posted
Am 25.11.2026 um 12:38 schrieb Griga:

However, the hard part is to set the file position to an accurate time position, because that means searching a certain PTS in the file.

 

A solution without losing speed when seeking would be an index created by the DVBViewer recorder in an extra file, or with other words, a lookup table that assigns time positions to file positions. However, this would only work with original DVBViewer recordings, not with TS and MPG files from other sources, and not with DVBViewer recordings after they have been cut/reworked. Making this work would require a tool that is able to create an index file in the format expected by DVBViewer later. For this it would have to read and process the whole TS/MPG file.

 

The Google AI explains more if you search for "transport stream files with index file". 

 

Anyway, the next DVBViewer Version will at least be able to display/report accurate time positions when using the DVBViewer Filter for TS/MPG playback. This should also solve the sync problem with TS plus external SRT subtitle files. 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...