VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab Passkey and copy Blu-ray and DVDs! :)
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. I'm trying to add a logo/watermark to my video with avisynth (via megui). This is my current script:

    Code:
    LoadPlugin("D:\Program Files\Program Inst\MeGUI_2507_x86\tools\remapframes_5F25_dll_20050826\RemapFrames.dll")
    a2=ImageReader("X:\Diadem\logotest.tiff")
    a3=ImageReader("X:\Diadem\logotest.tiff",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32")
    Overlay(a2,mask=a3)
    However I keep getting the following error:

    AviSynth script error:
    ImageReader: error 'Could not open file' in DevIL library
    reading file X:\Diadem\logotest.tiff

    I'm quite new to avisynth so I could be overlooking something but any help I could receive would be most appreciated.
    Quote Quote  
  2. It looks like you're opening the tiff file correctly. So there may be something about the file that ImageReader() doesn't like. Does your tiff file have an alpha channel?

    Your script has another problem -- it never opens a video file on which to overlay the logo. So the Overlay() won't work.
    Last edited by jagabo; 5th Feb 2015 at 07:02.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    It looks like you're opening the tiff file correctly. So there may be something about the file that ImageReader() doesn't like. Does your tiff file have an alpha channel?

    Your script has another problem -- it never opens a video file on which to overlay the logo. So the Overlay() won't work.
    Alpha channel refer to transparency, right? If so then yes. I tried without but I receive the same error message.

    Oh, I assumed because there is a separate line that already opens the video, I wouldn't have to repeat it, or would I?
    Quote Quote  
  4. Originally Posted by .craZy View Post
    Alpha channel refer to transparency, right?
    Yes.

    Originally Posted by .craZy View Post
    If so then yes. I tried without but I receive the same error message.
    Simplify your script to see if you can isolate the problem. Reduce it to only:

    Code:
    ImageReader("X:\Diadem\logotest.tiff")
    If that works (I suspect not) try:

    Code:
    ImageReader("X:\Diadem\logotest.tiff",  pixel_type="RGB32")
    Etc.

    Maybe you should upload the tiff file so someone can analyze it.

    Originally Posted by .craZy View Post
    Oh, I assumed because there is a separate line that already opens the video, I wouldn't have to repeat it, or would I?
    No, you don't have to repeat it. The line wasn't in your script so I mentioned that you needed to actually open a video before you could overlay onto it.
    Quote Quote  
  5. Originally Posted by jagabo View Post
    Simplify your script to see if you can isolate the problem...
    Gave that a go but sadly kept receiving the same error.

    Here is the logo if anyone could take a look: http://zee-dot.com/logotest.tif
    Quote Quote  
  6. One thing to note: your file has the extension tif. But your script specifies tiff.
    Quote Quote  
  7. Originally Posted by jagabo View Post
    One thing to note: your file has the extension tif. But your script specifies tiff.
    So I noticed but changing to .tif just gives me a different error:

    AviSynth script error:
    ImageReader: error 'LibTiff error' in DevIL library
    reading file X:\Diadem\logotest.tif
    Quote Quote  
  8. A lot of programs don't like your tif file. Have you tried another format? Like png? bmp?
    Quote Quote  
  9. Originally Posted by jagabo View Post
    A lot of programs don't like your tif file. Have you tried another format? Like png? bmp?
    Just tried a .png and .bmp and no more errors are brought up, but the matter now is it doesn't seem to show up anywhere in the video.

    Thanks for helping me through thus far btw!
    Quote Quote  
  10. Post your entire script.
    Quote Quote  
  11. Originally Posted by jagabo View Post
    Post your entire script.
    Code:
    LoadPlugin("D:\Program Files\Program Inst\MeGUI_2507_x86\tools\remapframes_5F25_dll_20050826\RemapFrames.dll")
    a1=DirectShowSource("X:\Diadem\Subs\150204T-ARA.mp4")
    a2=ImageReader("X:\Diadem\logotest2.bmp")
    a3=ImageReader("X:\Diadem\logotest2.bmp",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32")
    Overlay(a1,a2,mask=a3)
    
    LoadPlugin("D:\Program Files\Program Inst\MeGUI_2507_x86\tools\ffms\ffms2.dll")
    FFVideoSource("X:\Diadem\Subs\150204T-ARA.mp4", fpsnum=25, fpsden=1, threads=1)
    #deinterlace
    #crop
    #resize
    #denoise
    
    LoadPlugin("D:\Program Files\Program Inst\MeGUI_2507_x86\tools\avisynth_plugin\VSFilter.dll")
    TextSub("X:\Diadem\Subs\T-ARA CNY Greetings 150204 on Mango TV.ass", 1)
    Quote Quote  
  12. Here's the problem: whenever you don't specify a named video stream the name "last" is used instead. So Overlay() is creating a stream called last from a1, a2, and a3 . Then you call FFVideoSource() without naming the stream. So a new stream is created called last, throwing out the previous one (the one with the logo). Finally, TextSub() draws text onto last (the new one). If you get rid of the ffVideoSource() line you will get your logo and subtitles on the original video.

    Generally, ffVideoSource() is more reliable and accurate than DirectShowSource(). So I would replace DirectShowSource() with ffVideoSource() in the second line.
    Quote Quote  
  13. Thanks for the explanation!

    Sadly the change made no difference. However I found a different script which finally and thankfully is working well for me.

    Leaving it here if it can help anyone with issues similar to mine:

    VIDEO=DirectShowSource("video")
    IMAGE=ImageSource("logo")
    Overlay(VIDEO, IMAGE, mask=IMAGE, opacity=1, x=10, y=10)

    Thanks a lot again jagabo!
    Quote Quote