[mythtv] DVB, (new) recording profiles, and transcoding

Geoffrey Hausheer ou401cru02 at sneakemail.com
Thu Oct 2 14:39:46 EDT 2003


On Thu, 02 Oct 2003 03:25:12 +0100, "Mike Wilcox mike-at-trouble.org.uk
|mythtv/1.0-Allow|" <zo3shm3yrz0t at sneakemail.com> said:
> Hi,
> 
> I've been looking into a few things related to the MPEG2 stream 
> generated by the DVB cards, and come to the conclusion that I need to 
> try to get the transcoder to run on these files.
> 
> My first aim is to be able to get the transcoder to run on the files 
> without re-encoding the stream, but merely honouring the cutlist. After 
> that, I want to experiment with some other things. In turn, I think this 
> means I have to do some work to help correlate between the DVB capture 
> side, the recording profiles, and the transcoding profiles.
First I'd recommend getting the transcoder to work with DVB with full
reencode.  I don't have a DVB card, but this should theoretically work
today (if not, it is an issue with the decoder that needs fixing).  As
for honouring the cutlist and keeping the mpeg2 stream (like we already
do for mpeg4), you need to be able to reencode key frames in mpeg2 format
(because you need to mark a key frame after the 'cut').  I'm not aware of
any legally free tools to do this, but someone had mentioned bbmpeg as an
option (I've not looked into it).

> 
> But I'm a little confused, what with the changes to the recording 
> profiles, plus automatic selection of profile groups in the GUI based on 
> card types, plus a bit of extra confusion because the DVB code re-uses 
> the code and/or term "MPEG2" from the PVR-X50 stuff in some places, but 
> not in others.
This is easy enough.  There are two 'types' of profiles.  the first type
used during normal encoding defines Default, Live TV, LowQ, and HighQ. 
These names are used regardless of the card type, and the correct
preferences are chosen based on the card which is recording.  the second
'type' of profiles are used for Transcoding.  currently only 'MPEG2' and
'RTjpeg/MPEG4' are defined.  These are defined based on the stream type,
and currently the only streams supported are MPEG2, RTJPEG, and MPEG4.  I
suppose MJPEG should be in there too, but I don't have such a card, and
am not sure how to handle it.  DVB is not supported at all for trans
coding, because, again, I don't have the hardware, but it should be
peretty easy (from the transcoders point of view, it should look very
much like the output of a PVR-250).  So there probably needs to be some
massaging there, but I don't think any new profiles are needed (or
perhaps there DOES need to be a 'DVB' profile in the Trancoding group).
> 
> If I've got things understood correctly, then, when altering the setup 
> of recording profiles...
> 
> Selecting a group of "Hardware DVB Encoders", I should get the 4 
> profiles. If I choose "Live TV", I should then be able to set the 
> parameters with which I wanted "Live TV" to be spooled into the disk 
> with (including capture card settings, and any software codec settings). 
> If I select one of the other 3, I should be able to set the parameters 
> for which recordings are made (same capture card settings and software 
> codec settings), then each individual recording may specify one of those 
> 3 profiles.
> 
> Selecting a group of "Transcoders", I should be able to see all the 
> possible file encoding types for recordings originally captured using 
> the profiles above, and for each one, specify new software codec 
> settings for the transcoder to turn the recording into.

Not quite.  As I said above...we can't map profiles to a transcoder (what
if the profile has changed since the recording was made).  So transcoding
decisions can only be made based on format (not based on any other
settings).

> 
> I hope I've got those right... The rest is based on this...
> 
> So, for capturing from DVB cards, we ought to be able to see/change some 
>   setup data for the capture card, plus any additional software 
> transcoding we do between the capture card and the disk.
> 
> These parameters might include, for example, aspect ratio, resolution, 
> but wouldn't include channel tuning parameters, or parameters to 
> determine whether to output the whole TS or individual PES.
The transocder does not support changing aspect ratios or resolution, and
I see no reason to support these (it requires a huge amount more
work...which would be better suited to an external program, perhaps using
the fifo interface).


> 
> As I see it at the moment, there aren't really *any* parameters to set 
> for capture from the hardware - we basically get the stream in whatever 
> MPEG-2 format the broadcaster chose to send it. And right now, there 
> aren't any parameters to set for any intermediate software transcoding 
> before the stream hits the disk either - though I can see the need for 
> some later, perhaps in transcoding from the PVA/PES format of the DVB 
> transmission through some error-correction and/or AV-sync code.
This is all true.  The DVB is a special case in that you have no control
over what format you get the stream in.  Are there any controllable
parameters? if not, then we can just have the 'Default', Live TV', etc
profiles have a single switch in them (whether or not this program should
be auto-transcoded).

> 
> Today, the setup for the DVB capture cards still allows us to set 
> parameters as though its a V4L device, and I guess this should change.

Removing these options is trivial if they can't be implemented.
> 
> Similarly, when we want to setup the "Transcoders", we need to allow 
> transcoding from the DVB-MPEG2 into the existing RTjpeg and MPEG4 
> codecs, but we also need to allow a specification that the transcoding 
> should not re-encode either video or audio (or probably both), or to 
> force certain settings if the stream is not already of that format.

Again as I said before, the first part should 'just work' today...or need
a minimal amount of changes.  Keeping MPEG2 streams needs more work.  The
easiest way to think about this is to assume you know nothing about the
stream besides what is stored on the disk (i.e. make no decisions based
on cards in the system, or any other encoding options).  anything which
is contained in the actual video file is fair game for making transcoding
desicions.

> 
> Today, we have two profiles for the transcoder: "MPEG2" and 
> "RTjpeg/MPEG4", but they appear to only allow to transcode towards the 
> RTjpeg and MPEG4 codecs - I don't see how you can configure the MPEG2 
> transcode to *not* re-encode (but I've read in the lists that it does. 
> Is this true?)

You can't (as above).  MPEG4 is the only format that can be 'commercial
clipped' without reencoding (until this is fixed).

> 
> Of course in deciding whether re-encoding is required for DVB, we won't 
> be able to compare all the capture settings with some transcoding 
> settings, as we have just taken the stream as the broadcaster sent it. 
> Recordings will be at different resolutions (certainly), with different 
> audio settings (possibly). I think we really will need some settings 
> that state "don't change".

This will need some thought.  We could easily make transcoding decisions
based on resolution/format parameters, but making this into an intuitive
interface may be challenging. 

> 
> Are my thoughts/conclusion right sofar? Am I heading down the right path 
> here?
Since I now have a PVR250, and have no other myth work on my plate, I'll
start on the first part now, and see if I can remove commercials without
reencoding the MPEG2 files.  That should leave the way open to all the
rest of the changes you will need.  I think the hardest part will be
coming up with a good interface to control which programs get transcoded
and which don't, and I haven't any clue on that.  

.Geoff


More information about the mythtv-dev mailing list