Improving commercial break skip support for MythTV

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
dteirney Offline
Team-XBMC Developer
Posts: 820
Joined: Jul 2007
Reputation: 6
Location: New Zealand
Post: #11
(2012-06-11 03:19)varneyb Wrote:  
(2012-05-08 14:42)dteirney Wrote:  1) A link to a full debug log opening the recording that has the incorrect skip behaviour (please just that file - full debug log files are long enough as it is).
2) A list of the time periods that the commercial break should have been (to the nearest 5 seconds should be fine)
3) What sort of tuner the recording was recorded using, e.g. DVB-T, Analog, Cable via USB Tuner.
4) Whether you know if there are any frame rate changes in the playback, e.g. I've heard that some stations play commercial breaks at a different frame rate to the broadcast content. If this happens, unfortunately, there is unlikely to be a workaround.

1) I'll have to work on getting you a log, but I know that I do get the following WARNING:
WARNING: ReadComskip - Frame rate not in Comskip file. Using detected frames per second: 29.970

2) I have found that if I use a skip list generated by comskip.exe instead of mythcommflag, it works. For E02 of Unforgettable:
Here is the mythcommflag skip list:
FILE PROCESSING COMPLETE
------------------------
31137 36371
47736 53922
68679 72980
88667 92785


And here is the comskip skip list:
FILE PROCESSING COMPLETE 107718 FRAMES AT 2997
-------------------
1 206
10030 15825
36923 42438
56113 62638
80338 84924
98699 107718

3) Over the air (ATSC) tuner (HDHOMERUN)
4) I don't know, but I know that if I use the comskip list, I get the skips in the right place. However, there is a substantial delay (15-20 seconds) when it skips during which XBMC is completely unresponsive. This has happened with EDEN both on XBMCBUNTU and Windows Vista (I did not have this problem with Dharma on Vista).

1) The detected frame rate of 29.97 matches the frame rate in the comskip.exe generated file, e.g. the 2997 part. So that means that the commercial skip tools are finding different commercial break locations. What commercial detection method are you using in mythbackend? I use Logo Detection for New Zealand transmissions. All the other methods were hopeless.

2) You shouldn't get the warning re the Framerate not being in the comskip file for that file. 2997 means 29.97fps. How are you playing those recordings?

4) There is a known issue that is currently being worked through for the skip delay. https://github.com/xbmc/xbmc/pull/944 (still needs a lot more work with help from another XBMC developer to sort out what introduced the problem).

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!
find quote
varneyb Offline
Junior Member
Posts: 20
Joined: Nov 2011
Reputation: 0
Post: #12
(2012-06-11 09:15)dteirney Wrote:  1) The detected frame rate of 29.97 matches the frame rate in the comskip.exe generated file, e.g. the 2997 part. So that means that the commercial skip tools are finding different commercial break locations. What commercial detection method are you using in mythbackend? I use Logo Detection for New Zealand transmissions. All the other methods were hopeless.

2) You shouldn't get the warning re the Framerate not being in the comskip file for that file. 2997 means 29.97fps. How are you playing those recordings?

4) There is a known issue that is currently being worked through for the skip delay. https://github.com/xbmc/xbmc/pull/944 (still needs a lot more work with help from another XBMC developer to sort out what introduced the problem).

1) I'm just using the default - I can try other methods and see what I get. Note, however that when I try to remove commercials with mythtranscode, it removes the wrong sections (i.e. still leaves some of the commercials in and removes some of the show) regardless of whether I use the mythcommflag or comskip skip lists to generate the cut list for the file.
2) I'm not sure I understand the question. I'm playing them in XBMC on XBMCBuntu.
4) Thanks for the info.
find quote
tdavis Offline
Member
Posts: 87
Joined: Jan 2010
Reputation: 0
Post: #13
Bringing this backup from the dead..

Using these two PR's:

https://github.com/xbmc/xbmc/pull/1743
https://github.com/fetzerch/xbmc-pvr-addons/pull/51

You can build a version of Frodo & pvr.Mythtv that uses the MythTV commercial skips.

It works great on a fixed frame rate mpeg, which is the default on OTA here.

Using a CableCard enabled Prime on Comcast, however.. that is not true. When you view using Mythtvfrontend, the breaks are dead on. When using pvr & xbmc, they are 15 or more seconds off (it skips early, and ends early).

Playing back the files using mplayer shows this:

demux_mpg: 24000/1001fps progressive NTSC content detected, switching framerate.
A:14575.0 V:14575.0 A-V: 0.022 ct: 0.051 1938/1583 22% 0% 1.1% 0 0

demux_mpg: 30000/1001fps NTSC content detected, switching framerate.
A:14575.0 V:14575.0 A-V: 0.025 ct: 0.053 1939/1584 22% 0% 1.1% 0 0
Warning! FPS changed 47.952 -> 59.940 (-11.988010) [7]
A:14576.2 V:14576.2 A-V: 0.016 ct: 0.083 2010/1654 23% 0% 1.1% 0 0

demux_mpg: 24000/1001fps progressive NTSC content detected, switching framerate.
A:14576.2 V:14576.2 A-V: 0.015 ct: 0.085 2013/1655 23% 0% 1.1% 0 0

demux_mpg: 30000/1001fps NTSC content detected, switching framerate.
A:14576.2 V:14576.2 A-V: 0.041 ct: 0.087 2014/1656 23% 0% 1.1% 0 0
Warning! FPS changed 47.952 -> 59.940 (-11.988010) [7]
A:14576.5 V:14576.6 A-V: -0.013 ct: 0.075 2031/1668 23% 0% 1.1% 0 0

and no, those are not at scene changes or commercial breaks..

The EDL/comskip in the two mentioned PRs uses a fixed frame rate; mythtv db shows the videos have a fixed frame rate; but they do not.

I'm working on getting a sample of LiveTV that has a commercial break for testing purposes that has varying frame rates..
find quote
LSU Jonno Offline
Junior Member
Posts: 35
Joined: Dec 2012
Reputation: 0
Post: #14
Curious what could be causing this. I have a HDHR Prime on Comcast and am getting these same huge time shifts during commercial skips. I've been aware of this constant frame rate switching since I built my HTPC 2 years ago.

If you have an ATI video card and enable "Dynamic Contrast" on the ATI Catalyst Control Center you can visually see how often these frame rate changes happen. Your screen will change brightness consistent with the FR changes...It happens 10-30 times per hour long TV program.

Anyway, assuming the FR changes aren't consistent in one direction, wouldn't you expect them to sort of cancel themselves out resulting in no actual, or maybe no perceived shift when assuming a constant frame rate multiplied by total frames to come up with a shift time?
find quote
dteirney Offline
Team-XBMC Developer
Posts: 820
Joined: Jul 2007
Reputation: 6
Location: New Zealand
Post: #15
If the frame rate of the video changes, then the time markers calculated from the initial frame rate and frame markers from mythbackend will all be wrong after the first frame rate switch. The amount they are off will depend on how different the frame rate is and for how long that different frame rate plays for. Without knowing all of the places where the frame rate changes to / from it is not possible to pre-calculate the correct time markers. Of course, all of this assumes that the commercial break locations were correctly calculated by the commercial flagging tool in the first place.

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!
find quote
tdavis Offline
Member
Posts: 87
Joined: Jan 2010
Reputation: 0
Post: #16
That's just it.. Under MythTV, it's correct, the timestamp line up and everything. I dumped the db, looked at the commercial breaks, and using the mythtv client verified where the commercials started and stopped.

They do something to correct the frame rate.. what exactly it is, I don't know.
find quote
tdavis Offline
Member
Posts: 87
Joined: Jan 2010
Reputation: 0
Post: #17
The more I dig into how mythtv makes this work, I am starting to believe that XBMC will never truly support it AS-IS from a myth setup that records mpeg-ts with variable frame rate; myth never records this fact into it's db, and uses a seek table with frame/byte offsets on where to jump.

I am looking into transcoding the file into something else, and then seeing what happens; it's too bad mythtranscode in 0.26 is borked (I'm getting the deadlock error..)
find quote
cfetzer Offline
Senior Member
Posts: 256
Joined: Jul 2011
Reputation: 10
Post: #18
MythTV 0.27 seems to bring some support for this: http://code.mythtv.org/trac/changeset/49dbed5be0/mythtv
Haven't checked it in detail, but it sounds promising.
Is anyone able to upload a sample recording with different framerates somewhere (for example on dropbox)?
find quote
tdavis Offline
Member
Posts: 87
Joined: Jan 2010
Reputation: 0
Post: #19
I've uploaded one to a web service I manage.. PM'd you cfetzer with it. It's BIG 3.2GB in size, but it's a COMPLETE 30 minute show, so you have plenty of material to work with. I included the myth commercial skip list in another text file also.

If someone else wants it, ask and I'll pm the link to it.
find quote
Post Reply