I had a video that had dropouts which caused white lines to appear on the video and I used a script to remove the lines which basically just guessed the pixels that should be replaced. Can someone please suggest a similar script which can remove TV logos? I've attached a source clip. Also attached are 3 videos. The Challenge Logo video is the video logo sample used to remove the logo. One of the videos is the encoded result when using a video as a sample and the other video is the encoded result when using an image as a sample. I've done cleanup on the encoded videos. Cleanup was done after the logo script.
Tried this script:
It works but the frame number is actually for the image and it doesn't matter what frame number you use as the image is not a video so it only has 1 frame. Regardless the script works but it leaves a visible mark behind on black scenes.Code:LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Logo Removal\LogoTools\LoadPluginEx2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Logo Removal\LogoTools\LogoTools.dll") B=ImageSource("logo.bmp").ConvertToYUY2(Interlaced=true) A=MPEG2Source("E:\Bullseye Video Source to Encode.d2v").ConvertToYUY2(Interlaced=true) NoLogoAuto(A,B,1)
I tried the below which gets better results. It looks for a frame in a video sample which is all black apart from the logo.
Frame 80 is from logoclip which contains the logo sample.Code:LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Logo Removal\LogoTools\LoadPluginEx2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Logo Removal\LogoTools\LogoTools.dll") clip=MPEG2Source("E:\Bullseye Video Source to Encode.d2v").ConvertToYUY2(Interlaced=True) logoclip=MPEG2Source("E:\Challenge Logo.d2v").ConvertToYUY2(Interlaced=True) NoLogoAuto(clip,logoclip,80) ConvertToYV12(Interlaced=True)
This video looks better than the image version but it still has some frames where the logo remains are still visible. On dark scenes or complex pattern scenes you can't see the logo but on lighter scenes you can see it. Is there anything else I can do to remove the remains of the logo?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 30 of 33
Thread
-
Last edited by VideoFanatic; 12th Feb 2015 at 09:51.
-
There's dedicated plugins. Rm logo appears to be clever, but I've never used it.
I don't do logo removal much myself but when I do I use ffdshow. You can use ffdshow filters in a script without using it to decode the video if you included the Avisynth plugin when installing ffdshow. To load ffdshow in a script you'd do it something like this:
Load_Stdcall_Plugin("C:\Program Files\AviSynth 2.5\plugins\ffavisynth.dll")
ffdshow(preset="default")
Alternatively you could open a video with DirectShowSource() and use ffdshow for decoding.
If you're familiar with ffdshow you might know you can create various presets. The above just uses the default. You'd enable the ffdshow "logoaway" filter and you're in business.
In order to set it up, I open the source video with MPC-HC and get ffdshow to decode. That way it's easy to get the placement correct and see how it'll work before using it in a script (if you crop or resize you'd need to add ffdshow to the script first or it won't be in the same position as it is when viewing the source video with MPC-HC).
There's a few different logo removal methods. One involves creating a bitmap image of the logo being removed which I'd assume should give the best result. I'd imagine it's the same method as described here. I just use the XY mode myself.
Very roughly, left 52, top 38, width 92, height 30, XY mode (ugly blob mode ).
Last edited by hello_hello; 9th Feb 2015 at 18:46.
-
Thanks but that screenshot has a blurry mark where the logo was which is just as bad as the logo! I'm looking for a script that guesses the pixels that would be in place of the logo if the logo wasn't there.
-
Here's a quick job using LogoTools. A better job can be done with the fine tuning scripts below the quick 'automatic' job I did. Those other scripts have nothing to do with your video, but are settings I used on other videos with logos. And you can also smooth out the noise you might see remaining in other parts of the video. It's explained in the included Doc. The '150' is the frame number used for the mask. I'll enclose the mask as well. The idea is to find the logo somewhere with black all around it (which you provided).
LoadPlugin("F:\AVISynth\dlls\DGDecode.dll")
LoadPlugin("F:\AVISynth\dlls\LoadPluginEx2.dll")
LoadPlugin("F:\AVISynth\dlls\LogoTools.dll")
B=ImageSource("logo.bmp").ConvertToYUY2()
A=MPEG2Source("test.d2v").ConvertToYUY2(Interlaced =True)
NoLogoAuto(A,B,150)
#NoLogo(A,B,150,2,72,44,168,28)
#NoLogoM(A,B,150,1,496,398,140,28,1.05,210,0)
#B=Blur(1,1).Blur(1,1)#.Tweak(Sat=0,Coring=False)
#Mask=ImageSource("Logo2.bmp")
#Overlay(A,B,0,0,Mask)
#ConvertToYV12(Interlaced=True)#I kept it YUY2 for the reencode using CCELast edited by manono; 9th Feb 2015 at 20:32.
-
-
Thanks. I copied the 3 dll files into my plugins folder. When I try to just load the video in AvsPmod without any script, AvsPmod won't load. I only have this line: Mpeg2Source("E:\2 = New\Bullseye Clip with Logo.d2v"). AvsPmod loads the video when those dll files aren't in the plugins folder but when they are AvsPmod won't load.
Also is it just these lines I need to try the automatic job?
Code:LoadPlugin("F:\AVISynth\dlls\LoadPluginEx2.dll") LoadPlugin("F:\AVISynth\dlls\LogoTools.dll") B=ImageSource("logo.bmp").ConvertToYUY2() A=MPEG2Source("test.d2v").ConvertToYUY2(Interlaced=True) NoLogoAuto(A,B,150)
-
Maybe it's your screwy syntax (if your code below that sentence is any indication). Try doing it as I did in the script - use LoadPlugin lines and Source filters but modified for your own names and paths. Maybe it's because of having both the LoadPluginEx.dll and the LoadPluginEx2.dll. I included them both although the LoadPluginEx2.dll is required for newer AviSynths.
Also is it just these lines I need to try the automatic job?
LoadPlugin("F:\AVISynth\dlls\DGDecode.dll")
LoadPlugin("F:\AVISynth\dlls\LoadPluginEx2.dll")
LoadPlugin("F:\AVISynth\dlls\LogoTools.dll")
B=ImageSource("logo.bmp").ConvertToYUY2
A=MPEG2Source("test.d2v").ConvertToYUY2(Interlaced =True)#Interlaced=True sometimes isn't showing properly
NoLogoAuto(A,B,150)
Where did you get that bmp file as the video didn't have a completely black frame.Last edited by manono; 10th Feb 2015 at 17:52.
-
Thanks got it working now. However I need to convert my video to YUY2. Doesn't this lose quality as I also have to convert back to YV12 as the clip is to be played back on a Bluray player?
Those plugins don't seem to be very stable as the encoding crashes for me at around 90% completion. Also when not using the plugins and the plugins are still in the plugins directory, Avisynth crashes as soon as I try to encode something.
Is there another option to remove the logo without converting the colour space? Or is there a way to only convert the colour space for the area around the logo?Last edited by VideoFanatic; 10th Feb 2015 at 17:55.
-
If you want to use the filter then you have to convert to YUY2. I'm sure there's a way to crop just around the logo, convert the colorspace, delogo it, convert back to YV12 and then replace it into the main video. But since my videos are black and white I haven't had (or cared enough) to do it that way. This is what I use for translucent logos. There are, of course, other delogo filters:
http://avisynth.nl/index.php/External_filters#Logo_Removal
X-Logo works well, if you can get it to work. And then there are the VDub delogo filters, but they'll require you to convert to RGB.
Those plugins don't seem to be very stable as the encoding crashes for me at around 90% completion. -
The NoLogoAuto script crashes for me. I've got the following files in the plugins folder: LogoTools.dll and LoadPluginEx2.dll
When I start Simple x264 Launcher (encoder) I get the following message:
Code:A critical error was encountered while checking your Avisynth version. This is most likely caused by an erroneous Avisynth Plugin, please try to clean your Plugins folder! We suggest to move all .dll and .avsi files out of your Avisynth Plugins folder and try again.
When I try to load the AVS script I get this message:
Code:An Avisynth script was selected as input, although Avisynth is not available!
This is my script which loads fine in AvsPmod but crashes when encoding:
Code:LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\DGDecode.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\LoadPluginEx2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\LogoTools.dll") B=ImageSource("E:\2 = New\z = Encode\logo.bmp").ConvertToYUY2 A=MPEG2Source("E:\2 = New\z = Encode\Bullseye Clip with Logo.d2v").ConvertToYUY2(Interlaced=True) NoLogoAuto(A,B,150)
-
You say it opens fine in AvsPMod. It does the same in VDub, right? What happens when you make a Lagarith or some other lossless AVI? Does it work? In any event, I think you've only shown a problem when using Simple x264 Launcher. Maybe try using something else, like VDub as I suggested.
ConvertToYUY2EG2Source
ConvertToYUY2(Interlaced=TrueLogoAuto(A,B,150)
And it crashes when doing the whole thing? That '150' refers to the frame number in the sample. It would, of course, be a different frame number when encoding the entire video. -
Yes the forum screwed up the code.
Tried MeGUI and it crashes. Tried Vdub and it seems to be working. Why does it work in Vdub and not anything else when they both use the same Avisynth installation files - I've never understood why?
I've got so many files that I just use MeGUI as it automates the muxing, encoding and everything. It's too slow doing everything manually in Vdub and I have to encode twice - once to AVI and 2nd time to h264. So I don't think I'll be using the logo removal script because it only works in Vdub but it's good to know if I really need logos removed that I now have the tools to do it.
Any idea how to get the script working in multi-threaded mode? Usually I would do this:
Code:setmtmode(5,9) Mpeg2Source("E:\2 = New\Typical.d2v") setmtmode(2)
Is X-Logo the only script that works in YV12? Does anyone have a script for it please?Last edited by VideoFanatic; 11th Feb 2015 at 13:55.
-
I just checked my template script for NoLogo and found a 'SetMTMode(2)' at the top, so I've used it multi-threaded successfully in the past. For the short sample, after transferring the necessary parts to a different script, I didn't use it multi-threaded. But for such a short sample I doubt it would crash anyway. I do have lots of problems with encodes crashing and often disable multi-threading, but NoLogo isn't one of the problem filters for me. And I always make Lagarith AVIs because delogoing is just an early stage of a multiple encode 'restoration' of the old films I work on.
I don't know why NoLogo works for an AVI encoded through VDub and not with other encoders.
I use InPaintFunc a lot - for all my opaque logos. It's slow as Christmas, even just for it to open, so I doubt you'll like it much. The mask has to be exactly the same size as the video to which it's being applied and at the time it's being applied. So, do your cropping and resizing before then saving out a BMP to be used for a mask.
I've used X-Logo before but found it more trouble than it's worth. There's a guide for its use here:
https://forum.videohelp.com/threads/273109-Remove-an-opaque-logo-using-Xlogo-in-Avisynth -
Since AvsToDVD uses AviSynth scripts and allows you to edit those scripts, then I don't see why not. I don't use AvsToDVD myself so someone more knowledgeable about the program should probably answer. You can ask in the dedicated AvsToDVD thread.
I would suggest, though, that after editing the script and before encoding for DVD you test it out in VDub to make sure it's a good script. -
manono I've updated my 1st post. Please have a read and let me know if you can help. Thanks
-
As I said before, I've used NoLogo before with just a simple 'SetMTMode(2)' as the first line in the script.
I mentioned in my first reply to your thread, "A better job can be done with the fine tuning scripts below the quick 'automatic' job I did." The easy to set up NoLogoAuto setting isn't the best. The best is NoLogoM, but it takes some work to set it up properly. How to do that is explained in the doc. Removing logos isn't easy. Good luck. -
I had a look at NoLogoM before but I didn't know what settings to use. I was hoping someone could advise me:
All the documentation says is the below, it doesn't say how to find those settings:
NoLogoM(min brightness change for logo, xpos of logo area, ypos of logo area, logo area width, logo area height, Correction,Scale, Offset) -
The reason any logo remover will leave some artifacts in your case is your source has noise and compression artifacts around the logo , especially in the brighter scenes
eg
point resized x2
You won't be able to get good results with any logo remover unless you address that in some way, or use the "ugly bob" or some similar method -
Just denoise? But did you get rid of the artifacts ? You need to get rid of those artifacts beforehand. Or no delogo filter or approach with any program will give good results, short of photoshop
You'd be left with ugly artifacts, probably worse than if the logo was still there -
Yes I denoised before the logo script. Made no difference. Thanks everyone for your help but I give up.
-
Other quick question:
I remove logos on black bars using VidCoder (Fast solution for me since I'm new on this: by cut them off)
Example:
mp4
Original 1280/720
to 1280/"588"
There is a way to return the black bars to their original size 720 ?
Kind like revers it with-out the logo.Last edited by DJ_ValBec; 13th Feb 2015 at 16:46.
-
-
I'm reading this threat:
https://forum.videohelp.com/threads/340509-Need-Help-with-HandBrake-regarding-manual-cr...ing-and-resize
If I crop with RipBot264 it will pad (resize) the borders back automatically to their original size ?
Post #5Last edited by DJ_ValBec; 13th Feb 2015 at 16:46.
-
@VideoFanatic, what is the method used to obtain the videos ? i mean, did you capture, or use a hardware mpeg, dvd recorder or ripped (grab the actual stream) from the source through OTA capture device ? you are using low bitrate during your captures ? if you are, i would suggest raising the bitrate as high as the capture device allows and configure the setting encoding to CBR instead of VBR. also, it most likely is the station's fault for these artifacts due to the very low bitrates. i can see a lot of macroblocks in these videos.
my point is, the hardware capture devices are most likely adding additional noise / jibblets around the logo. can you obtain the actual content of those clips ? unless your only method is through one of the capture methods mentioned above. -
No, and I was wrong about being able to edit the script to AddBorders. I just checked. You can only do things it has boxes for, including cropping and resizing, not adding back black. The 5.0 version of XviD4PSP does allow complete freedom to edit the AviSynth script. Maybe it would be better for you to learn enough AviSynth to be able to do the things you want.
VidCoder have Avisynth ? -
-
I crop and resize with RipBot264 to eliminate Black-Bars-Logos. (very easy to use), so the mp4 files stay as the original 1080 or 720...No Logo(s).
Also:
I fix my cropped videos made by VidCoder with RipBot264, to return them back to 1080 or 720 ...No quality lost either.
I'm learning to use AviSynth Script, to remove the logos inside the video itself.Last edited by DJ_ValBec; 13th Feb 2015 at 15:26.