« Home | Tip #3: Importing downloaded TV shows into MythTV » | Tip #2: How to Customize MythTV's Menus » | Tip #1: MythTV's New Edit Keys Feature (0.19) » | Introduction to MythTV Tips » 

Friday, May 26, 2006 

Tip #4: Transcode profiles for HDTV

The Problem I was having transcoding HDTV


One of the biggest issues with recording HDTV is that the files are huge. Also, mythtranscode's ability to transcode HDTV was spotty prior to 0.19. My old solution was to use ProjectX to demux the Transport Stream and transcode (with ffmpeg) to resize, convert to MPEG-4 (XviD) and remux. If I wanted to maintain the best quality, I would use two passes, and this solution was *sloooooow* and very manual.

Mythtranscode works now! ...What's next?


With 0.19, mythtranscode has been rock solid transcoding my HD Transport Streams. It's also blazingly fast! Once I started using it, though, I realized that the default profiles didn't work for me. I had three different sources of DTV:

  • 1080i
  • 720p
  • 480i

I also have several different desired output formats:

  • No Resize - High Quality (De-Interlaced)
  • Resize to 960x540 High Quality (De-Interlaced)
  • Resize to 634x352 Med Quality (De-Interlaced)

Because of all the combinations, I wanted the following Transcode profiles:

  • 1080i - NoResize
  • 1080i - Resize High
  • 1080i - Resize Med
  • 720p - NoResize
  • 720p - Resize High
  • 720p - Resize Med
  • 480i - NoResize


Great... Now how can I do that?



With MythTV, you are given some profiles for transcoding (Default, Live TV, High Quality, Low Quality), which you can modify, rename, etc; however, it does not allow you to create new transcoding profiles through the UI, so I went to the database (mythconverg). Once I figured out all of the tables that are involved in the transcoding process, I went to work.

The three tables I'm interested in are: profilegroups -> recordingprofiles -> codecparams



Modify Transcoder Profile Group


First, we want to modify the Transcoder Profile Group. From mythfrontend, select: Setup -> TV Settings -> Profile Groups -> Transcoders. This will drop you into the recordings profile screen where you will see the four default profiles: Default, Live TV, High Quality, Low Quality. These are generally not good enough for the needs of HDTV folks. The next step will show you how to customize those recordings profiles, and even create a few more.

Modify existing recordings profiles



  • From mythfrontend, select the first profile 'Default'.
  • Replace the name 'Default' with 1080i NoResize.
  • Make sure Lossless transcoding, and Resize video while transcoding are not checked, and select Next.
  • Now set up your code params. I use the following settings:


    Click to enlarge

  • Click 'Next'. On the 'Audio Quality' screen, choose Uncompressed, and 48000 as the sampling rate.
  • Click 'Finish'.


Repeat this for each of the remaining profiles (Live TV, High Quality, Low Quality) renaming them as you go.
For example:
For 1080i Resize High Quality
Rename Live TV -> 1080i Resize High
Check 'Resize Video while transcoding'
Width: 960 Height 540
Codec: MPEG-4
Bitrate:2400
Maximum quality:2
Minimum quality:15
Max diff between frames:3
Check all boxes except Scale bitrate for frame size
Audio Settings:
Codec:Uncompressed
Sampling rate:48000
Volume:90%

Now... When you use the last profile and you need to create another one, you need to add an entry to the recordingprofiles table. Do this by executing:

mysql> insert into recordingprofiles (name,videocodec,audiocodec,profilegroup) values ('480i Resize','MPEG-4','Uncompressed','6');
Query OK, 1 row affected (0.01 sec)

Now when you go back into your transcoders screen, you will see the new profile and you can modify the settings appropriately.

Additional Notes

When creating the profiles for 720p source content be sure to uncheck to two boxes Enable Interlaced DCT encoding and Enable Interlaced Motion Estimation.

My bitrate and widthxheight settings are as follows:

  • 1080i - NoResize - 4526 na
  • 1080i - Resize High - 2400 960x540
  • 1080i - Resize Med - 1300 624x352
  • 720p - NoResize - 4559 na
  • 720p - Resize High - 2400 960x540
  • 720p - Resize Med - 1300 624x352
  • 480i - NoResize - 900 na

I leave my bitrates higher than they probably need to be, but I have not had time for a tremendous amount of experimentation, and the settings yield enough of a decrease in filesize that it works for me.

Good Luck, and if you have any comments, please feel free to leave them here.


Great info !

Hope to try it with HDTV from firewire. Could be a problem as the firewire source doesn't show any recording profiles but maybe this is a bug on my system.

any command line solutions to transcoding?

You can use mythtranscode from the command line, or, depending on how portable you want the final file to be, you can also use nuvexport (which also works with HDTV programs now).

I set up using tip 4: however my files in video/recordings are not being transcoded, they are still in the original MPEG2 from recording. Are transcoded files put elsewhere by mythtv? I tried default transcode using autodetect and specific transode profile.
There are no transcode mentions in the mythbackend log at all.
When I try mythtranscode it tells me it can't find profile for MPEG-2.
any tips?
(Mythdora 3.2)
thanks
Bruce

I was happy to find this link and the profiles now look good in the setup screen, but how do I use them? All I see for options is Default, Autodetect, High/Medium/Low Quality

Post a Comment

Links to this post

Create a Link