|
SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Fix for bad timelines in MPEG recordings
This is probably one of the only things left in SageTV that can totally piss me off and completely ruin my day. It's when you try to playback a recording and you realize the timeline is either stuck at zero, the end of the file or it increments at some bizarre rate that does not match reality. Then of course if you try to skip...it'll just end, go back to the beginning or completely ruin the game by showing you the 4th quarter score even though just skipped 15 seconds into it.
These files work fine if you just start them and ignore the timeline and don't try to skip...but what's the fun in that? It really annoys me when I forget I'm watching one of these problems and then out of habit at a commercial, I grab the remote and hit skip only to be reset back to the beginning (I can't count how many times I've pissed off the wife trying to navigate around one of these recordings). Well, I've just posted a fix (not ideal, but it gets the job done) to GitHub for this! This problem happens generally due to bad commercial insertions by cable providers where they do not readjust the PTS values in the MPEG packets so that the timeline isn't increasing throughout the entire recording. The solution is to just completely ignore the PTS values for purpose of showing the timeline in the UI and for executing seek operations (it just assumes the file is constant bitrate, and uses byte positions instead...not very accurate...but way better than the crap you deal with otherwise). Anyhoo...here's the commit I just posted to GitHub: https://github.com/google/sagetv/com...b7f2671d4da6f0 And here's the details of the commit which give you all the other details you are likely interested in. Byte based seeking support for MPEG files This helps to resolve a long standing issue where files that have bad PTS timelines cause the playback time to jump wildly and infuriate you when you try to skip around them. What it does is detect when the parser's calculated duration for a file that is being played back (extender only, no transcoding) is different by a decent amount (25%) from that of what SageTV thinks the recorded duration should be. Then it uses the read file position to estimate the current playback time and then for seeking, it guesses the proper file position as if the file were constant bitrate. This works WAY better than being stuck without the ability to seek or even know what time you are at in the file. This feature is off by default, and it can be enabled by setting this in your Sage.properties file: disable_byte_based_seek_check=false This does NOT work on files that are currently recording. This does NOT allow you to fast forward or rewind properly in files like this, only seek. You CAN force this to work for currently recording files by setting this property in the properties file for the extender you want it to work on: force_byte_based_seeking=true (this is so if you're recording something you really want to watch right now that has this issue, you can turn off the extender, edit the properties file and then it'll make it happen...don't forget to reset that property later). This is somewhat inaccurate, but that's what you get with byte-based time estimation.
__________________
Jeffrey Kardatzke Founder of SageTV |
#2
|
||||
|
||||
And after more people have tried this out and think it's OK then I'll rename the property setting that controls this feature to something else that's actually ON by default rather than OFF. Currently this feature is off by default.
__________________
Jeffrey Kardatzke Founder of SageTV |
#3
|
|||
|
|||
Hey Narflex,
Is this the same issue that people had with R5000 recordings years ago when playing back on the HD300? Occasionally the file timestamps would be wonky, and once a certain point of the file was reached things would start to jump around (during playback as well, not just seeking). The fix for this at the time was to run the recordings through Videoredo's Quickstream Fix to fix all the timestamps. I remember actually burning some of these recordings to a DVD and mailing them down to SageTV in California to test (this was right before the Google buyout). I don't have an R5000 any longer so I won't be able to test this though Just funny if this is actually fixed after all these years. Edit: Here is one of the old threads about this problem: https://forums.sagetv.com/forums/showthread.php?t=51645 Last edited by peternm22; 01-09-2018 at 07:08 PM. |
#4
|
|||
|
|||
Awesome, thanks for fixing this Jeff.
On a related note, how does the original show recording date/time matter for the timeline? I have a process that uses Handbarke to re-encode files. I found that with some files that timeline got screwed up. This was fixed when I changed the date/time created stamp of the reencoded file to be the same as the original file. Here is that the thread that discusses that issue. https://forums.sagetv.com/forums/showthread.php?t=59800 Presumably this fix will also work with that issue, will it not?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#5
|
||||
|
||||
Some of my recordings have timelines that start at -60 minutes. Will it fix that issue too?
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#6
|
|||
|
|||
Interesting. I've not figured out what causes it but I've had a problem where all of a sudden at the same point in the recording doing a smooth FF or REW on my media extenders will cause a large seek jump.
I've also had a problem where after performing a smooth FF the playback all of a sudden starts freezing and jumping during playback and then the audio starts losing sync. I've "fixed" this by using the 10 second jump rather than smooth FF.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3 Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD |
#7
|
||||
|
||||
Quote:
It's very possible it will fix it. I don't recall ever seeing that happen myself, but it's worth a try.
__________________
Jeffrey Kardatzke Founder of SageTV |
#8
|
||||
|
||||
I also have what appear to be good recordings, but when I try and export / edit them in VideoReDo, the program crashes out. Their tech support thinks it may have something do with the black frames at the transition having a really low bitrate - is it possible this is caused by the same thing you’re concerned with?
__________________
Sage 9 server = Gigabyte AMD quad-core - 4 gigs - integrated ATI HD4200 chipset - SSD boot, Hitachi Deskstar show drives. HD-PVR - Colossus - Win7 32 bit. HD200/300’s networked. HDHomerun tuner. "If you've given up on Weird Al, you've given up on life" - Homer Simpson Last edited by tvmaster2; 01-10-2018 at 02:48 PM. |
#9
|
|||
|
|||
Very nice!
Will this negatively affect comskip in anyway since it relies on the time-stamps created during its scan? Or would comskip already be compromised be the bad PTS timeline so it's a moot point? |
#10
|
||||
|
||||
Quote:
Assuming comskip was able to process the file properly, it should work fine with it...with the exception that seeking isn't as accurate with this technique so you'll likely not land right on the boundaries like you'd expect. This was especially noticeable for cartoon content where the bitrate during the show was much lower than that of the commercials (so doing constant bitrate estimation for timeline purposes yielded results that were off by a decent amount).
__________________
Jeffrey Kardatzke Founder of SageTV |
#11
|
||||
|
||||
Quote:
Thanks again /jer
__________________
AMD Ryzen 7 1700 w/ SageTV Server Linux V9.1.8.774 - Ubuntu 16.04LTS AMD64 -- 1x HDHomeRun Prime -- 1x HDHR-DT -- 1x HD-PVR 2x SageTV HD-300 Media Extenders 1x NVIDIA ShieldTV |
#12
|
||||
|
||||
About the constant bitrate assumption. Is there no way to ensure a file with any variable bit-rate streams doesn't get this fix applied or do you suspect that will not be a problem for the few times it could happen? I know most broadcast is not variable, but I'm just throwing it out there.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache). Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI. Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom). Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG |
#13
|
||||
|
||||
Quote:
__________________
Jeffrey Kardatzke Founder of SageTV |
#14
|
||||
|
||||
Quote:
i always wondered why that happened but it was never common enough to moan about
__________________
Q: dad, when will you stop changing all the electronics? A: never, so you might as well get used to it. |
#15
|
||||
|
||||
This problem is similar to what I am experiencing for the last couple weeks. I do not have the erratic skip or ff rew issue. After the recording I try to watch it and it is at the end already and dumps me back to the recorded shows menu. I figured out if I did not select Watch Now, but highlighted the show and pressed play while simultaneously hold down the Skip Back button I could then go all the way to the beginning of the show and it works fine from there, skipping works without issue. Still has 1/2 the bar red and the first half green (see screen shots in other thread)
I had a couple more shows record just like that last night too. I included some screen shots of the show detail and they look odd, the Aired on and Recording from times Don't match.. they are 1 hour 1 minute off. And its not one of those shows that starts early or ends late. Please look at this thread and my screen shots. https://forums.sagetv.com/forums/showthread.php?t=65445
__________________
Home DVR: SageTV v9.2.6(64) i7-6700 3.4ghz, 8GB RAM, Win10 Pro, 1@ SSD +1@6TB WD Blue, 1 Quad HDHR, ( OTA Winegard HD8200U, CM4221HD), 1@ STP-HD200, 1@ Nvidia Shield , 1 @ Nvidia Shield new round version, 70" & 55" Sony's RV DVR: 2@SageTV v9.2.6, NUC8i5BEK 16GB, SS980Pro NVMe, 5TB Passport, 1@olderNUC, 2 Dual HDHR, , Winegard BatWing, 40", 32", 28" Sony's, Max Transit |
#16
|
||||
|
||||
That looks like a different problem...I replied in that thread.
__________________
Jeffrey Kardatzke Founder of SageTV |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VideoRedo & Sage Timelines | graywolf | General Discussion | 3 | 02-19-2012 12:34 PM |
Tinelines, timelines, timelines... | Polypro | SageTV Beta Test Software | 3 | 09-13-2007 10:17 PM |
recordings timelines' get messed up | JonTom | SageTV Software | 26 | 01-30-2007 04:46 PM |
timelines (?) in some files are wrong... | JonTom | SageTV Software | 1 | 01-22-2006 12:03 PM |
Currupt MPEG Recordings | Muchacho | SageTV Software | 1 | 08-30-2004 06:52 PM |