[mythtv-users] Tutorial on Encoding (mostly re: file sizes)

Robert Denier denier at umr.edu
Tue Sep 20 21:11:05 UTC 2005


On Tue, 2005-09-20 at 15:58 -0400, Brian McEntire wrote:
> When resizing, is it possible to accidentally stretch the image?
> 
> I saw someone say 480x480 wouldn't be a noticeable difference from
> 720x480... is the because of the way a TV uses scan lines? On a
> monitor it seems like it would be very different.

To be fair there are two issues here.  First of all you have the
immediate source of the signal.  In general they will be

1) Pure analog
2) Some form of mpeg compression

If you have dish network afaik they encode normal channels with 480x480
mpeg 2 compression.  In general this will limit the frequency content in
the signal so that it is not useful to sample it at a higher resolution
than 480x480 again.

Of course with the case of the number of lines, that is a fixed quantity
and you simple sample at 480 lines and be done with it.  In the case of
the horizontal resolution this is not 100% true since, unfortunately,
you can't sample the exact same positions as were originally encoded,
and there is always the case of noise being added due to the digital to
analog conversion.  (The noise may increase the frequency content of the
signal, and thus require a higher sampling frequency to preserve the
information content.  Of course, it is quite possible the capture card
will filter out high frequency noise before capturing data anyway.)

In the case of a typical myth setup, you will likely see some black bars
on the side of your encodings meaning your capture card is possibly
sampling parts of the tv signal that has no data and dish network never
encoding anything into, so that to, be paranoid, and assure you are not
losing quality you might have to sample at a bit more than 480 pixels
horizontally.  Perhaps 512x480 or 640x480 for instance.

Of course things are not that simple either.  As you increase the
sampling resolution, you must also increase the bit rate of the encoding
to avoid degradation.  This is why a 480x480 encoding may look better
than a 640x480 encoding if the bit rates are the same.

If in doubt, try various settings and compare them.  There are a lot of
factors here, and the vague arguments I made only make a case for not
going too much beyond what the signal was originally encoded as.  In the
case of a pure analog signal that was received by an aerial, things are
different and it may indeed help to go 720x480 or 640x480, provided you
also give the codec a large enough datarate to handle the video.

Finally, if you absolutely know you are going to transcode something
anyway, you generally want to have the capture size set to whatever your
final size will be, and set the initial capture datarate a bit on the
high side so you preserve as much quality as possible prior to the final
transcoding to mpeg4 or whatever.  I used to use huffyuv for captures in
windows, even though it used a very high datarate, because I wanted the
initial encoding to be lossless, before I edited the system and
converted it to mpeg.  (Huffyuv is probably too high of data rate for
myth and useless with cards designed to capture in mpeg2 anyway since
you would have to add a pointless recompression.)

> 
> I'm curious because I want to transcode HDTV  (1920x1080, 1280x720,
> and 850x480) down to 850x480.
> 
> For HDTV pulled off of QAM/Cable, I'm seeing MPEG2 file sizes of about
> 6.2 GB/hr.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users



More information about the mythtv-users mailing list