Translogo is a filter designed for MPlayer and Mencoder that removes the transluscent water marks that are added to program content by television brodacasters. Its construction was motivated by the decision of the Australian ABC to start using an unnecessarily large and coloured logo as part of their attempt to create a new brand awareness. If they had stuck to using an unobtrusive logo, this software would not have been created.
Translogo attempts to return the image to the state it would have had had the logo never been added. It is able to do this because the original image data continues to exist in the program stream, albeit in a degraded form. The result is typically good enough that the remains of the logo are just only visible, and at that only on some images, if the viewer is looking directly at it.
This process collects information about the logo for later use during logo removal. It needs to be done once initially for each logo that needs to be removed, and again if the logo is changed or moved. Choose a name for output logo removal data file, tlg_filename. By convention this ends with ".tlg". You will want to name this file in a way that tells you which television channel it relates to.
To create the tlg_filename file execute the command
tlcapture tlg_filename mpeg_filenamewhere mpeg_filename is a recorded television program containing the logo. This needs to be in double quotes (") if it contains a space (great idea Microsoft, file names with spaces in - it creates no end of fun). Do no use filenames containing a hyphen.
Some television programs are better than others for this. Translogo needs to find at least two frames containing the logo on a lightish background, and two on a darkish barkground. Some drama is so dark bother figuratively and physically that Translogo cannot find the light background images it needs. News programs and other programs that use graphics are a better bet. That said, many ordinary programs will do.
The first thing Translogo has to do when capturing the logo removal data is to determine where the logo is on the screen. It typically requires 3 to 5 minutes of program to do this, though it can take longer. If necessary use MPlayer's -ss option to start processing at an offset from the beginning of the mpeg to avoid having Translogo looking at extended periods, such as commercial breaks, that do not contain the logo. For example
tlcapture tlg_filename mpeg_filename -ss 2:50would start 2 minutes and fifty seconds into the file.
If you are finding that the resulting logo removal data is not working, then try using the command
tlcapture "dummy:dumpCapture:maxLogoAttempts=10" mpeg_filename(the quotes are required for Windows, but are optional for Linux). This will output files containing
Note that the images have a distorted aspect ratio - this is normal.
You can then look through the resulting images, and choose the tlg file that worked. You can change the number 10 above to something else - just bear in mind that increasing it by one allows up to six additional files to be created.
If Translogo seems to be getting the wrong idea about where the logo is, see the advanced section. Note that if there are periods in the program where the logo is not shown, it is possible for Translogo to get the position right, but to happen to use a snapshot from the program that doesn't contain it. This is not in itself a problem, and if a tlg file is created, you may well find that it works correctly.
Once the tlg file for a channel has been created using the steps given above, an mpeg recorded from that channel can be played,using the command
tlplay tlg_filename mpeg_filenamePut the mpeg_filename in quotes if it contains a space.
You can add other MPlayer options to the end of the tlplay* commands. One in particular that you might want to use is -fs, which causes a full-screen display.
Note that Translogo removes the logo from the program material whether or not it is there. The effect of removing the logo when it is not there is to add a colour negative version of the logo. You will likely see this between programs or, for commercial channels, during advertisements.
Most programs on digital television channels are now transmitted in 16x9 aspect ratio. If you're watching the program on a screen with 4x3 aspect ratio, you can crop off the edges of the picture to make the picture fit without black borders at the top and bottom. Use the command
tlplay43 tlg_filename mpeg_filename
A half-way solution is also available, which removes some of the sides of the picture, and introduces some black border at the top and bottom
tlplaysemi43 tlg_filename mpeg_filename
Some stations move their logos around, perhaps due to inconsistency, or perhaps with a view to defeating software like this. However, Translogo provides a solution. While the program is playing, press Shift-L (that is, while the Shift key is pressed, press the L key). This puts MPlayer into a mode where it sends keyboard input to Translogo. You can then use the cursor keys to change the location where the logo is removed. Press the S key if you want to save the change to the tlg file. Press Enter to revert to using the keyboard for its usual MPlayer function. Note that Translogo will display the caption "Translogo" on the screen for a short time if you press any other key while it is in logo moving mode. This is to remind you that you need to press the Enter key to revert to the normal mode.
You can specify multiple tlg files on the command line by separating them by hyphens. For example
tlplay chan1.tlg-chan2.tlg-chan3.tlg
Initially the first specified tlg will be used. To switch between them, press Shift-L, as described above for changing the position of the logo, and then use the Page Up and Page Down keys to cycle through the alternative files. Press Enter to revert to using the keyboard for its usual MPlayer function.
The details of using MPlayer to watch live digital television are beyond the scope of this document, but it does work under Linux with a suitable Linux compatible digital TV card. If you are able to get MPlayer working in that way, then you can use Translogo to remove logos from live television. The ability to move the logo position and change tlg files while playing is of particular use in this case.
See MPlayer's MPEG decoder page, which has a discussion about using MPlayer to watch digital television.
If you want to use some other software to watch the program with the logo removed, you will have to use Translogo to create a new mpeg file from the original.
Use a command of the form
tlrmlogotlg_filename input_mpeg_filename output_mpeg_filename
See the comment about removing logos that are not there.
If you want to use this software under Linux, you need to:
Either download this source snapshot that I obtained on 2nd July 2009, or download a more recent source snapshot from the Mplayer project site. Note that in the latter case, there is no guarantee that the patches discussed below will work.
Whichever course you adopt, you'll need to unpack it. At the time of writing, it is a bz2 file, so the tar command tar -xjf filename will unpack it.
Apply the translogo.diff patch file to it. See below for details about patching.
Configure using the command
./configure --enable-x11 --enable-xv --enable-png
make
Install it using the command
make installYou will need to be root to do this.
sh installScripts.sh
If you're not logged in as root, this will prompt you for the root password.
If either of the two files copied into the .mplayer directory under your home directory already exists, then they will have been renamed with the suffix .old.
If the file subfont.ttf does not already exist in the .mplayer directory, then a symbolic link is created for it, pointing to /usr/share/X11/fonts/TTF/luximb.ttf. If that file does not exist then the installation script will say so and not create the link. In that case you should create a link to a ttf file that does exist. Failing that, you will not get any text in MPlayer's on screen display.
To apply a patch file, go into the root directory of the downloaded source tree, and use the command
patch -p1 <diff_filewhere diff_file is the path of the patch file.
Copyright laws vary, so you will have to do your own research to see whether your intended use of Translogo violates the copyright law of your jurisdiction.
mplayer -vc mpeg12 -vf screenshot mpeg_filenameon an mpeg of a broadcast that contains the logo. Press the S key to create a screenshot. You do not need to be selective. Any screenshot containing the logo will do. MPlayer will put the screenshot into a PNG file, whose name it tells you, in the current directory. Rename it to be fullImage.png.
Use an image editor such as MS Paint to create another image which consists of a cropped region around the logo, leaving a border at least 10 pixels wide. Save it as croppedImage.png.
If you are using MS Paint, the way to go about this is to use the area select tool, which is the one annotated with a dotted rectangle. Select the region containing the logo. Then press Control-C. Now select File-New to create a new blank image. Use the mouse to grab the little dot at the bottom right of the image and move it towards the top left until there is just a small square left. Release the dot, and press Control-V. The result is an image correctly sized to hold just the cropped region which is pasted in. Save it as croppedImage.png
The use the tlcapture command including the noAutoFind option:
tlcapture "tlg_filename:noAutoFind" mpeg_filenameThe quotes are required on Windows, but are optional under Linux.
Examination of the tl* programs will reveal them to be scripts that invoke mplayer and mencoder specifying Translogo as a filter. One of the parameters to the filter in tlcapture is fromFile=translogoCapture.cfg. The file name refers to a configuration file that is found either in the current directory, or if it does not exist there, then in the mplayer configuration directory. The configuration directory is the same as the directory containing the executable under Windows, and is the directory .mplayer in the home directory of the current user under Linux.
There are various other options which are described in the configuration file supplied. Those options can also be specified in the Translogo filter specification in the command line. Under Windows the entire operand then needs to be enclosed by double quotes. Options that appear on the command line override those in the configuration file.
Because of the way the tl* scripts work, other Translogo options can be appended to the tlg filename, separated from it, and each other, by a colon.
This web page and the material it references is copyright Sylvia Else, except where I indicate that material originates from another source. The material that I hold the copyright on is licenced to you for use under the GNU General Public License.
Under Linux using the Intel Corporation 82815 CGC [Chipset Graphics Controller] (rev 02) the tlplay* scripts display the image with the wrong aspect ratio if run in a window. The correct aspect ratio is used if the display is set full screen by means of the -fs option.
To contact me, please email sylviaw75@cryogenic.net.
There is a Yahoo group for discussion of issues relating to Translogo.