logo Sign In

Counter/logo removal on MPEG2 file

Author
Time

 

Nothing fancy, I just want to blur the counters so that they aren't so distracting.

The source file is an NTSC DVD, so I need something to do the trick from the actual MPEG2 source.

Ohh, and please keep in mind my newbie status :-)

Visit my *NEW* Star Wars on Video Collection site:

http://www.swonvideo.com

Author
Time

A fairly simple script in AviSynth could do this. How much do you know about AviSynth?

Firstly, you load the MPEG2 source using DGMPGDec. Then crop the black bars - this in itself removes half the counter.

To remove what's left, create a black & white BMP in MS Paint to use as a mask with the AVSInpaint plugin.

Then just add the black borders back in to make the resolution back up to 720 x 480.

Guidelines for post content and general behaviour: read announcement here

Max. allowable image sizes in signatures: reminder here

Author
Time

Thanks Moth3r.

I am a complete noob with Avisynth, but I know my way round Google :-)

I ran the script with VirtualdubMod, and found the result too distracting in motion. The filter has to cover a square block, with very little image area to sample from, so I think a simple blur effect would be less distracting. What filter would you recommend for a simple blur?

Here are the steps I need to cover in as few renders as possible.

1. Crop out the black bars.

2. Resize the remaining image to 720x480 (anamorphic)

3. Blur what's still visible of the counters.

4. Output to MPEG2 again

What would such a Avisynth script look like, and what programme do you recommend to run it?

I just want to do this with as little generational loss as possible, without having to go through lossless AVI. (If at all possible? Noob, remember.)

Any and all help is greatly appreciated.

Fritz.

Visit my *NEW* Star Wars on Video Collection site:

http://www.swonvideo.com

Author
Time

This is the way I'd do it, though I have no idea how to do this in AviSynth or VirtualDub.

Unless you think that'd be too distracting.  If that were the case, I'd just crop the top and bottom of the frame, i.e. make the letterboxing big enough to cover the timecode.

Author
Time

Video Collector said:

Thanks Moth3r.

I am a complete noob with Avisynth, but I know my way round Google :-)

Wow, that is ugly. I think that the inpainting method is best suited for removing "line" feautures like text, scratches or hairs.

I ran the script with VirtualdubMod, and found the result too distracting in motion. The filter has to cover a square block, with very little image area to sample from, so I think a simple blur effect would be less distracting. What filter would you recommend for a simple blur?

To be honest I'd probably go with Ash's recommendation of overcropping - probably less distracting than a black box or blur. Other options are described here or here.

Here are the steps I need to cover in as few renders as possible.

1. Crop out the black bars.

2. Resize the remaining image to 720x480 (anamorphic)

3. Blur what's still visible of the counters.

4. Output to MPEG2 again

What would such a Avisynth script look like, and what programme do you recommend to run it?

MPEG2Source("yourfile.d2v")
Crop(..crop settings..)
Lanczos4resize(..to 16:9 anamorphic size..)
..logo removal filter here..

I would recommend AvsPmod for previewing the script output and adjusting the parameters. You can choose any MPEG-2 encoder you like - HCEnc is a good free one.

I just want to do this with as little generational loss as possible, without having to go through lossless AVI. (If at all possible? Noob, remember.)

Yes it is possible - just use the AviSynth script as the sourcce for your encoder. The main reasons for using lossless AVI are when the script is very slow and you want to run a multipass encode, or if you want to get the video into another editor like Vegas, etc. 

Guidelines for post content and general behaviour: read announcement here

Max. allowable image sizes in signatures: reminder here

Author
Time

Since the counter is on a black background, there is no point trying to do anything really besides what CA mentioned

Especially with the source, the Cyborg DC, idk what purpose this would server since the original quality is pretty bad, taken from multiple sources (at least 3) and the counter doesnt run throughout the film

Just paint out the counter in black with overlay to match the borders and turn it on in AVS when counter appears in the movie, which isnt all the time

Moth3r said: No, there is no video embedding option in this forum software (thank god!)

 

Author
Time

Sir, I am well aware of the condition of the materials I'm working with, thank you. Instead of telling me what you consider pointless, would you offer some advice on actually doing what you advocate?

The image fills the screen once I correct the aspect ratio to anamorphic 1.78:1. Therefore no need to worry about black borders. All I'm left with are two rectangles that need to be covered by a black mask.

Does anyone know how to do this with a subtitle overlay? As CompMovieGuy said, it would have to be timed to come and go as the counter comes and goes.

 

 

Visit my *NEW* Star Wars on Video Collection site:

http://www.swonvideo.com

Author
Time

Thanks everyone.

Logoaway was just what I was looking for.

The preview function for that plug-in was a godsend.

In the end, I just used Virtualdub with the Logoaway filter, saved to lossless AVI and did the cropping, scaling and encoding in TMPEG (Lanczos algorithm).

The DC of Cyborg actually looks pretty decent now. At least the aspect ratio is correct, and the blur effect is far less distracting than the counters IMO.

Visit my *NEW* Star Wars on Video Collection site:

http://www.swonvideo.com

Author
Time

Any chance of a screenshot example of how this turned out, Video Collector?  Interested to see how it looks now.

Author
Time

For VirtualDub, there's also the MSU Logo Remover that looks to be a little more advanced than Logoaway.

(Looking at the other filters available on that page, the one for removing hard-encoded subtitles looks like it might be useful.)

Guidelines for post content and general behaviour: read announcement here

Max. allowable image sizes in signatures: reminder here

Author
Time

 

First off: Garbage in, garbage out. The DVD-R sold by the director himself (signed, even!) is a dub of his personal VHS copy. He makes no attempt to deceive anyone about the quality of this tape, there's even clips of it on the homepage to make sure people know what they're getting. That being the case, the constantly changing aspect ratios were just too much. I'm considering sending him a copy of my reworked DVD for him to use as master for further customers.

I took this as an opportunity to familiarize myself with VirtualDub and AVIsynth (although AVIsynth was eventually not used).

Here follows a general description of my processes.

(These framegrabs (from MPC) are in square pixels, so they look a bit off. They're correct when displayed anamorphically.)

Step 1:

Ripped the DVD (actually not encrypted, so just drag'n drop the VIDEO_TS folder in Explorer.

Used TMPGEnc 4.0 Xpress "Source Wizard" to extract the .MPG file.

As you can see, the aspect ratio is all fouled up. God knows why, but the source switched between this, 4x3 in a 16:9 frame (anamorphic) and fullframe 16:9 anamorphic. Only the sections with the mangled aspect ratio had counters on it (about 2/3 of the runtime)

"Raw" video from the DVD:

Step 2:

Ran the Logoaway filter in VirtualDubMod. I had to run two Logoaway filters in succession, one for the top counter, one for the bottom. I only ran the filter in the active image area to not contaminate it with image info from the black bars. The preview function of the filter was invaluable in finding the best settings. The top and bottom filters needed different settings to look okay. I found the "UGLARM" setting at max to be the best, YMMV.

I chose to apply the filter before resizing, as I believe this was the fastest way, leaving it a smaller area to rework. If I resized the image first, the counters would take up more realestate as well, leaving a bigger area to process for the filters. Furthermore, I had hoped that the blurring would be a little less obvious if I applied it prior to resizing, and that it would blend in just a little bit better (slightly softer edges to the blurred area after resizing). Not sure it made a difference.

Output to lossless AVI from VDubMod.

Resulting image with Logoaway filter applied:

 

Step 3:

Cropping and resizing the uncompressed AVI in TMPGEnc 4.0 Xpress, using the built-in Lanczos3 algorithm. I could have applied the cropping and resizing in VDubMod, but I am more familiar with TMPEG and it is WYSIWYG. Resized to 720x480 anamorphic.

Then encoding to MPEG2 using the max average bitrate that would fit a 1h:22m film on a DVD5 (7100mb/s). TMPEG recompresses the sound as well, but I couldn't be bothered demuxing the original file and muxing the 193kb/s stereo AC3 sound back into my re-rendered video.

Here's the final video. It's still mushy VHS, but at least the aspect ratio is brought into check, and the counters are gone. The Logoaway filter does a good job, but I would have liked to see a softer edge to the filtered area.

 

Final image after cropping of the black bars and resizing to 720x480 anamorphic:

 

For those who feel the counters were just as well left alone, I give you this screen from my pre-logoaway treatment. Even in motion, I feel the application of the blurring was way preferable.

All in all, a great learning experience, and a big thankyou to everyone who pointed me in the right direction.

-Fritz-

Visit my *NEW* Star Wars on Video Collection site:

http://www.swonvideo.com