Ticket #1349: transcoding-doc.patch

File transcoding-doc.patch, 12.1 KB (added by spin667@…, 16 years ago)
  • docs/mythtv-HOWTO.sgml

     
    63346334content even if the slave backend that recorded a program is not available.
    63356335
    63366336<sect1>What is this transcoder thing, and how do I use it?
    6337 <p>The transcoder re-encodes files from one MythTV format to another.  The
    6338 main purpose of the transcoder is to allow users with hardware
    6339 encoders (PVR-250) or systems that can only record in RTjpeg due to
    6340 performance reasons (multiple capture cards, slow system, etc) to create
    6341 MPEG-4 streams to save space.
     6337<p>MythTV's built-in transcoder re-encodes recordings from one
     6338codec/format to another.  Transcoding is most commonly used to allow
     6339users with hardware encoders (PVR cards, DVB cards, ATSC HD, etc.) or
     6340systems that can only record in RTjpeg due to performance reasons
     6341(multiple capture cards, slow system, etc) to create MPEG4 streams to
     6342save space.  However, with the addition of HD sources transcoding has
     6343come to be used to transcode and resize HD MPEG2 recordings into
     6344MPEG4 files to be played on systems too slow to deal with the original
     6345HD recordings.  There are even more uses for transcoding though,
     6346including the ability to fix up MPEG2 recordings or remove commercials
     6347without transcoding at all.</p>
     6348<p>When MythTV transcodes a file to MPEG4 or RTjpeg the file format is
     6349actually NuppelVideo (nuv.)  You may have difficulty playing these
     6350files back in other video players.  If you want something more
     6351portable you can look at some of the other sections in this HOWTO.
    63426352
    6343 The transcoder can be used in two ways:
     6353<p> The original file is actually removed when the transcoding process
     6354is complete.  Unless you're sure that you will be satisfied with the
     6355result you may want to enable the mythv-setup option which causes
     6356mythbackend to keep the original after transcoding.  This option is on
     6357the second page of the General section in mythtv-setup.  Enabling this
     6358allows you to compare the two files and restore the original if you
     6359like.  Outside of the initial setup phase it usually isn't necessary
     6360to leave this option enabled.
     6361</p>
     6362
     6363<p>A recording can be transcoded in two ways:
    63446364<itemize>
    6345 <item>Automatically re-encode every file once it has completed recording
    6346 <item> After marking commercials, the transcoder can be run manually to
    6347 delete the commercials from the file (thus further saving space)
     6365<item>Automatically transcode the file once it has completed
     6366recording.</item>
     6367<item>Manually choosing to transcode a recording, usually after
     6368importing a cutlist or manually marking commercials to be
     6369removed.</item>
    63486370</itemize>
    6349 The two methods are independent.  The first is an automatic process that can be
    6350 enabled/disabled through the setup program; the second is a manual method which
    6351 must be invoked on each recording individually.
    63526371
    6353 The second method can be used on files that have already been transcoded (or
    6354 files which were are already in the correct format), so only the frames
    6355 immediately following a cut section will be re-encoded, resulting in a very
    6356 minimal loss of quality.
     6372<P>The second method can be used on files that have already been
     6373transcoded (or files which were are already in the desired format), so
     6374only the frames immediately following a cut section will be
     6375re-encoded, resulting in a very minimal loss of quality when removing
     6376commercials.</P>
    63576377
    6358 To enable automatic transcoding, do the following:
    6359    start the setup program
    6360    under the host-specific settings:
    6361       set the Transcoder Auto-run checkbox
     6378<P>The current transcoding system has a lot flexibility, but there are
     6379a number of steps involved in setting it up.  In order to
     6380automatically transcode a given recording you must do the following:
     6381<enum>
     6382<item>Configure recording profile for your capture source and enable
     6383transcoding on one or more profiles.</item>
     6384<item>Configure one or more transcoding profiles.</item>
     6385<item>Create or alter existing scheduled recordings to enable
     6386transcoding for that recording.</item>
     6387</enum>
    63626388
    6363 For either manual or automatic transcoding:
    6364    start mythbackend
    6365    start mythfrontend
    6366    select setup, and the Transcoding recording profile.
    6367       now select either RTjpeg or MPEG-4 (selecting any of the hardware
    6368       encoders will result in the transcoder not working).
    6369       set the other parameters as you'd like.  For best performance, you
    6370       should match the audio to the 'Default' profile.  If you plan to
    6371       only use the manual transcoder, you can choose to set the video to
    6372       be the same as the default profile too (as long as it is MPEG-4 or
    6373       RTjpeg)
     6389<sect2>Configuring Recording Profiles to Allow Transcoding
    63746390
    6375 Everything should now be setup properly.  If you elected to use the
    6376 Auto-Run feature, the transcoder will automatically launch after each
    6377 recording is complete.  The transcoder thread runs at a low priority, so it
    6378 should not impact any critical tasks or other recordings.
     6391<P>Enter the Utilities/Setup,Setup,TV Settings,Recording Profiles
     6392section in mythfrontend.  Choose the option that corresponds with your
     6393capture source (ignore the Transcoders for now.)  Choose the quality
     6394profile you are interested in enabling auto-transcode for.  Make sure
     6395"Enable auto-transcode after recording" is checked.  This option might
     6396ought to be called "allow auto-transcode" as we'll soon see though.
     6397You might want to verify that the other settings for this profile are
     6398correct while your here.</P>
    63796399
    6380 If you want to manually transcode a program, simply press 'X' while
    6381 watching a recording (you should have already finished marking all
    6382 commercials).  If you change your mind, hitting 'X' again will stop the
    6383 transcoding.
     6400<sect2>Configure Transcoding Profiles
    63846401
    6385 Once the transcode is complete, mythbackend will replace the old file
    6386 with the new as soon as it is no longer in use.
     6402<P>Enter the Transcoders section under Recording Profiles.  There are
     6403three quality settings to choose from and a two special Autodetect
     6404settings.  Later, when scheduling recordings you'll have to choose one
     6405of Autodetect, High, Medium, and Low Quality transcode settings in
     6406addition to the recording profile we set up above.  If you choose the
     6407Autodetect transcoding profile for a recording, MythTV will use the
     6408"Autodetect from RTjpeg/MPEG4" profile for recordings which are
     6409RTjpeg/MPEG4 files.  Otherwise, it will use the "Autodetect from
     6410MPEG2" provided it's an MPEG2 recording.  If you choose one of the
     6411others (High, Medium, Low) it will use the settings in that profile
     6412regardless of the codec of the original recording.</P>
    63876413
     6414<P>There are a myriad of options for transcoding but the simplest
     6415setting is to enable lossless transcoding (the first option) as this
     6416removes all other options. Enabling lossless encoding simply removes
     6417commercials (if you've marked them) and attempts to clean up MPEG2
     6418streams.  Note: with this option MythTV will not apply denoise filters
     6419or anything of the sort.  It only attempts to massage the stream into
     6420something cleaner and less likely to have trouble with other less
     6421forgiving MPEG2 hardware/software (including players, video editors,
     6422etc.)</P>
     6423
     6424<P>If you enable resizing of the recording the next page has the
     6425settings for choosing the final resolution.  Note: MythTV will scale
     6426the video as appropriate not crop it to this resolution.</P>
     6427
     6428<P>The final two pages allow configuration of the video and audio
     6429codecs.  Although RTjpeg is an option for video codec I can think of
     6430no reason you'd want to transcode to that format.  It produces larger
     6431files than MPEG4 <em>and</em> the recording will take <em>more</em> CPU
     6432power to play back.  The MPEG4 settings are not exactly
     6433self-explanatory but you can judge for yourself the effects on the
     6434final file and it's easy to experiment with until you achieve a good
     6435compromise between size and quality.
     6436<p>For those who've messed up their MPEG4 transcoding profile, the
     6437defaults from memory are Bitrate: 2200-2500, MaxQ: 2, MinQ: 15,
     6438MaxQDiff: 3, and "Scale bitrate for frame size" is enabled.  The other
     6439options are unchecked.  If you're getting weird results from MPEG4
     6440transcoding try setting as above and go from there.
     6441
     6442<sect2>Create/Alter Scheduled Recordings to Enable Transcoding
     6443
     6444<P>Transcoding is actually enabled on a per-recording basis.  Two
     6445things must be true before any given recording will be
     6446auto-transcoded, however.  The first is that the recording must have
     6447been made with a recording profile that has auto-transcode enabled.
     6448Under "Storage Options" for the recording you must set the "Record
     6449using the "X" profile" to the profile you configured in the first
     6450step.  In addition, under the "Post Recording Options" section of the
     6451recording you must also set "Transcode new recordings." This is also
     6452where you specify the Transcoding profile to use (Auto, High, Medium,
     6453Low.)</P>
     6454
     6455<P>It may not be obvious from above but the flexibility of this system
     6456is primarily to make it possible to auto-transcode a show recorded via
     6457one source (ie: pcHDTV 3000), and not transcode that same show if it's
     6458recorded on another kind of card (ie: PVR-250.)  There are other uses
     6459however.  You could have a PVR-250 and a V4L card.  You may want to
     6460transcode the MPEG2 from the PVR-250 but there is no need to transcode
     6461the recordings made with the V4L card, as it's already likely to be
     6462MPEG4.</P>
     6463
     6464<P>As an example, you could configure the Default profile for
     6465"Hardware DVB Encoders" (the profile group used for DVB cards,
     6466including the ATSC HD type cards like pcHDTV 3000) to "Enable
     6467auto-transcoding."  In the Default profile for MPEG2 Encoders (PVR
     6468cards) you'd leave "Enable auto-transcoding" unchecked.  For programs
     6469that are available on both kinds of cards (think Law & Order, which is
     6470available on virtually every channel) you'd set the recording profile
     6471to Default and enable auto-transcoding in the record settings.  Then
     6472you pick your transcoding profile.  When Law & Order plays on your DVB
     6473card, it will get transcoded.  When it plays on a channel available
     6474via your PVR card, it won't be.</P>
     6475
     6476<sect2>Manual Transcoding
     6477<P>Manually transcoding a recording is also possible.  It can be
     6478activated while watching a show by hitting 'x', or from the OSD menus
     6479by choosing the Transcode option, or by choosing Job Options/Transcode
     6480from the info menu accessed from the Watch or Delete Recordings
     6481screens.
     6482<p>The transcoding profile used for manual transcoding is whatever you
     6483set when you originally configured this recording, even if you didn't
     6484enable auto-transcoding.  The only way to change what transcoding
     6485profile will be used is to alter the transcoder column in the recorded
     6486table in the database.  The transcoder column contains a number which
     6487corresponds with the id column in the recordingprofiles table.  You
     6488can find out the id number for each profile in the transcoder group
     6489with an SQL command like:
     6490
     6491<tscreen><verb>
     6492mysql> select r.* from recordingprofiles r,profilegroups p where p.name='Transcoders' and p.id=r.profilegroup;
     6493+----+----------------+------------+------------+--------------+
     6494| id | name           | videocodec | audiocodec | profilegroup |
     6495+----+----------------+------------+------------+--------------+
     6496| 21 | RTjpeg/MPEG4   | MPEG-4     | MP3        |            6 |
     6497| 22 | MPEG2          | MPEG-4     | MP3        |            6 |
     6498| 27 | High Quality   | MPEG-4     | MP3        |            6 |
     6499| 28 | Medium Quality | MPEG-4     | MP3        |            6 |
     6500| 29 | Low Quality    | MPEG-4     | MP3        |            6 |
     6501+----+----------------+------------+------------+--------------+
     65025 rows in set (0.01 sec)
     6503
     6504mysql>                                                                       
     6505</verb></tscreen>
     6506
     6507<p>Armed with the knowledge of what the profile ID's are you can also
     6508choose to run mythtranscode from the command line explicitly
     6509specifying the transcoder profile.  Run mythtranscode with --help for
     6510usage information.
     6511
     6512
    63886513<sect1>Changing your hostname
    63896514<!-- Edited instructions from a post by Alan Snyder ax763 at yahoo.com -->
    63906515<p>If you need to change the name of the computers used with MythTV you'll