Automating commercial cutting

One of the nice features of mythtv is that it can do commercial detection, and from that, build a cutlist. My biggest problem, and what kept me from using this feature was that I thought you had to use the user interface to do this. Alas, I have found that indeed there is a command line way to generate the cutlist. Using mythcommflag -f <filename> you can create the commercial flags, the coming back and using mythcommflag --blanks -f give me the cutlist.

Breaks (computed using only blank frame detection)
13090 : 4 (00:07:16.10) (436)
18678 : 5 (00:10:22.18) (622)
35104 : 4 (00:19:30.04) (1170)
41431 : 5 (00:23:01.01) (1381)
51877 : 4 (00:28:49.07) (1729)
52374 : 5 (00:29:05.24) (1745)
53651 : 4 (00:29:48.11) (1788)
65357 : 5 (00:36:18.17) (2178)
78320 : 4 (00:43:30.20) (2610)
85881 : 5 (00:47:42.21) (2862)
100991 : 4 (00:56:06.11) (3366)
107762 : 5 (00:59:52.02) (3592)

The first column is the frame number (useful for avidemux), the second column is the '4:cut out' '5:cut in' column, the third column is the timecode (useful for ProjectX) and the fourth column is seconds (useful for mplayer).


Some simple perl scripting, and we have a cutlist that can be used for avidemux, or as an EDL (edit decision list) for mplayer.

6 comments:

Anonymous said...
8:44 PM

I'm just wondering if you ever wrote up the code for this? I'm just trying to get the same thing done, and I'd rather not redo work that's been done :)

paul@majestik.org

John said...
7:22 AM

Hey Paul,

Unfortunately, there were a couple problems with this approach (I probably should have posted a follow up). 1) the cut list is far from perfect when generated by Mythtv without any intervention.
2) doing mythcommflag on 1920x1080i content took *forever*, considering that I would then turn around and transcode it to MPEG-4, it took almost 10 hours just to get one (imperfect) cutlist generated and a final MPEG-4 video.

I haven't yet upgraded to mythtv v. 0.16, which I'm planning on doing soon, so if there's any change I'll post it here.

Anonymous said...
10:36 PM

I actually spoke with the developer of the myth cutlist program... and I've got a patch to enable the mythcommflag to enable turning comm flags into cutlists.

It's not my patch, so I shouldn't publish it here, but email me directly and I can send it your way.

BTW. 0.17 is out now too :)

John said...
8:00 AM

Hey Paul,

I tried e-mailing you but it bounced. Thanks for the update. I'm going to completely re-build my system from scratch in a couple of weeks. I've got two more pcHDTV cards (does anybody really need three? What the heck). I'm leaving all the hardware in place for my frontend, and building a seperate backend. I'm going from FC1 to FC3 and MythTV 0.15 to 0.17. I'm hoping to see enough improvements in the new nVidia drivers and the MythTV code to be able to watch HDTV without transcoding, which will make managing cutlists much easier. All I need now is another Terrabyte of storage ;)

Anonymous said...
10:32 PM

John,

I just checked with the dev for mythcommflag, and apparently the --gencutlist option is now in cvs. I haven't tried it quite yet, I'm installing 0.17 as I type this so we'll see about pulling commflag from cvs and see what happens :)

Anonymous said...
5:10 PM

Best regards from NY!
duplicate computers wsus insurance quote california mortgage calculator diablo dedicated server