Comercial Skip / Cutlists / EDL
#1
Apologies if this is an FAQ, but as I cant search for edl as it has too few letters, and most concerns on edl/commskip seem to be about accuracy.


I am a long term Mythfrontend/Mythbackend user, trying out Kodi as a frontend to benefit from wider hardware support. I am reallyt impressed with Kodi in general, and the strength of the mythtv support, but I am struggling with commercial skipping.

I am in the UK, and have commercial flagging and skipping using silence detect working pretty smoothly on mythbackend.

When I tried some test recordings on kodi using the mythtv add-on I was finding that commercial skipping didn't work at all on Kodi, despite it being mentioned as a feature. A bit further investigation I found that:

Commercial skipping seems to work for SOME recordings depending on the channel. This is not an accuracy issue, the cutlist/skip list is just not detected on some channels. On other channels commercial flagged recordings seem to work with the skipping, but those with cut lists don't. Is this expected ?

I am using: Latest Mythtv 0.27 on Ubuntu for mythbackend, and a variety of kodi versions on different hardware. But the test example is mythtv pvr client 3.2.2 on kodi 16 alpha 2.

So setting the edl skip function to dialogue, then I can at least see which recordings kodi/pvr.mythtv think are flagged, and running debug logs I can see whether cutlists or commercial breaks are detected.

Some channels do not return any edl info in the logs: The logs also show 0 for frame rate. These recordings seem to work fine and be comm-skipped as expected in mythfrontend.

All examples are either comm flagged, or have cut lists defined, or both

Example 1: A channel that completely ignores the edl [ Uk DRAMA]

No cutlist detected, and no skipping

DEBUG: ReadPvr - Reading Edl for recording: The Inspector Lynley Mysteries - A Great Deliverance
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: AV props: Frame Rate = 0.000

pressing "o" gets me edl:-

Example 2

A different channel: the skipping works for commflaged, and when a cutlist is added, the cutlist is honoured in preference to the commflaged. [ UK channel E4 ]

2a

DEBUG: ReadPvr - Reading Edl for recording: The Big Bang Theory - The Communication Deterioration
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: AV props: Frame Rate = 25.000
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 6 commercial breaks for: The Big Bang Theory - The Communication Deterioration
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 0 cut list entries for: The Big Bang Theory - The Communication Deterioration

pressing "o" gets me edl:b3s5

2b

DEBUG: ReadPvr - Reading Edl for recording: The Big Bang Theory - The Communication Deterioration
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: AV props: Frame Rate = 25.000
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 6 commercial breaks for: The Big Bang Theory - The Communication Deterioration
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 4 cut list entries for: The Big Bang Theory - The Communication Deterioration

pressing "o" gets me edl:b3s5

Example 3:

Where a recording has only a cutlist, the actual behavior seems flakey, particularly ( as is common) the first and last cut is a cut to the begining and a cut to the end.

DEBUG: ReadPvr - Reading Edl for recording: The Big Bang Theory - The Clean Room Infiltration
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: AV props: Frame Rate = 25.000
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 0 commercial breaks for: The Big Bang Theory - The Clean Room Infiltration
DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 2 cut list entries for: The Big Bang Theory - The Clean Room Infiltration

pressing "o" gets me edl:c2

with this example the cuts are at either end of the episode to the ends, and no skips happen. If i change the cuts to start 1 secs in and finish 1 secs before the end, then skipping works as expected.



SO am I doing something wrong here, or are these known limitations ?
Reply
#2
Hi @john321, yes there some limitations with MythTV 0.27 which doesn't provide the api service to allow handling of EDL for recordings with variable framerate. As you probably know, since kodi 14.0 the mythtv addon uses exclusively the api service or the protocol service from your backend. Only MythTV 0.28 provides the right service allowing to fully handle the EDL feature. Unfortunately 0.28 is not yet released as stable.

EDIT: When i have coded the edl services i thought MythTV 0.28 would be out soon. But no Undecided.
Reply
#3
In real world 0.28 run great and here i use it. But i couldn't hint you to upgrade your backend. You have to get the right decision yourself Wink.
Reply
#4
About your example 3 , it could have an issue. But not sure, i have to try same case.
Reply
#5
Thank you for the reply, and your great work on this add-on.

I should have remembered "Why do you need documentation , you have the source-code :-)"

I get it now, the channel returns a fps of 0, so the conversion of frame skip to time skip cant be done.

Hacking a sane default of 25 fps ( i'm in UK) fixes my main issue. Papering over the cracks as I dont know why the channel returns 0 fps, unless it is indeed variable.

As for point 3:

My experience is that the cutlists/ commflag lists I have seem to lead to Kodi not missing the first or last cut or adverts.

Also I cant even work out whats happening when you have commflagged, then follow it with a tidy up cutlist. On mythtvfrontend, the cutlist takes precedence, so you jump to the end of the first cut, then you can auto or manually skip to the next (soft)commflag, and then there is a hard skip at the cutlist points.

As far as I can see on Kodi the hard cutlist is ignored, and the commflagged points are (sometimes!) used.

Example:

13:39:46 T:139695341061888 DEBUG: ReadEditDecisionLists - Checking for edit decision list (EDL) for PVR recording: pvr://recordings/active/Default/New Girl/New Girl s04e12 Shark, TV (E4), 20150903_195800.pvr
13:39:46 T:139695341061888 DEBUG: ReadPvr - Reading Edl for recording: New Girl
13:39:46 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Reading edl for: New Girl
13:39:46 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: AV props: Frame Rate = 25.000
13:39:46 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 10 commercial breaks for: New Girl
13:39:46 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: Found 6 cut list entries for: New Girl
13:39:48 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: COMBREAK 0.000 - 323.720
13:39:48 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: COMBREAK 526.320 - 919.760
13:39:48 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: COMBREAK 940.280 - 1078.560
13:39:48 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: COMBREAK 1475.560 - 1850.760
13:39:48 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: COMBREAK 1881.360 - 399999.960
13:39:48 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 600.640 - 900.640
13:39:48 T:139695341061888 DEBUG: AddOnLog: MythTV PVR Client: GetRecordingEdl: CUT 1200.520 - 1500.400
Reply
#6
Hi,

Tried to work through why AV Props Framerate was showing 0 for a particular channel/ set of recordings. Its that error that is stopping the commflag info being passed to pvr.mythtv, as forcing 25 fps in the code papers over the issue.

Tracing through the code, I assume that the info is being scraped from the myth db, from the recordedmarkup table ?

The recordings with 0 fps all have the same value = 25000,type = 32 entry as all the others, the only difference I can see is that the mark value is 0 rather than 1. But a manual change makes no difference to the result ( 0 fps in pvr.mythtv)

Any guidance where to look next ? or am going in the wrong direction :-)
Reply
#7
@john321, the addon hasn't any access to the MythTV database. The addon uses the API servives (port 6544) or protocol (port 6543) from your backend, and there isn't any service can provide these type of markup. Also often they have no usage because now channels provide variable framerate. So the addon get these informations directly from the mpeg stream, parsing video and audio frames (Class AVInfo and TSDemuxer). The framerate is used until 0.27 to convert framecount to duration, but it is not usable for stream with variable framerate.
Since 0.28, the API provides the service to get commercial break list choosing the unit (duration, offset, framecount). Here the addon use duration unit which is handled by Kodi. Inside MythTV, the unit convertion is done using the duration table which contains the time value for each i-frame.

EDIT: here https://github.com/janbar/mythtv/commit/...75844acc84 the commit introducing the service to convert and get edl.
Reply
#8
A framerate with value as 0, means it is variable or the stream type is unknown by the parser of the addon. If you choose to upgrade to 0.28 then your issue will be fully resolved, because framerate is no longer used as i explained above.
Reply
#9
Ok thanks,

I will leave it there then :-) I was still puzzled that the log shows ffmpeg picks up the stream as 25 fps, and I cannot see any diffrence between any of the AVINFO logs , apart from the final result. But thanks for the education, and I might dabble with 0.28 on VirtualBox.
Reply

Logout Mark Read Team Forum Stats Members Help
Comercial Skip / Cutlists / EDL0