Cut Lists - first and last cut points are not always explicitly defined, and cuts are ignored
Miwer opened this issue · comments
When using cut lists, MythTV addon ignores the first and last cut, if using the mythfrontend features "Cut to Beginning" and "Cut to End", in order to cut out excess content before and after the actual show.
Notice in the screenshots, that the first and last cut marks are not explicitly defined, and no entries for these implicit cut points are created in the database, nor returned by the API.
Normal mythfrontend behavior is, that if the first cutpoint is type 0 (MARK_CUT_END), it is to be assumed, that the section from start till that point, is to be cut out (implicit MARK_CUT_START at the start of recording).
Same reversed logic, if the last cut point is type 1 (MARK_CUT_START), assume that the rest of the recording is to be cut out.
Perhaps same logic can be safely assumed for the Commercial Breaks, but I don't know for sure.
Take these two examples below:
Cut List with first and last marker not defined (i.e. "Cut to Beginning" and "Cut to End" in mythfrontend).
Only 10 cut list entries - notice that the first entry from the API is a "0" type (MARK_CUT_END), and the last is a "1" (MARK_CUT_START).
First and last cut point is implicitly defined as the start and end of the recording (mythfrontend behavior), but MythTV addon ignores these.
00:52:27.857 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)SendRequest: GET /Dvr/GetRecordedCutList?RecordedId=1918&OffsetType=Duration HTTP/1.1M
Host: mythserver.miwers.home:6544M
User-Agent: libcppmyth/2.0M
Connection: closeM
Accept: application/jsonM
Accept-Charset: utf-8M
Accept-Encoding: gzip, deflate
00:52:27.869 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: HTTP/1.1 200 OK
00:52:27.869 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Accept-Ranges: bytes
00:52:27.869 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Cache-Control: no-cache="Ext", max-age = 7200
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Connection: Close
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Content-Encoding: gzip
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Content-Language: en-us
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Content-Length: 147
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Content-Type: application/json
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Date: Tue, 25 Dec 2018 23:52:27 GMT
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: ETag: "18099cced13c9b1a48c060b54a7be823dcedc688"
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Server: MythTV/29.1 Linux/4.19.8-041908-generic UPnP/1.0
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: transferMode.dlna.org: Interactive
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse:
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)Document: {"CutList": {"Cuttings": [{"Mark": "0", "Offset": "180080"},{"Mark": "1", "Offset": "1241520"},{"Mark": "0", "Offset"
: "1740320"},{"Mark": "1", "Offset": "2674240"},{"Mark": "0", "Offset": "3173040"},{"Mark": "1", "Offset": "4193680"},{"Mark": "0", "Offset": "4692560"},{"Mark": "1", "Offset": "5983200"},{"Mark": "0"
, "Offset": "6497640"},{"Mark": "1", "Offset": "7554800"}]}}
00:52:27.870 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetRecordedCutList6_1: content parsed
00:52:27.871 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 10 cut list entries for: Frost
------------------ snip -------------------
00:52:30.363 T:4092572448 DEBUG: Previous line repeats 7 times.
00:52:30.363 T:4092572448 DEBUG: ------ Window Deinit (DialogConfirm.xml) ------
00:52:30.364 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 1241.520 - 1740.320
00:52:30.364 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 2674.240 - 3173.040
00:52:30.364 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 4193.680 - 4692.560
00:52:30.364 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 5983.200 - 6497.640
00:52:30.364 T:3425932144 DEBUG: AddCut - Pushing new cut to back [00:20:41.520 - 00:29:00.320], 0
00:52:30.364 T:3425932144 DEBUG: ReadPvr - Added break [00:20:41.520 - 00:29:00.320] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
00:52:30.364 T:3425932144 DEBUG: AddCut - Pushing new cut to back [00:44:34.240 - 00:52:53.040], 0
00:52:30.364 T:3425932144 DEBUG: ReadPvr - Added break [00:44:34.240 - 00:52:53.040] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
00:52:30.364 T:3425932144 DEBUG: AddCut - Pushing new cut to back [01:09:53.680 - 01:18:12.560], 0
00:52:30.364 T:3425932144 DEBUG: ReadPvr - Added break [01:09:53.680 - 01:18:12.560] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
00:52:30.364 T:3425932144 DEBUG: AddCut - Pushing new cut to back [01:39:43.200 - 01:48:17.640], 0
00:52:30.365 T:3425932144 DEBUG: ReadPvr - Added break [01:39:43.200 - 01:48:17.640] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
00:52:30.365 T:3425932144 NOTICE: Opening stream: 1 source: 256
00:52:30.365 T:3425932144 DEBUG: CVideoPlayer::HandleMessages - player 2 reported state: 0
00:52:30.365 T:4092572448 DEBUG: FreeVisualisation() started
00:52:30.366 T:4092572448 DEBUG: FreeVisualisation() done
00:52:30.366 T:3425932144 DEBUG: CVideoPlayer::ProcessVideoData size:197288 dts:2.024 pts:2.064 dur:40.000ms, clock:1.564 level:0
00:52:30.366 T:3517965168 INFO: CVideoPlayerVideo - Stillframe left, switching to normal playback
Same recording with Cut List modified, and first and last cut point is explicitly defined near the start and end of the recording.
Now with 12 cut points, as you'd normally expect, and first and last cut is included by MythTV addon.
01:14:14.425 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)SendRequest: GET /Dvr/GetRecordedCutList?RecordedId=1918&OffsetType=Duration HTTP/1.1M
Host: mythserver.miwers.home:6544M
User-Agent: libcppmyth/2.0M
Connection: closeM
Accept: application/jsonM
Accept-Charset: utf-8M
Accept-Encoding: gzip, deflate
01:14:14.437 T:3517965168 DEBUG: CVideoPlayerVideo - video decoder returned error
01:14:14.437 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: HTTP/1.1 200 OK
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Accept-Ranges: bytes
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Cache-Control: no-cache="Ext", max-age = 7200
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Connection: Close
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Content-Encoding: gzip
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Content-Language: en-us
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Content-Length: 153
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Content-Type: application/json
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Date: Wed, 26 Dec 2018 00:14:14 GMT
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: ETag: "d20d5e499b6e4b2788be3eb63306143a02f99874"
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: Server: MythTV/29.1 Linux/4.19.8-041908-generic UPnP/1.0
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse: transferMode.dlna.org: Interactive
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetResponse:
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)Document: {"CutList": {"Cuttings": [{"Mark": "1", "Offset": "1240"},{"Mark": "0", "Offset": "180080"},{"Mark": "1", "Offset": "
1241520"},{"Mark": "0", "Offset": "1740320"},{"Mark": "1", "Offset": "2674240"},{"Mark": "0", "Offset": "3173040"},{"Mark": "1", "Offset": "4193680"},{"Mark": "0", "Offset": "4692560"},{"Mark": "1", "
Offset": "5983200"},{"Mark": "0", "Offset": "6497640"},{"Mark": "1", "Offset": "7554800"},{"Mark": "0", "Offset": "7795880"}]}}
01:14:14.438 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)GetRecordedCutList6_1: content parsed
01:14:14.439 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 12 cut list entries for: Frost
------------------ snip -------------------
01:14:15.822 T:4092572448 DEBUG: Previous line repeats 8 times.
01:14:15.822 T:4092572448 DEBUG: ------ Window Deinit (DialogConfirm.xml) ------
01:14:15.823 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 1.240 - 180.080
01:14:15.823 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 1241.520 - 1740.320
01:14:15.823 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 2674.240 - 3173.040
01:14:15.823 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 4193.680 - 4692.560
01:14:15.823 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 5983.200 - 6497.640
01:14:15.823 T:3425932144 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 7554.800 - 7795.880
01:14:15.823 T:3425932144 DEBUG: AddCut - Pushing new cut to back [00:00:01.240 - 00:03:00.080], 0
01:14:15.823 T:3425932144 DEBUG: ReadPvr - Added break [00:00:01.240 - 00:03:00.080] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
01:14:15.823 T:3425932144 DEBUG: AddCut - Pushing new cut to back [00:20:41.520 - 00:29:00.320], 0
01:14:15.824 T:3425932144 DEBUG: ReadPvr - Added break [00:20:41.520 - 00:29:00.320] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
01:14:15.824 T:3425932144 DEBUG: AddCut - Pushing new cut to back [00:44:34.240 - 00:52:53.040], 0
01:14:15.824 T:3425932144 DEBUG: ReadPvr - Added break [00:44:34.240 - 00:52:53.040] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
01:14:15.824 T:3425932144 DEBUG: AddCut - Pushing new cut to back [01:09:53.680 - 01:18:12.560], 0
01:14:15.824 T:3425932144 DEBUG: ReadPvr - Added break [01:09:53.680 - 01:18:12.560] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
01:14:15.824 T:3425932144 DEBUG: AddCut - Pushing new cut to back [01:39:43.200 - 01:48:17.640], 0
01:14:15.824 T:3425932144 DEBUG: ReadPvr - Added break [01:39:43.200 - 01:48:17.640] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
01:14:15.824 T:3425932144 DEBUG: AddCut - Pushing new cut to back [02:05:54.800 - 02:09:55.880], 0
01:14:15.824 T:3425932144 DEBUG: ReadPvr - Added break [02:05:54.800 - 02:09:55.880] found in PVRRecording for: pvr://recordings/tv/active/Frost/Frost (2013), TV%20(Kanal5), 20181215_175000, 1005_15
44896200_77e.pvr.
01:14:15.824 T:3517965168 DEBUG: CVideoPlayerVideo - video decoder returned error
01:14:15.825 T:3425932144 NOTICE: Opening stream: 1 source: 256
01:14:15.825 T:3425932144 DEBUG: CVideoPlayer::HandleMessages - player 2 reported state: 0
01:14:15.826 T:3425932144 DEBUG: CVideoPlayer::ProcessVideoData size:210721 dts:0.784 pts:0.944 dur:40.000ms, clock:0.444 level:0
01:14:15.826 T:3517965168 INFO: CVideoPlayerVideo - Stillframe left, switching to normal playback
Thanks for this clean report. I will make a patch to fix the issue.
That sounds great janbar.
I actually found 3 or 4 different issues regarding commercial breaks, cut lists, and auto-skipping. This is only one of them, and so far I only reported two issues. I'm looking at generating logs for the other issues.
Just letting you know, in case you want to collect them in a single release. 😄
Fixed by the commit b83fb4c.
Tag 5.10.3