/home/mythtv/3gp.sh /myth/1004_20070912180000.mpg "The Simpsons - Marge Be Not Proud"

Note: The title is in quotes, to ensure it is passed to the script as $2, without the quotes $2 would be "The", $3 "Simpsons" etc....

Encode without commercials

With this option we have a script that you can use from one of your User Jobs or fire it off from the command line... your choice. Either way encoding without commercials can save you a lot of precious space on your mobile device. I have chosen (via the below ffmpeg settings) to trade some of that space savings for better quality video, you decide what's best for your setup.

Just create the following file, make it executable and setup your user job of hit the command line.

Note: You're going to want to change some of the ffmpeg commands as the above encodes for my enV phone which can handle high framerates and stereo (2 channel) audio. Also, the above script yields a roughly 70MB file for every 20 minutes of video (30 minute program minus 10 minutes of commercials).

Running from command line

You can also fire the script from the command line, but it can be a PITA to find the file you want to encode... at any rate, you do it like this:

$/usr/bin/myth_3gp /myth/tv/1004_20070912180000.mpg "The Simpsons - Marge Be Not Proud" "/myth/shared/video/"

Script overview

Now what's going to happen is the script will create a cutlist based on the commercial flagging or I think it will use an existing cutlist in case you want to create one yourself, but be warned that unless you comment out the line in the script above, it will automatically clear the cutlist when it's done. Then, it's going to generate a couple of files (a .tmp and a .key file) while it's building the .3gp file. Once the .tmp and .key file are removed and the job says "Completed" in the log it means the script it done and your file is ready for your mobile device.

Automatically Transcoding

To automate this process simply create a User Jobs to call the script, my UserJob1 is as follows:

/home/mythtv/3gp.sh "%DIR%/%FILE%" "%TITLE% - %SUBTITLE%"

Variables

There are many variables you may want to change within the script:

Options for User Jobs on the Backend

Option

What it does

Possible Settings

-acodec

Audio Codec

libamr_wb, libamr_nb (depending on your version of ffmpeg you may need to drop the lib, ie amr_wb ro amr_nb.)