VideoHelp Forum




+ Reply to Thread
Results 1 to 21 of 21
  1. I'm trying a logo removal filter in virtualdub. The x-logo filter. I'm really amazed at the results, although this is a simple white transparent logo.

    The problem is the logo appears over multiple frame sequences. A few seconds a fifth of the way through the film and then a few seconds a third of the way, again at the mid point, etc.

    But the x-logo config panel doesn't have an option for multiple in/out points. Just one in point/ one out point.

    Is there a way around this?

    I'd use avisynth if I could find a tut on a script for it.
    Quote Quote  
  2. Add more than one instance of the filter?
    Quote Quote  
  3. Thanks for the suggestion, but I can't get that one to work. I open multiple instances of the filter and do the settings, but virtualdub won't let me run them.

    So, now I'm looking into an avisynth script, but the only examples I've found use the trim function. Like this:

    -----------------
    clip=AVISource("pb_221.avi",false)

    clip.Trim(0,19) ++\
    clip.Trim(20,0).xlogo("logo221_x_540_y_300_2.bmp", X=540, Y=300, alpha=0)
    -----------------

    I, don't know. Maybe I'm reading this wrong. Do I have it right that the first trim segments frames 0-19 without applying a filter? and then the second trim is applying the filter to frames 20 till the end. But it adds the two segments back together? Is that what it's doing?

    So, if I had a 90 minute video I'd use something like:

    ----------------------
    clip.Trim(0,12776) ++\
    clip.Trim(12777,13798).xlogo("logo221_x_540_y_300_ 2.bmp", X=540, Y=300, alpha=0) ++\
    clip.Trim(13799,48419) ++\
    clip.Trim(48420,49445).xlogo("logo221_x_540_y_300_ 2.bmp", X=540, Y=300, alpha=0) ++\
    .
    .
    .
    ---------------------

    All the way till the end of the movie?
    Quote Quote  
  4. Originally Posted by StrobeLightEpileptic
    But it adds the two segments back together? Is that what it's doing?
    Yes.
    All the way till the end of the movie?
    Yes.
    Quote Quote  
  5. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by StrobeLightEpileptic
    So, if I had a 90 minute video I'd use something like:
    ----------------------
    clip.Trim(0,12776) ++\
    clip.Trim(12777,13798).xlogo("logo221_x_540_y_300_ 2.bmp", X=540, Y=300, alpha=0) ++\
    clip.Trim(13799,48419) ++\
    clip.Trim(48420,49445).xlogo("logo221_x_540_y_300_ 2.bmp", X=540, Y=300, alpha=0) ++\
    .
    ---------------------
    All the way till the end of the movie?
    Yes, that will work.
    If you have a lot of different sections, you might find it easier to use the ReplaceFramesSimple function:
    Code:
    clip.ReplaceFramesSimple(clip.xlogo("logo221_x_540_y_300_2.bmp", X=540, Y=300, alpha=0), \
      mappings = "[12777 13798] [48420 49445] ... ")
    The function is part of the RemapFrames plugin which you can get from here.

    If not using ReplaceFramesSimple, it would still be better to rewrite as
    Code:
    clip2 = clip.xlogo("logo221_x_540_y_300_2.bmp", X=540, Y=300, alpha=0)
    clip.Trim(0,12776) ++\
    clip2.Trim(12777,13798) ++\
    clip.Trim(13799,48419) ++\
    clip2.Trim(48420,49445) ++\
    ...
    Quote Quote  
  6. Okay. Well, I'm using this script:

    AVISource=("F:\clipfolder\clip.avi")
    Trim(0,12776) +\
    Trim(12777,13798).xlogo("C:\bg2_x_489_y-426_0.bmp",X=489,y=426,alpha=20) +\
    Trim(13799,48419) +\
    Trim(48420,49445).xlogo("C:\bg2_x_489_y-426_0.bmp",X=489,y=426,alpha=20) +\
    Trim(49446,74999) +\
    Trim(75000,76021).xlogo("C:\bg2_x_489_y-426_0.bmp",X=489,y=426,alpha=20) +\
    Trim(76022,103692) +\
    Trim(103693,104714).xlogo("C:\bg2_x_489_y-426_0.bmp",X=489,y=426,alpha=20) +\
    Trim(104715,128876) +\
    Trim(128877,129899).xlogo("C:\bg2_x_489_y-426_0.bmp",X=489,y=426,alpha=20) +\
    Trim(129900,154800) +\
    Trim(154801,155822).xlogo("C:\bg2_x_489_y-426_0.bmp",X=489,y=426,alpha=20) +\
    Trim(155823,165476) +\
    Trim(165477,166207).xlogo("C:\bg2_x_489_y-426_0.bmp",X=489,y=426,alpha=20) +\
    Trim(166208,0)

    But I get an error saying that there is an Invalid Argument to the Trim function in the last line.

    Gavino: I already had this script written out before I saw your post. I might give that a try, but I'd like to know what is wrong with my last line.
    Quote Quote  
  7. Originally Posted by StrobeLightEpileptic
    But I get an error saying that there is an Invalid Argument to the Trim function in the last line.
    Add another '+\ ' to that last line? I'm just guessing because I do my filtering-different-sections-differently differently. Either try that or try adding the real last frame number, rather than using '0'. Gavino will know.
    Quote Quote  
  8. Originally Posted by manono
    Originally Posted by StrobeLightEpileptic
    But I get an error saying that there is an Invalid Argument to the Trim function in the last line.
    Add another '+\ ' to that last line? I'm just guessing because I do my filtering-different-sections-differently differently. Either try that or try adding the real last frame number, rather than using '0'. Gavino will know.
    I should have mentioned that I played with the script multiple times. I had already tried your suggestions. The program gave me an error on the "+\" for the last line.

    I also tried giving it the last actual frame number.

    Thanks for the suggestions though. I should have mentioned that earlier.
    Quote Quote  
  9. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by StrobeLightEpileptic
    AVISource=("F:\clipfolder\clip.avi")
    That's your error right there. Remove the '='.
    Quote Quote  
  10. Good eyes. I completely missed that. I can blame it on the error message which isn't always very helpful and sometimes (as in this case) downright misleading.
    Quote Quote  
  11. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    In this case, the error message can easily throw you off the scent, since it seems to point to the wrong place.
    But AVISource=("F:\clipfolder\clip.avi") is a valid statement (assigning a string to the variable AVISource) so Avisynth cannot know that you meant something else.

    The result is that all the Trim's are seen as invalid because no input clip has been defined. However, it gets reported as being on the last line since the whole series of Trims is just one statement continued over many lines.

    Knowing that "Invalid arguments" often comes from an undefined input clip led me to look at the previous line where the real error was.
    Quote Quote  
  12. Member hech54's Avatar
    Join Date
    Jul 2001
    Location
    Yank in Europe
    Search PM
    Quote Quote  
  13. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by StrobeLightEpileptic
    Okay. Well, I'm using this script:

    AVISource=("F:\clipfolder\clip.avi")
    Trim(0,12776) +
    I use ReplaceFramesSimple as well, and it really does simplify, as you only have to write out the filter once, and you only have to specify the ranges it applies to, the rest will be the unfiltered video.

    Code:
    AVISource("F:\clipfolder\clip.avi")
    src = last
    filtered = xlogo("C:\bg2_x_489_y-426_0.bmp",X=489,y=426,alpha=20)
    ReplaceFramesSimple(src, filtered, mappings= \
    "[12777	13798]
     [48420	49445]
     [75000	76021]
     [103693	104714]
     [128877	129899]
     [154801	155822]
     [165477	166207]")
    NB: You can't use "0" for the last frame in this.

    I use AvsP to step through a video, and use its bookmark (control-B) to mark the transitions, then save these to a file, paste them into a template.

    I also always put the video, the image file and the script in the same folder, then I don't need to specify full paths.
    A different folder for each project, which I can then archive away as a unit.
    Quote Quote  
  14. Originally Posted by Gavino
    Originally Posted by StrobeLightEpileptic
    AVISource=("F:\clipfolder\clip.avi")
    That's your error right there. Remove the '='.
    Hats off to you. A slap in the head for me.

    So, I went back to the code. After I posted last night I decided to try the ReplaceFramesSimple. Of course, when it came to the AVISource line, I just copied and pasted from the other script. So, not surprisingly, I got the same error with ReplaceFramesSimple.

    So, when I went back I just decided to use the ReplaceFramesSimple because it is a lot less tedious. But what happens is VirtualDub crashes. Whenever I try to scrub the timeline while the script is loaded it crashes. An access violation. So, I tried to go ahead and save the AVI anyway. And it crashed right at the first frame that needed X-logo.

    So, I went back to my other script and fixed it. But, it crashes the exact same way; with an access violation. The error message reads:


    "out of bounds memory access (access violation) occurred in VirtualDub... reading address 00000008"

    Sometimes the address was 00000010, but the thing is it crashes at the first frame the filter is applied to.

    So, this is a pain. I checked to see that the film itself ran okay. No problem there. I can scrub the entire length of the film. Back and forth. No problem.

    Last night when the scripts wouldn't work, I tried DeLogo. But the preliminary results didn't look so great.

    So, tonight I'll probably look for another logo removal filter, I think there's another one, just can't remember the name.

    But, X-logo gives me great results. At least it looks good on the previews I've looked at.

    I do have a crash dump from VirtualDub. I don't know if anyone can make sense of it or not. I can't. But, I'll post it just in case someone can. This dump was with the Trim script.

    =================Crash report==================

    VirtualDub crash report -- build 30091 (release)
    --------------------------------------

    Disassembly:
    004caea0: 53 push ebx
    004caea1: 55 push ebp
    004caea2: 56 push esi
    004caea3: 8bf1 mov esi, ecx
    004caea5: 8b8614050000 mov eax, [esi+514]
    004caeab: 83e0fe and eax, 0feh
    004caeae: 83f802 cmp eax, 02h
    004caeb1: 57 push edi
    004caeb2: 7524 jnz 004caed8 (VideoSourceAVI::_isKey+38)
    004caeb4: 8b5e10 mov ebx, [esi+10h]
    004caeb7: 8b4c2414 mov ecx, [esp+14h]
    004caebb: 8b6e14 mov ebp, [esi+14h]
    004caebe: 8b542418 mov edx, [esp+18h]
    004caec2: 6a00 push 00h
    004caec4: 2bcb sub ecx, ebx
    004caec6: 50 push eax
    004caec7: 1bd5 sbb edx, ebp
    004caec9: 52 push edx
    004caeca: 51 push ecx
    004caecb: e8b0690b00 call 00581880 (_alldiv)
    004caed0: 8bfa mov edi, edx
    004caed2: 03c3 add eax, ebx
    004caed4: 13fd adc edi, ebp
    004caed6: eb08 jmp 004caee0 (VideoSourceAVI::_isKey+40)
    004caed8: 8b7c2418 mov edi, [esp+18h]
    004caedc: 8b442414 mov eax, [esp+14h]
    004caee0: 8bae0c050000 mov ebp, [esi+50c]
    004caee6: 85ed test ebp, ebp
    004caee8: 7432 jz 004caf1c (VideoSourceAVI::_isKey+7c)
    004caeea: 8b4e10 mov ecx, [esi+10h]
    004caeed: 8b5614 mov edx, [esi+14h]
    004caef0: 2bc1 sub eax, ecx
    004caef2: 1bfa sbb edi, edx
    004caef4: 8bc8 mov ecx, eax
    004caef6: 83e11f and ecx, 1fh
    004caef9: bb01000000 mov ebx, 00000001
    004caefe: d3e3 shl ebx, cl
    004caf00: 8bd7 mov edx, edi
    004caf02: b105 mov cl, 05h
    004caf04: e8d7650b00 call 005814e0 (_allshr)
    004caf09: 235c8500 and ebx, [ebp+eax*4+00h]
    004caf0d: 5f pop edi
    004caf0e: f7db neg ebx
    004caf10: 1bdb sbb ebx, ebx
    004caf12: 5e pop esi
    004caf13: f7db neg ebx
    004caf15: 5d pop ebp
    004caf16: 8ac3 mov al, bl
    004caf18: 5b pop ebx
    004caf19: c20800 ret 0008
    004caf1c: 8b8ec8040000 mov ecx, [esi+4c8]
    004caf22: 8b11 mov edx, [ecx]
    004caf24: 57 push edi
    004caf25: 50 push eax
    004caf26: 8b4210 mov eax, [edx+10h] <-- FAULT
    004caf29: ffd0 call eax
    004caf2b: 5f pop edi
    004caf2c: 5e pop esi
    004caf2d: 5d pop ebp
    004caf2e: 5b pop ebx
    004caf2f: c20800 ret 0008
    004caf32: cc int 3
    004caf33: cc int 3
    004caf34: cc int 3
    004caf35: cc int 3
    004caf36: cc int 3
    004caf37: cc int 3
    004caf38: cc int 3
    004caf39: cc int 3
    004caf3a: cc int 3
    004caf3b: cc int 3
    004caf3c: cc int 3
    004caf3d: cc int 3
    004caf3e: cc int 3
    004caf3f: cc int 3
    004caf40: 53 push ebx
    004caf41: 56 push esi
    004caf42: 8bf1 mov esi, ecx
    004caf44: 83beac04000000 cmp dword ptr [esi+4ac], 00h
    004caf4b: 57 push edi
    004caf4c: 7457 jz 004cafa5 (VideoSourceAVI::nearestKey+65)
    004caf4e: 8b5c2414 mov ebx, [esp+14h]
    004caf52: 3b5eb4 cmp ebx, [esi-4ch]
    004caf55: 7c43 jl 004caf9a (VideoSourceAVI::nearestKey+5a)
    004caf57: 8b7c2410 mov edi, [esp+10h]
    004caf5b: 7f05 jg 004caf62 (VideoSourceAVI::nearestKey+22)
    004caf5d: 3b7eb0 cmp edi, [esi-50h]
    004caf60: 7238 jc 004caf9a (VideoSourceAVI::nearestKey+5a)
    004caf62: 3b5ebc cmp ebx, [esi-44h]
    004caf65: 7f33 jg 004caf9a (VideoSourceAVI::nearestKey+5a)
    004caf67: 7c05 jl 004caf6e (VideoSourceAVI::nearestKey+2e)
    004caf69: 3b7eb8 cmp edi, [esi-48h]
    004caf6c: 732c jnc 004caf9a (VideoSourceAVI::nearestKey+5a)
    004caf6e: 8b46a0 mov eax, [esi-60h]
    004caf71: 8b5060 mov edx, [eax+60h]
    004caf74: 8d4ea0 lea ecx, [esi-60h]
    004caf77: 53 push ebx
    004caf78: 57 push edi
    004caf79: ffd2 call edx
    004caf7b: 84c0 test al, al
    004caf7d: 740a jz 004caf89 (VideoSourceAVI::nearestKey+49)
    004caf7f: 8bc7 mov eax, edi
    004caf81: 5f pop edi
    004caf82: 5e pop esi
    004caf83: 8bd3 mov edx, ebx
    004caf85: 5b pop ebx
    004caf86: c20800 ret 0008
    004caf89: 8b06 mov eax, [esi]
    004caf8b: 8b5064 mov edx, [eax+64h]
    004caf8e: 53 push ebx
    004caf8f: 57 push edi
    004caf90: 8bce mov ecx, esi
    004caf92: ffd2 call edx
    004caf94: 5f pop edi
    004caf95: 5e pop esi
    004caf96: 5b pop ebx
    004caf97: c20800 ret 0008
    004caf9a: 5f pop edi
    004caf9b: 83c8ff or eax, 0ffh
    004caf9e: 5e pop esi
    004caf9f: 0b db 0bh

    Built on Aegis on Sun Jan 04 12:35:50 2009 using compiler version 1400

    Windows 5.1 (Windows XP x86 build 2600) [Service Pack 3]

    EAX = 0000989c
    EBX = 00000000
    ECX = 00c3e2a8
    EDX = 00000000
    EBP = 00000000
    ESI = 00c3f040
    EDI = 00000000
    ESP = 0012f6dc
    EIP = 004caf26
    EFLAGS = 00210246
    FPUCW = ffff027f
    FPUTW = ffffffff

    Crash reason: Access Violation

    Crash context:
    An out-of-bounds memory access (access violation) occurred in module 'VirtualDub'...

    ...reading address 00000010.

    Pointer dumps:

    ECX 00c3e2a8: 00000000 0033bedc 00c3d1d8 0206e6d0 00030006 01080144 00000000 000002d0
    ESI 00c3f040: 005c7ed8 00000002 00c3d168 00000028 00000000 00000000 000255f0 00000000
    ESP 0012f6d8: 00000000 0000989c 00000000 0000989c 00c3f040 0012f798 00000000 004cb3a3
    0012f6f8: 0000989c 00000000 0018dd15 00000000 00000000 00c3f0a0 00497299 0000989c
    0012f718: 00000000 0000989c 00c3b4d8 00000000 0087b7e4 00000014 00005dc0 000003e9
    0012f738: 00000000 00000010 0018dd15 00000000 0018dd15 00000000 0000989c 00000000

    Thread call stack:
    004caf26: VideoSourceAVI::_isKey()
    004cb3a3: VideoSourceAVI::getFrameTypeChar()
    00497299: VDProjectUI::GetFrameString()
    7e41882a: USER32!GetDC [7e410000+86c7+163]
    0044cbdd: VDPositionControlW32::UpdateString()
    7e42c228: USER32!DefWindowProcA [7e410000+1c17e+aa]
    7e418bd9: USER32!GetWindowThreadProcessId [7e410000+8a80+159]
    7e42c23c: USER32!DefWindowProcA [7e410000+1c17e+be]
    7e42c1e9: USER32!DefWindowProcA [7e410000+1c17e+6b]
    7e42c1e9: USER32!DefWindowProcA [7e410000+1c17e+6b]
    0044e175: VDPositionControlW32::WndProc()
    005882a5: __set_flsgetvalue()
    00588451: _getptd_noexit()
    0058a587: write_string()
    0058ae97: _output_l()
    0058af16: _output_l()
    7e418bd9: USER32!GetWindowThreadProcessId [7e410000+8a80+159]
    7e41882a: USER32!GetDC [7e410000+86c7+163]
    7e4194be: USER32!GetWindowLongA [7e410000+945d+61]
    7e4194be: USER32!GetWindowLongA [7e410000+945d+61]
    7e42c228: USER32!DefWindowProcA [7e410000+1c17e+aa]
    7e418bd9: USER32!GetWindowThreadProcessId [7e410000+8a80+159]
    7e42c23c: USER32!DefWindowProcA [7e410000+1c17e+be]
    7e42c1e9: USER32!DefWindowProcA [7e410000+1c17e+6b]
    7e42c1e9: USER32!DefWindowProcA [7e410000+1c17e+6b]
    0044e175: VDPositionControlW32::WndProc()
    0044e562: VDPositionControlW32::StaticWndProc()
    7e418734: USER32!GetDC [7e410000+86c7+6d]
    7e418bd9: USER32!GetWindowThreadProcessId [7e410000+8a80+159]
    7e41885a: USER32!GetDC [7e410000+86c7+193]
    7e41882a: USER32!GetDC [7e410000+86c7+163]
    7e42fd6b: USER32!DrawEdge [7e410000+1fbf6+175]
    7e429009: USER32!EndPaint [7e410000+18ffd+c]
    0044d2ec: VDPositionControlW32::OnPaint()
    0044d5c4: VDPositionControlW32::SetDisplayedPosition()
    004962ea: VDProjectUI::OnPositionNotify()
    0049abda: VDProjectUI::MainWndProc()
    7e419488: USER32!GetWindowLongA [7e410000+945d+2b]
    004941e0: VDProjectUI::WndProc()
    004a327d: VDUIFrame::StaticWndProc()
    7e418734: USER32!GetDC [7e410000+86c7+6d]
    7e418816: USER32!GetDC [7e410000+86c7+14f]
    7e42927b: USER32!GetParent [7e410000+1910f+16c]
    7e42f40b: USER32!SendMessageA [7e410000+1f3c2+49]
    0044d49b: VDPositionControlW32::Notify()
    004f9d76: VDRoundToInt64()
    0044e038: VDPositionControlW32::WndProc()
    0044e562: VDPositionControlW32::StaticWndProc()
    7e418734: USER32!GetDC [7e410000+86c7+6d]
    7e418816: USER32!GetDC [7e410000+86c7+14f]
    7e4189cd: USER32!GetWindowLongW [7e410000+88a6+127]
    7e42a43b: USER32!PeekMessageA [7e410000+1a340+fb]
    7e4196c7: USER32!DispatchMessageA [7e410000+96b8+f]
    00481b06: WinMain@16()
    005855a8: __tmainCRTStartup()
    7c817067: kernel32!RegisterWaitForInputIdle [7c800000+1701e+49]

    -- End of report
    Quote Quote  
  15. Originally Posted by AlanHK
    [165477 166207]")
    NB: You can't use "0" for the last frame in this.
    Thanks for that info. I did use the last frame number in the ReplaceFramesSimple script tonight.

    Originally Posted by AlanHK
    I use AvsP to step through a video, and use its bookmark (control-B) to mark the transitions, then save these to a file, paste them into a template.

    I also always put the video, the image file and the script in the same folder, then I don't need to specify full paths.
    A different folder for each project, which I can then archive away as a unit.
    Good ideas. I'll have to start practicing these. AvsP, I downloaded that once. But I didn't have time to work through it to understand it. Interesting program though.
    Quote Quote  
  16. Originally Posted by hech54
    Well. What can I say? You can't argue with success.

    I have x-logo working in VD now and it's being applied over multiple instances. From what I can see in VD it's looking pretty good. Just a tiny bit of blur.

    I don't know why, but I just didn't take your post seriously. And I only clicked on the YouTube link after about the third time I saw your post. I guess I just thought you were being sarcastic.

    Anyway, Thanks for that. I'll have to look at that guy's website.
    Quote Quote  
  17. Originally Posted by StrobeLightEpileptic
    ...although this is a simple white transparent logo.
    Something like LogoTools usually works better than XLogo on see-through logos. With luck you can get rid of them entirely with no blur. It kind of depends on the logo.

    https://forum.videohelp.com/images/guides/p2020914/logotools.zip
    Quote Quote  
  18. Member hech54's Avatar
    Join Date
    Jul 2001
    Location
    Yank in Europe
    Search PM
    Originally Posted by StrobeLightEpileptic
    Originally Posted by hech54
    Well. What can I say? You can't argue with success.

    I have x-logo working in VD now and it's being applied over multiple instances. From what I can see in VD it's looking pretty good. Just a tiny bit of blur.

    I don't know why, but I just didn't take your post seriously. And I only clicked on the YouTube link after about the third time I saw your post. I guess I just thought you were being sarcastic.

    Anyway, Thanks for that. I'll have to look at that guy's website.
    You're very welcome. I thought you were dead-set on using script or I would have made my point a bit better...SORRY.
    Quote Quote  
  19. Originally Posted by manono
    Originally Posted by StrobeLightEpileptic
    ...although this is a simple white transparent logo.
    Something like LogoTools usually works better than XLogo on see-through logos. With luck you can get rid of them entirely with no blur. It kind of depends on the logo.

    https://forum.videohelp.com/images/guides/p2020914/logotools.zip
    Well, now I'm wondering about that. I noticed as the xlogo filter was being applied that there was a slight blur to the picture overall. I think this is probably because I had interpolation set fully.

    But, yeah there is also a small smeared area that shows up. It's visibility depends on the colors it overlays.

    This logo is just lettering. Almost opaque in some parts and more transparent in other parts.

    I'll look into LogoTools and see what that's about.

    Thanks.
    Quote Quote  
  20. Originally Posted by hech54

    You're very welcome. I thought you were dead-set on using script or I would have made my point a bit better...SORRY.
    No need to be sorry. I'm pretty much for whatever works.

    That's an interesting feature in VD I would never have known about.
    Quote Quote  
  21. Looking at other YouTube videos, I saw this one:

    http://www.youtube.com/watch?v=96Vm78ig8Og

    Here, he is using Adobe Premiere and applying a filter called Region Remove Video Filter.

    The only filter by that name that I can find is a virtual dub filter.

    Is it possible to use a virtual dub filter in Adobe Premiere?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!