[mythtv-users] DVD Burning

Nick knowledgejunkie at gmail.com
Fri Mar 3 16:39:21 UTC 2006


On 03/03/06, James Pifer <jep at obrien-pifer.com> wrote:

> Hi. I finally had a chance to use your script. I made some minor
> modifications. It all worked fine. The only question I have is on the
> reduction of the video. I have a recording that is 6.6 gig and to save
> space I want to stick it on a DVD. The script, or the reduction part,
> took it all the way down to 3.3, basically one half. Is that the way
> it's supposed to work or should it try to get closer to 4.35? It seems
> like that's the goal in the script, but that's not what happened. Maybe
> it's a limitation of tcrequant?
>
> Thanks,
> James
>
> Here's that part of the script.
>         echo Checking video size...
>         # Calculate the requantization factor
>         vsize=`ls -l ./vid | awk '{print $5}'`
>         vsize=`echo $vsize / 1048576 | bc`
>         asize=`ls -l ./aud | awk '{print $5}'`
>         asize=`echo $asize / 1048576 | bc`
>         req=`echo "($vsize + $asize) / 4350" | bc -ql`
>         req2=`echo "$req * $req" | bc -ql`
>
>         if [ ${req:0:1} = "." ];
>         then
>            echo Shrinking not required!!
>         else
>            echo Shrinking the video to fit the disc. Please wait...
>            echo Reduction Factor: $req2
>            echo Note: vid has been saved as vid-full
>            mv -f vid vid-full
>            tcrequant -i vid-full -o vid -f $req2
>         fi

In my experience of using tcrequant to requantise video, you want to
use as small a requantisation factor as possible, as the higher this
factor is, the more reduced the video quality is.

I don't think that the total data size (audio plus video) should be
used when determining the requantisation factor. Surely, the factor by
which the _video_ data needs to be reduced is the ratio of the size of
the original video data divided by the total required data size (4350
in the script) less the audio size:

RCF = $vsize / (4350 - $asize)

For example with simple numbers, if the original demuxed files were
9.0GB video, and 200MB audio, and the desired data size was 4.7GB, the
factor would be calculated as:

RCF = 9000 / (4700 - 200) = 2.00

Here the video size after requantisation would be 4.5GB, which when
added to the 200MB audio, gives a total datasize of 4.7GB, which is
the capacity of the disk. Obviously there is an amount to be allowed
for filesystem/DVD structure overhead, but this should give you a
maximally utilised disk.

Using the 6600MB total data size and assuming 300MB for audio and a
disk size of 4350MB, I would use a RQ factor of

RCF = 6300 / (4350 - 300) = 1.56

The above scrip would give you a factor of ( (6300 + 300) / 4350 ) ^2
= 2.3. This when applied to the video and then adding back the audio
data would give a new DVD size of approx 3.0GB which is broadly in
line with your experience.

The audio is not requantised, so I don't believe the size of the audio
data should be combined with the video data size to determine the
factor to be used. The amount of space allowed for the video oon the
DVD should be determined by subtracting the audio size from the total
DVD capacity, and then the ratio of the video size to the remaining
space should be used for the requantisation factor.

I may have missed something very obvious, but this is the method I use
to get full DVD disks when requantising DVB recordings that are too
large for a DVD.

Nick


More information about the mythtv-users mailing list