[mythtv-users] Slightly OT: Burning an MPEG2 file that is too large

William wmunson at rochester.rr.com
Sat Jan 14 13:45:03 UTC 2006

> I am trying to burn a MPEG2 recording exported by nuvexport, 
> but it is too large to go on a single layer disc!

Here is the script I use to shrink and burn a non-menued dvd that autoplays
a single program. Check the section on shrinking the video for a working

When I run this script the video and audio have already been split into 2
files by avidemux2. The files are named aud and vid and I will let you
figure out which is which :)



rm -drf mydvd
rm -f mydvd.tmp
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 * 1.05" | bc -ql`

if [ ${req:0:1} = "." ];   
   echo Shrinking not required!!
   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 
   nice -n 19 tcrequant -i vid-full -o vid -f $req2  

nice -n 19 mplex -f 8 -V -O -3016mpt -o mydvd.mpg aud vid
#rm aud
#rm vid
echo "creating dvd file system"
nice -n 19 dvdauthor -o mydvd -f mydvd.mpg
nice -n 19 dvdauthor -o mydvd -T
#rm -f mydvd.mpg
echo Burning DVD
nice -n 19 growisofs -dvd-compat -Z /dev/hdd mydvd

More information about the mythtv-users mailing list