cd /tmp rm -rf translogoInstall mkdir translogoInstall mkdir translogoInstall/linux cd translogoInstall/linux cat <tlcapture #!/bin/sh if [ -z "\$1" -o -z "\$2" ]; then echo "tlcapture tlg_file mpeg_file [extra_mpeg_opts]" 1>&2 exit 1 fi tlgFile="\$1" mpegFile="\$2" shift 2 mencoder \\ \$* \\ -profile translogoCapture \\ -vf translogo=fromFile=translogoCapture.cfg:tlg=\$tlgFile \\ -o /dev/null \\ \$mpegFile EOF chmod 755 tlcapture cat <tlplay #!/bin/sh if [ -z "\$1" -o -z "\$2" ]; then echo "tlplay tlg_file mpeg_file [extra_mplayer_opts]" 1>&2 exit 1 fi tlgName="\$1" mpegName="\$2" shift 2 # mplayer \$* -cache 2048 -aspect 16:9 -vc mpeg12 -vf translogo=tlg=\$tlgName,screenshot=yes \$mpegName EOF chmod 755 tlplay cat <tlplay43 #!/bin/sh # if [ -z "\$1" -o -z "\$2" ]; then echo "tlplay tlg_file mpeg_file [additional_mplayer_options]" 1>&2 exit 1 fi tlgName="\$1" mpegName="\$2" shift 2 # Note: Include the scale. Some hardware seems to get confused if the image # isn't of size 720x576. mplayer \$* -cache 2048 -vc mpeg12 -vf translogo=tlg=\$tlgName,screenshot=yes,crop=540:576::,scale=720:576 \$mpegName EOF chmod 755 tlplay43 cat <tlplaysemi43 #!/bin/sh if [ -z "\$1" -o -z "\$2" ]; then echo "tlplay tlg_file mpeg_file [additional mplayer options]" 1>&2 exit 1 fi tlgName="\$1" mpegName="\$2" shift 2 # Note: Include the scale. Some hardware seems to get confused if the image # isn't of size 720x576. mplayer \$* -vc mpeg12 -vf translogo=tlg=\$tlgName,screenshot=yes,crop=630:576::,scale=720:576 \$mpegName EOF chmod 755 tlplaysemi43 cat <tlrmlogo #!/bin/sh if [ -z "\$1" -o -z "\$2" -o -z "\$3" ]; then echo "tlremovelogo tlg_file input_mpeg_file output_mpeg_file [additional_mencoder_options]" 1>&2 exit 1 fi tlgName="\$1" inputFile="\$2" outputFile="\$3" shift 3 mencoder \$* -aspect 16:9 -vc mpeg12 -of mpeg -profile dvd -vf translogo=tlg=\$tlgName,harddup \$inputFile -o \$outputFile EOF chmod 755 tlrmlogo cd .. mkdir mplayer cd mplayer cat <mencoder.conf [translogoCapture] of=rawvideo=yes ovc=raw=yes noaspect=yes vc=mpeg12 vf=translogo=fromFile=Capture.cfg nosound=yes [dvd] forceidx=yes oac=lavc=yes ovc=lavc=yes mpegopts=format=dvd:tsaf=yes srate=48000 af=lavcresample=48000 lavcopts=vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:aspect=16/9:acodec=ac3:abitrate=192 EOF chmod 755 mencoder.conf cat <translogoCapture.cfg # Operation mode - either capture or process. Defaults to process. mode=capture # The name of the logo data file. This file is input when the mode is # process, and created if the mode is capture. This option is required # in process mode, or if the dumpCaptured option is not present in capture # mode #tlg=channel.tlg # A complete image captured from a program. # # In noAutoFind mode, the full image from which the file specified # in the cropppedImage option was created. # # In normal capture mode with the dumpCapture option, this option defines # the name of the full image file that Translogo writes to show which # image it tool the cropped image of the logo from. # # This option is required in noAutoFind mode, or if dumpCapture is specified. fullImage=fullImage.png # In noAutoFind mode, a cropped version of the full image that contains the TV # logo and some of the surrounding area. The surrounding area must include at least # borderWidth pixels. # # In normal capture mode with the dumpCapture option, this option defines # the name of the cropped image file that Translogo writes to indicate # where it thinks the logo is. # # This option is required in noAutoFind mode, of if dumpCapture is specified. croppedImage=croppedImage.png # The minimum number of frames to skip between successive captures of # an image that appears to have a light or dark background to the logo. This # is to limit the possibility of acquiring two frames with the same # spuriously constant luminance background. In practice this doesn't seem # to me much of a problem, and having a large value here can limit # the opportunities for capturing a valid logo. So the the default is 1. #interCapture=1 # The minimum brightness of the surround for a logo for it to be considered # a light background. Default is 110, which may seem rather dark, but makes # it easier for Translogo to capture the logo removal data. #lightThreshold=110 # The maximum brightness of the surround for a logo for it to be considered # a dark background. Default is half lightThreshold. #darkThreshold=55 # The maximum variation in the brightness of the surround of a logo for it # to be considered to be of constant brightness. Default is 6. #maxBorderVar=6 # The number of light and dark background images to be captured for # use in determining the logo data. Default is 2. #captureCount=2 # The maximum permitted variation, as a percentage, in the factor by # which a logo pixel is multiplied. If there is more variation than this, # then the logo data is considered spurious and is discared. Default is 10. #maxLuminanceFactorVar=10 # The maximum permitted variation, from 1 to 255, in the adjustment to the # luminance value of a pixel. If there is more variation than this, # then the logo data is considered spurious and is discared. Default is 20. #maxLuminanceVar=20 # The maximum permitted variation, from 1 to 255, in the adjustment to the # colour difference value of a pixel. If there is more variation than this, # then the logo data is considered spurious and is discared. Default is 20. #maxColorAddVar=20 # The width of the border of the logo region that is considered when # determininG whether the logo is in an area of constant brightness. # Default is 5. #borderWidth=5 # The minimum number of pixels in a logo. If the logo data implies a number # lower than this then the logo data is considered spurious and is # discarded. Default is 50. #minLogoPixels=50 # The maximum number of attempts to make at recognising a logo when # dumpCapture is set. Each attempt results in the creation of a number of # captured image files. Default is 5. #maxLogoAttempts=5 # If this option is present, then instead of search the program for the # best logo data, the results of each attempted are output as a set of # files. The default is that this option is not present. #dumpCapture # The prefix used in captured output file images. This is always used # to generated the result of applying the logo data to the image specified # by the fullImage option, but is also used as the prefix of files # generated when the dumpCapture option is present. Default is capture. #capturePrefix=capture # Indicate to Translogo that it should use the images defined by the # fullImage and croppedImage options to define where the logo is, # rather than determining this for itself. Default is not set. #noAutoFind # Defines the maximum value that pixels in 'black' areas that appear at # the edges of the picture, for example when a broadcast is made in # letter box mode. Having this too low can make it appear to Translogo # that the edges of the picture are part of the logo, though even # ordinary broadcasts can have a 'black' border of a few pixels. This value # is only used during auto-finding of the logo region. The default is # 50, because some broadcasters use remarkably light 'black' areas. #maxBorderVal=50 # Specify whether the gradient information used to determine the location # of the logo is to be dumped. This option is only really of use in understanding # how the logo detection is working (or given that the option is being used, not # working). If this option is present, then the information # is output as three PNG files, named luminance.png, blue.png and red.png. # These images show the maximum gradient counts for each pixel in the luminance # blue colour difference and red colour difference planes respectively. Each # pixel in the dumped image is brightest when the gradient count equals the # number of frames, and darkest when the gradient count is zero. # This option also causes Translogo to indicate which plane it used to determine # the location, and it outputs a file named threshold.png which indicates # which pixels in that plane have gradient counts at the used threshold or above. # Such pixels are white. The other pixels are black. The default is that this option # is not present. #dumpGradients # Specify a quadrant of the screen in which to search for the logo when # capturing. Quadrants are nw, ne, sw and se. #quadrant=se # Ignore a number of lines at the top and bottom of the screen when searching for the # logo when capturing. Default is 0. #ignoreLines=0 # Ignore a number of columns at the left and right of the screen when searching for the # logo when capturing. Default is 0. #ignoreColumns=0 EOF chmod 755 translogoCapture.cfg cd ../.. if [ ! -e $HOME/.mplayer ]; then mkdir $HOME/.mplayer fi if [ -e $HOME/.mplayer/translogoCapture.cfg ]; then mv $HOME/.mplayer/translogoCapture.cfg $HOME/.mplayer/translogoCapture.cfg.old if [ $? -ne 0 ]; then exit 1 fi fi cp translogoInstall/mplayer/translogoCapture.cfg $HOME/.mplayer if [ $? -ne 0 ]; then exit 1; fi if [ -e $HOME/.mplayer/mplayer.conf ]; then mv $HOME/.mplayer/mencoder.conf $HOME/.mplayer/mencoder.conf.old if [ $? -ne 0 ]; then exit 1 fi fi cp translogoInstall/mplayer/mencoder.conf $HOME/.mplayer if [ $? -ne 0 ]; then exit 1 fi if [ ! -e $HOME/.mplayer/subfont.ttf ]; then if [ ! -e /usr/share/X11/fonts/TTF/luximb.ttf ]; then echo "X11 font file luximb.ttf is missing - no link created for subfont.ttf" else ln -s /usr/share/X11/fonts/TTF/luximb.ttf $HOME/.mplayer/subfont.ttf fi fi su root -c "cp --preserve=mode,timestamps translogoInstall/linux/* /usr/local/bin" if [ $? -ne 0 ]; then exit 1 fi echo "Script installation complete" rm -rf translogoInstall