Make backup of recording before rewriting video timestamps

At least that way we have the original recording.
My 45 minute recording got rewritten to 2 minutes.

2025/01/09 09:30:00.000943 [DVR] Starting job 1736443800-ch6085 The Andy Griffith Show on ch=[6085]
2025/01/09 09:30:13.540923 [TVE] stream timestamps: sundance: start_at=2025-01-09T09:29:44-08:00 end_at=2025-01-09T09:29:50-08:00 live_delay=17.424920058s
2025/01/09 09:30:13.541098 [TNR] Opened connection to TVE-Comcast_SSO for ch6085 SUNDANCE
2025/01/09 09:30:13.541963 [DVR] Recording for job 1736443800-ch6085 from TVE-Comcast_SSO ch6085 into "TV/The Andy Griffith Show/The Andy Griffith Show S02E28 1962-04-16 The Bookie Barber 2025-01-09-0930.mpg" for 44m59.998914059s
2025/01/09 10:15:17.430236 [TNR] Closed connection to TVE-Comcast_SSO for ch6085 SUNDANCE
2025/01/09 10:15:17.510425 [SNR] Buffer statistics for "TV/The Andy Griffith Show/The Andy Griffith Show S02E28 1962-04-16 The Bookie Barber 2025-01-09-0930.mpg": buf=0% drop=0%
2025/01/09 10:15:17.510495 [SNR] Streaming statistics for "TV/The Andy Griffith Show/The Andy Griffith Show S02E28 1962-04-16 The Bookie Barber 2025-01-09-0930.mpg": timeouts=0 segment_timeouts=0 playlist_timeouts=0
2025/01/09 10:15:17.616757 [MTS] Statistics for "TV/The Andy Griffith Show/The Andy Griffith Show S02E28 1962-04-16 The Bookie Barber 2025-01-09-0930.mpg": discontinuity_detected=140 transport_errors=0 saw_pcr=true saw_pmt=true highest_pts=94167.233289
------------------------> highest_pts=94167.233289 (26:09:27.233289)
2025/01/09 10:15:17.629548 [DVR] Finished job 1736443800-ch6085 The Andy Griffith Show
2025/01/09 10:15:17.854445 [DVR] Processing file-1006: TV/The Andy Griffith Show/The Andy Griffith Show S02E28 1962-04-16 The Bookie Barber 2025-01-09-0930.mpg
2025/01/09 10:15:18.455754 [MTS] Rewriting video timestamps for file-1006: The Andy Griffith Show S02E28 1962-04-16 The Bookie Barber 2025-01-09-0930.mpg
2025/01/09 10:16:31.535559 [MTS] Statistics for #1006 "The Andy Griffith Show S02E28 1962-04-16 The Bookie Barber 2025-01-09-0930.mpg": unhandled_packets=45576 discontinuity_detected=91081 transport_errors=0 saw_pcr=true saw_pmt=true highest_pts=286.992333
------------------------> highest_pts=286.992333 (00:04:46.992333) is actually 137.27 seconds (00:02:17.27)
2025/01/09 10:16:31.810297 [MTS] Finished rewriting video timestamps for file-1006 in 73s
2025/01/09 10:16:32.512173 [IDX] Generating video index for file-1006: TV/The Andy Griffith Show/The Andy Griffith Show S02E28 1962-04-16 The Bookie Barber 2025-01-09-0930.mpg
2025/01/09 10:16:42.100198 [IDX] Finished video index generation for file-1006 in 9s

I might have been able to rescue the original by remuxing with ffmpeg or using my video editor.

2 Likes

I remuxed the recording (of course after Channels rewrote timestamps) using
ffmpeg -i recordedfilename.mpg recordedfilename.ts
and it removed hundreds of continuity error and corrected the duration from 2:17 to 45:27. The closed captions display, but the audio is messed up and plays at a slower frame rate. Sounds like half speed.

After Channels rewrote timestamps

After Channels rewrote timestamps and I remuxed with ffmpeg

What triggered rewriting timestamps for you? Mine doesn't do that when a recording ends.

According to the developers Do we know why it's rewriting timestamps - #2 by eric

The log shows that for my 45 minute (2700 second) recording, the ending PTS (Presentation Time Stamp) highest_pts was 26 hours (94167 seconds). That's what the duration would have appeared as, which is more than twice the recording time of 45 minutes.

How most players, including Channels, determine the duration of a video is to subtract the first PTS in the stream from the last PTS in the stream. PTS is displayed as the playhead position on the video player timeline.