Back Forum Reply New

New script function: Deticker

, but I haven't figured out how.

I'm converting an old VHS video of a football game to DVD, and several times during the game they show the score of other games at the bottom of the screen, a.k.a. the quot;ticker.quot;  When they do this, they shrink the picture.  Since I'm archiving this game so I can keep it for a long time, not only did I edit out the commercials, but I also wanted to get rid of the ticker containing results of games I didn't/don't/won't care about.  I realized that the whole picture is actually there (albeit at a slightly lower effective vertical resolution), so all I had to do was reverse the process to eliminate the annoying ticker.

This script does a servicable job of removing the ticker, including the shrink and re-expand at the beginning and end, and taking into account the fact that the video is interlaced.  To use it, I load the video into VirtualDub to get the four frame numbers for the key frames needed by the script:

f0 = the last untouched frame before the image starts shrinking
f1 = the first frame that is at the fully shrunk size
f2 = the last frame that is at the fully shrunk size
f3 = the first untouched frame after the image has finished expanding

Then I figure out the height of the ticker itself, and use this as tickerheight. This should be an even number.

I also wrote the script to only output the video that is actually being quot;de-tickered,quot; since I then placed this modified video onto my editor's timeline to replace the appropriate video.Code:
function Deticker(clip input, int tickerheight, int f0, int f1, int f2, int f3)
{ tickerclip = input.Trim(f0, f3)
tickerinpre = tickerclip.Trim(0, f1 - f0 + 1).SeparateFields() tickerinpost = Animate(0, (f1 - f0) * 2,                    \             quot;LanczosResizequot;,                     \             tickerinpre,                         \             input.width, input.height / 2,       \             0, 0, input.width, input.height / 2, \             tickerinpre,                         \             input.width, input.height / 2,       \             0, 0, input.width, (input.height - tickerheight) / 2).Weave()
ticker = tickerclip.Trim(f1 - f0, f2 - f0 + 1).SeparateFields().LanczosResize(input.width,      \                                                                    input.height / 2, \                                                                    0,                \                                                                    0,                \                                                                    input.width,      \                                                                    (input.height - tickerheight) / 2).Weave()
tickeroutpre = tickerclip.Trim(f2 - f0, f3 - f0 + 1).SeparateFields() tickeroutpost = Animate(0, (f3 - f2) * 2,                                     \              quot;LanczosResizequot;,                                      \              tickeroutpre,                                         \              input.width, input.height / 2,                        \              0, 0, input.width, (input.height - tickerheight) / 2, \              tickeroutpre,                                         \              input.width, input.height / 2,                        \              0, 0, input.width, input.height / 2).Weave()
return(tickerinpost + ticker + tickeroutpost)
}
To use:
Code:
Deticker(AVISource(quot;00 30 00 00.aviquot;), 88, 18262, 18286, 19034, 19056)
I'm sure this can be improved upon.  Some tickers shrink horizontally as well, and I suppose it would be easy to support a ticker at the top, if such a thing existed.

One annoying thing...I noticed a football game this weekend that didn't shrink the picture when it showed the ticker.  It just covered the bottom of the picture.  That means this wouldn't really help for that game.

Xesdeeni
¥
Back Forum Reply New