View Full Version : how to show gif in an avi clip
edl
18th August 2003, 10:18
I have some question about how to show a image sequence in a avi clip use the ASS commands
especial the gif files ,I search the documentations about this ,but i didn't find anything useful about it . after try it several days I can only use the ASS command to show words on the screen.but i need show a picture. although i can use Avisynth to do it,but it seems that it can only show bmp files ,and i think if ASS can do it ,it will be convenient. so i need your help.
especially i need to know how to add GIF logo (not fullscreen) to an avi video clip.
i don't understand the following command can work in the Sub Station Alpha 4.0 ,but it can't work in the VobSub 2.23
Picture: Marked=0,0:00:05.00,0:00:07.00,*Default,,0000,0000,0000,,G:\DVD_LAB\Sub-Lab\sub-logo\ssa\logo.bmp
Sound: Marked=0,0:00:08.00,0:00:10.00,*Default,,0000,0000,0000,,G:\DVD_LAB\Sub-Lab\temp\wav.wav
Movie: Marked=0,0:00:11.00,0:00:13.00,*Default,,0000,0000,0000,,G:\DVD_LAB\Sub-Lab\temp\XCID-BF.avi
Command: Marked=0,0:00:14.00,0:00:16.00,*Default,,0000,0000,0000,,C:\exe.exe
Picture: Marked=0,0:00:17.00,0:00:19.00,*Default,,0000,0000,0000,,F:\Myhomepage004\logo.gif
mf
18th August 2003, 12:00
Try saving the GIF to an AVI using Animation Shop (free trial on jasc.com), and use ColorKeyMask() (cause GIF only has index transparency) to get it transparent. You can then insert it somewhere on the video.
edl
18th August 2003, 12:45
Thank you very much ,i will try it ,but somebody tell me the ASS command can use gif files ,really?
Wilbert
18th August 2003, 17:36
Please, don't cross post. I don't think you can use Vobsub to show gif's in AviSynth. However AviSynth can read many picture formats using ImageReader:
http://www.avisynth.org/index.php?page=Image
example:
video = AviSource("...")
pic = ImageReader("c:\logo.gif", 0, 0, 25, true)
pic2 = FlipVertical(pic) # might be necessary if pic is flipped
Layer(video, pic2, "add", 255, 0, 0)
edl
21st August 2003, 14:10
I'am sorry about that ,i won't do it again !;)
thx ,let me try it ,if i failed i will ask again here.
edl
21st August 2003, 15:00
I don't know why it don't work,does the avi clip need spcial compressed format? or the gif file? i need to put a transparent background gif logo on a video ,if the gif file need to be the untransparent background……i have try it from July to September , faile then try ,try then faile,i near mad ! but i never drop it, thx for your post,i need more your help when i use the following code ,it popup message : "imageformat don't match!" I see in the avisynth's documents ,the line:
ImageReader(string path, int begin, int end, int fps, bool "use_DevIL") [v 2.52]
what is "use_DevIL"? it can only used in v 2.52 ? by the way ,i haven't see gif file is support in the list:
bmp, dds, ebmp*, jpg/jpe/jpeg, pal, pcx,
png, pbm/pgm/ppm, raw, sgi/bw/rgb/rgba, tga, tif/tiff
-----------------------------------------------------------------------------------------
video = avisource("F:\DVD_LAB\Sub-Lab\temp\show-sub.avi")
pic = ImageReader("F:\DVD_LAB\Sub-Lab\sub-logo\transparent\logo.gif", 0, 100, 25, true)
pic2 = FlipVertical(pic) # might be necessary if pic is flipped
Layer(video, pic, "add", 255, 0, 0)
-----------------------------------------------------------------------------------------
Wilbert
21st August 2003, 15:07
what is "use_DevIL"? it can only used in v 2.52 ?
AviSynth can read bmp rgb24 naively. For imporing other images it uses the DevIL library (you will need AviSynth v2.5).
by the way ,i haven't see gif file is support in the list:
That's a good one. I guess gif's are not supported? I will ask Richard about that.
Does the following script work:
ImageReader("F:\DVD_LAB\Sub-Lab\sub-logo\transparent\logo.gif", 0, 100, 25, true)
If not, you will have to convert the gif to some other format.
edl
22nd August 2003, 09:16
If not, you will have to convert the gif to some other format.
I need to show transparent picture in the video............
ColorKeyMask() (cause GIF only has index transparency) to get it transparent. You can then insert it somewhere on the video.
how to use ColorKeyMask()? I try it ,but failed ,(so fool.....)if I use color telerance to make picture transparent,it will looks like use VD'logo filter ,it is hard to control the transparent color value.
michaelang
26th August 2003, 04:18
From the avisynth manual, ImageReader read RGB24, without the alpha unless it is a eBMP. No document about eBMP and am still finding how to create it outside of avisynth.
<<<<<<
video=DirectShowSource("champnagne1.mpg").converttorgb32()
pic = ImageReader("Image1.bmp", 0, 0, 25,true).converttorgb32()
pic2 = FlipVertical(pic) # might be necessary if pic is flipped
pic3_M = ColorKeyMask(pic2, $FFFFFF,128) # mask out the white
FVideo=Layer(video, pic3_M, "add", 255, 0, 0)
return FVideo
>>>>>>
edl
26th August 2003, 19:11
OK,i have succeed ,thX
without you i can't finish it so quickly!:D
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.