Difference between revisions of "Mythtranscode"

From MythTV Official Wiki
Jump to: navigation, search
(Remove commercials from an MPEG2 recording)
Line 54: Line 54:
 
First, set a cutlist for the show.  Then:
 
First, set a cutlist for the show.  Then:
 
  mythtranscode --chanid 1017 --starttime 2006-12-16-20-00-00 --mpeg2 --honorcutlist
 
  mythtranscode --chanid 1017 --starttime 2006-12-16-20-00-00 --mpeg2 --honorcutlist
This will drop the cut version beside the original, but with an added <tt>.tmp</tt> extension.  It doesn't update the show in the database or remove the cutlistYou'll have to use this new, cut version manually.
+
This will drop the cut version beside the original, but with an added <tt>.tmp</tt> extension.  I'm not exactly sure what it does to the database.  It seems to keep the cutpoints and points at the old <tt>.mpg</tt> file, but shortens how long it thinks the movie is to the size of the <tt>.tmp</tt> file.
 
+
 
{{Stub}}
 
{{Stub}}
 
[[Category:Utilities]]
 
[[Category:Utilities]]

Revision as of 23:42, 17 December 2006

Mythtranscode is the internal process used by the front end to transcode MythTV recordings.

Usage

Usage: mythtranscode <--chanid <channelid>>
        <--starttime <starttime>> <--profile <profile>>
        [options]

        --mpeg2          or -m: Perform MPEG2 to MPEG2 transcode.
        --chanid         or -c: Takes a channel id. REQUIRED
        --starttime      or -s: Takes a starttime for the
                                recording. REQUIRED
        --infile         or -i: Input file (Alternative to -c and -s)
        --outfile        or -o: Output file
        --profile        or -p: Takes a profile number or 'autodetect'
                                recording profile. REQUIRED
        --honorcutlist   or -l: Specifies whether to use the cutlist.
        --allkeys        or -k: Specifies that the output file
                                should be made entirely of keyframes.
        --fifodir        or -f: Directory to write fifos to
                                If --fifodir is specified, 'audout' and 'vidout'

                                will be created in the specified directory
        --fifosync            : Enforce fifo sync
        --buildindex     or -b: Build a new keyframe index
                                (use only if audio and video fifos are read independantly)
        --showprogress        : Display status info to the stdout
        --verbose level  or -v: Use '-v help' for level info
        --help           or -h: Prints this help statement.

Choosing a Recording

Two methods are available to choose which recording to work on. The first is to specify the channelid and start time,

-c 1067 -s 2006-04-24-18-30-00

Unless starttime is formatted yyyy-mm-dd-hh-mm-ss, you get "QTime::setHMS Invalid time" and "QDate::setYMD: Invalid date" errors. According to http://mythtv.org/pipermail/mythtv-dev/2003-July/011650.html , it's been that way since 0.10.

The other method is to specify the file,

-i /MythTV/tv/1856_20060425200000.mpg

--honorcutlist Limitation

--honorcutlist only seems to work (0.19-fixes [9938]) with the "-c -s" switch combo, NOT with a specified input (-i) file, even if that file is in the mythconverg database.

(Virtually) Lossless MPEG2 Transcode

--mpeg2

New in 0.19 is a virtually lossless MPEG2 transcode. What this does is let you select cut points and mythtranscode will only re-encode the frames that need to be, copying the rest directly from the stream. If you are using this to cut commercials and you cut at the black frames of a fade to black (or white of a fade to white), what you get is basically a perfect stream copy of the video with no loss to the frames that matter.

This also has some side benefits,

  • Converts the mpeg2 from a TS stream to a PS stream, possibly saving up to 20% of the file size!
  • Fixes Audio/Video sync issues in a similar fashion to ProjectX.

Examples

Remove commercials from an MPEG2 recording

First, set a cutlist for the show. Then:

mythtranscode --chanid 1017 --starttime 2006-12-16-20-00-00 --mpeg2 --honorcutlist

This will drop the cut version beside the original, but with an added .tmp extension. I'm not exactly sure what it does to the database. It seems to keep the cutpoints and points at the old .mpg file, but shortens how long it thinks the movie is to the size of the .tmp file.