Removing Commercials

From MythTV Official Wiki
Revision as of 08:58, 31 July 2006 by Zwhite (talk | contribs) (Added information on automatically removing commercials from new recordings.)

Jump to: navigation, search


MythTV does not automatically remove commercials. The system will flag commercials and skip them during playback. It can also transcode recordings between MPEG-2 and MPEG-4 or lossless transcode MPEG-2 and remove a cutlist from the program. Since a list of commercial flags is not a cutlist, it is not removed automatically. This document describes how to remove commercials permanently from the source material.

Removing commercials using mythfrontend


You can remove commercials that have been flagged by editing the recording using mythfrontend. Once you have brought up the timeline editor you can press Z to load the flagged commercials as a cutlist in the editor. Once the cutpoints are created, you can manipulate them normally in the editor to get the exactly where you want them. It is uncommon for the commercial detection to be perfect all the time so some tweaking may be necessary.

After editing is complete, you can choose Begin Transcoding from the OSD menu or you can also choose to Begin Transcoding from the INFO menu in the Watch Recordings screen under Job Options. This will insert a transcode job into the Job Queue which will convert the recording based on your transcode settings in the recording profiles setup.

Removing commercials from the command-line

You can also remove commercials using the command-line utilities mythcommflag and mythtranscode.

Use mythcommflag to create a cutlist from a completed commercial flagging using

mythcommflag --gencutlist

Then use mythtranscode to transcode the recording using the cutlist with

mythtranscode --honorcutlist

You will need the additional standard options to both programs to choose the proper program based on filename or channel and time. Look at the --help output from each program for details on using these options

Automatically removing commercials

In the 0.20 release of MythTV, you can specify a custom command-line option for both the commercial flagging job and the transcoding job. Using this function, you could create a wrapper script for transcoding after commercial flagging that would use the command-line options outlined above.

This is useful if you, for example, use MythWeb to download shows to your laptop or to a machine that is on a connection that is too slow to use MythTV over.

The simplest way to set this up would be to add the flags above directly to the global configuration. A warning: if you decide to go this route and the commercial flagging fouls up you may lose desired video, or you may gain unwanted commercials. The safer option is to set this up using user jobs (Someone with more experience setting up user jobs should document how to do this.)

Run mythtv-setup and select the "General" option. Hit "Next" until you get to the "Job Queue (Host-Specific)" page. Ensure that "Allow Commercial Detection jobs" and "Allow Transcoding jobs" are both checked. You will need to modify this on all your backend machines.

On the next screen, "Job Queue (Global)", you will find the next settings you need to modify. This only needs to be done on one backend machine, since these are global settings. In the "Commercial Flagger command" box, you will want the following:

mythcommflag --gencutlist

Under "Transcoder command" you will want the following:

mythtranscode --honorcutlist

Finally, you will want to ensure that "Save original files after transcoding (globally)" is checked. This way if mythcommflag does foul up and mark wanted sections of video to be removed, you still have the original video. Later on you can disable this setting if you're sure that mythcommflag is reliable enough for you.

If all goes well your new recordings should contain only the video you want. After checking to make sure that your program doesn't have any video missing you can remove the .old file in your video directory.