Commercial skipping for myth:// using EDL (Edit Decision Lists) in XBMC?
#31
Well I did some more testing with a recording that had all the commercials correctly marked by verifying in mythtv frontend. I found that XBMC was skipping them but there was a delay like what pbjr said.

I started XBMC up, went to just before the commercial, stopped the recording, enabled debug logging, restarted XBMC and started the recording. At 13:07 the commercial starts, 13:08 the recording pauses for a slight second then resumes again and at 13:20 its skips to the end of the commercial break.


http://pastebin.com/m2855e863
Reply
#32
fo0d Wrote:Well I did some more testing with a recording that had all the commercials correctly marked by verifying in mythtv frontend. I found that XBMC was skipping them but there was a delay like what pbjr said.

I started XBMC up, went to just before the commercial, stopped the recording, enabled debug logging, restarted XBMC and started the recording. At 13:07 the commercial starts, 13:08 the recording pauses for a slight second then resumes again and at 13:20 its skips to the end of the commercial break.

http://pastebin.com/m2855e863

Thanks for the log. After reviewing it there are a few things at play here:
1) The current functionality "autowinds" into the commercial break by 2 seconds, e.g. skips 2 seconds after the start of the break was detected by MythTV, and starts playing again 2 seconds before the end of the break was detected by MythTV. This is why you see the commercial break start at 13:07 but the seek doesn't start until just after 13:08.
2) Seeking in mpegts files is heinously bad after ~2Gb into the file for some reason. 13:07 shouldn't of hit that marker for what you were playing though. I'm assuming that normal seeking works fast for you still <20 minutes into the recording - can you confirm? Automated seeking later in the mpegts file might be slower - it is for us. Seeking at the start is a snap, and then later in the file it goes really slow (http://trac.xbmc.org/ticket/6009)
3) The current automated seeking is done "accurately". This was to match the existing Seek method, but that seems to have changed. I can change this and that should make things faster. I will test for a little bit longer and then commit this change.


What do people think is a better option for how to resolve 1? I have found that MythTV seems to identify the start of the recording a bit too early sometimes leading us to wonder if that really was the start of a commercial break. We have found that the end is generally quite accurate but marked a bit too late so we miss the first few seconds.

I can create some advanced settings for "autowind" with sensible defaults so people can tweak them as they need to based on how well mythcommflag is marking commercial breaks.

Perhaps after 3 is changed people can see comment on how things are working for them before I make any changes to 1.
Reply
#33
dteirney Wrote:Thanks for the log.
No problem Smile
dteirney Wrote:1) The current functionality "autowinds" into the commercial break by 2 seconds, e.g. skips 2 seconds after the start of the break was detected by MythTV, and starts playing again 2 seconds before the end of the break was detected by MythTV. This is why you see the commercial break start at 13:07 but the seek doesn't start until just after 13:08.
dteirney Wrote:I can create some advanced settings for "autowind" with sensible defaults so people can tweak them as they need to based on how well mythcommflag is marking commercial breaks.

Perhaps after 3 is changed people can see comment on how things are working for them before I make any changes to 1.
This sounds good.
dteirney Wrote:2) Seeking in mpegts files is heinously bad after ~2Gb into the file for some reason. 13:07 shouldn't of hit that marker for what you were playing though. I'm assuming that normal seeking works fast for you still <20 minutes into the recording - can you confirm? Automated seeking later in the mpegts file might be slower - it is for us. Seeking at the start is a snap, and then later in the file it goes really slow (http://trac.xbmc.org/ticket/6009)
haha yes, In recordings that are around an hour or more I cannot seek once im over the 50% mark or so of the recording but rewind works fine.
dteirney Wrote:3) The current automated seeking is done "accurately". This was to match the existing Seek method, but that seems to have changed. I can change this and that should make things faster. I will test for a little bit longer and then commit this change.
K, sounds good.
Reply
#34
I've just committed a change to the behaviour of the automated commercial skips so the seek is flushed and inaccurate (same as if you press the skip button manually).

Is available in linuxport as of r23009

Let me know if this improves the automatic skip behaviour.
Reply
#35
My mythtv backend pc died when I was upgrading the OS Sad
Will be a week or so until i can comment on the new changes, need to order some pc parts.
Reply
#36
Hi,

I am using XBMC on my ATV to watch mythtv recordings and have always downloaded the latest option using the ATV Bootloader download option. Are these changes only in a testing location right now? How does one download this?

Thx
Scott
Reply
#37
ssouter Wrote:Hi,

I am using XBMC on my ATV to watch mythtv recordings and have always downloaded the latest option using the ATV Bootloader download option. Are these changes only in a testing location right now? How does one download this?

Thx
Scott

Now that the linuxport tree has moved to trunk, I'd presume that the latest version of the ATV loader would likely have this. Easiest way to confirm might be to enable Edit Decision Lists and have a look at the log file in debug mode. You should see messages related to commercial breaks and MythTV if it is included.
Reply
#38
Sorry about the delay.
dteirney Wrote:I've just committed a change to the behaviour of the automated commercial skips so the seek is flushed and inaccurate (same as if you press the skip button manually).

Is available in linuxport as of r23009

Let me know if this improves the automatic skip behaviour.
Works alot better thanks.
Reply
#39
this seems to work ok if you're using myth:// as source...

i was trying to use a volume source and manually generate the edl file (by using mythcommflag --getskiplist and converting frames to seconds) to put in the same directory as per: http://wiki.xbmc.org/?title=EDL_(commerc...er_support

but the format of the EDL doesn't seem right in above url - the edl: info in OSD shows edl: C6, for example, it doesn't show up as breaks and scene markers, e.g., edl: b5s9.

it seems to work to skip commercials, but i lose the functionality of FF and REW.

could you share the format of the edl file? i've tried all kinds of variations of what is show on url above...
Reply
#40
jaygardner Wrote:this seems to work ok if you're using myth:// as source...

i was trying to use a volume source and manually generate the edl file (by using mythcommflag --getskiplist and converting frames to seconds) to put in the same directory as per: http://wiki.xbmc.org/?title=EDL_(commerc...er_support

but the format of the EDL doesn't seem right in above url - the edl: info in OSD shows edl: C6, for example, it doesn't show up as breaks and scene markers, e.g., edl: b5s9.

it seems to work to skip commercials, but i lose the functionality of FF and REW.

could you share the format of the edl file? i've tried all kinds of variations of what is show on url above...

I don't seem to have updated that wiki page when the EDL changes were made. That's pretty sloppy. The format of the EDL info has changed and a new extension has been added to the EDL format. Correct information is now in the wiki for those areas.

I will try and tidy up the rest of the page in the following few days. I will likely remove some of the descriptive text for functionality that isn't supported, e.g. muting and scene numbering

"edl: c6" means there are 6 cuts. If you change the 0 to a 3 in the .edl file they will be treated as "soft" commercial breaks rather than "hard" cuts and you will be able to rewind into them.

FYI, commercial skip behaviour is loosely described at http://wiki.xbmc.org/?title=MythTV#Autom...l_Skipping and will be fleshed out further in the EDL wiki page when it is updated properly.
Reply
#41
I know this is resurrection of an old thread, but I've finally got to testing this (after the patch for interlaced FPS has been applied), and it seems that XBMC is still skipping a little early. In fact, as the recording progresses the skipping gets earlier and earlier. It starts as a matter of milliseconds, but as the recording progresses it gets worse until (at the last break of an hour-long program, for example), it's skipping a few minutes early.
Reply
#42
Hmmm, this could be because of the way XBMC "takes an educated guess" at the FPS rate to use to calculate the time offset from the frame marker offset that mythbackend provides.

You'll have to do a bit of work to help out here as I haven't observed this problem. For one of the videos can you please supply the following:
1) Full XBMC debug log for playback of a chosen recording so I can find out the raw FPS detected through FFMPEG, what XBMC is using as the time offsets after calculating them from the information sent from mythbackend.
2) For that same chosen recording, the times at which mythfrontend thinks the commercials start.

Are you using the SVN version of XBMC or one of the public releases?
Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
Reply
#43
Anaerin Wrote:I know this is resurrection of an old thread, but I've finally got to testing this (after the patch for interlaced FPS has been applied)...

I should have read more closely. Which patch are you referring to? Shouldn't need any patch if you are using the SVN version.
Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
Reply
#44
The "Patch" I mentioned was the Interlaced FPS patch that was integrated into SVN. I'm running SVN Rev. 29791 OpenGL on Win32.

Code:
11:56:58 T:2192 M:368562176    INFO: ffmpeg[890]: Input #0, mpegts, from 'myth://mythtv:[email protected]/recordings/2006_20100515200000.mpg':
11:56:58 T:2192 M:368562176    INFO: ffmpeg[890]:   Duration: 01:00:58.79, start: 87412.380889, bitrate: 2541 kb/s
11:56:58 T:2192 M:368562176    INFO: ffmpeg[890]:   Program 1
11:56:58 T:2192 M:368562176    INFO: ffmpeg[890]:     Stream #0.0[0x6a1]: Video: mpeg2video, yuv420p, 352x480 [PAR 20:11 DAR 4:3], 2214 kb/s, 27.78 fps, 59.94 tbr, 90k tbn, 59.94 tbc
11:56:58 T:2192 M:368562176    INFO: ffmpeg[890]:     Stream #0.1[0x6b1]: Audio: mp2, 48000 Hz, 2 channels, s16, 192 kb/s
Code:
11:56:58 T:2192 M:367869952   DEBUG: CEdl::ReadMythCommBreaks - Reading commercial breaks from MythTV for: recordings/2006_20100515200000.mpg
11:56:58 T:2192 M:365694976   DEBUG: CEdl::AddCut - Pushing new cut to back [00:00:00.000 - 00:00:52.569], 3
11:56:58 T:2192 M:365694976   DEBUG: CEdl::AddCut - Pushing new cut to back [00:03:36.199 - 00:06:39.115], 3
11:56:58 T:2192 M:365694976   DEBUG: CEdl::ReadMythCommBreaks - Added 2 commercial breaks from MythTV for: recordings/2006_20100515200000.mpg. Used detected frame rate of 59.940 fps to calculate times from the frame markers.
11:56:58 T:2192 M:365694976   DEBUG: CEdl::AddSceneMarker - Inserting new scene marker: 00:00:52.569
11:56:58 T:2192 M:365694976   DEBUG: CEdl::AddSceneMarker - Inserting new scene marker: 00:03:36.199
11:56:58 T:2192 M:365694976   DEBUG: CEdl::AddSceneMarker - Inserting new scene marker: 00:06:39.115
11:56:58 T:2192 M:365625344   DEBUG: CEdl::WriteMPlayerEdl - MPlayer EDL file written to: special://temp/xbmc.edl
11:56:58 T:2192 M:365625344   DEBUG: CDVDPlayer::Process - Start position set to end of first cut or commercial break: 52569

According to the Myth table, the commercial points are:

Code:
0    Start
3151    End
12959     Start
23923     End

I think the problem is that the frame rate is 2*27.78 (55.56fps), but it's using the "tbn" rate (whatever that is) of 59.94, hence the drift. At least, that's how I'm reading it.
Reply
#45
@Anaerin, can you check using a MythTV file that has some commercial breaks further into the file.

The values in the myth table are the frame numbers at which the commercial breaks start and end. To get the fps that should be used in XBMC to covert to the frame marker to the "real" time you will need to use mythfrontend and see what the playback time is for each of the commercial breaks.

mythfrontend uses the keyframe timing information to determine a bunch of stuff and that isn't available directly via the Myth protocol.

That file looks like it is NTSC based on the 59.94 fps and height of 480. The code in XBMC should be converting to 29.97 fps to calculate the commercial break offsets but it looks like my floating point precision foo for equality checking is not up to scratch.

Can you please confirm if the 59.940 fps file should or shouldn't have the frame rate changed to 29.97 for the commercial skip timing to work. Based on the timings shown with a 3 minute commercial break it shouldn't be...
Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
Reply

Logout Mark Read Team Forum Stats Members Help
Commercial skipping for myth:// using EDL (Edit Decision Lists) in XBMC?0