Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
28th May 2018, 18:29 | #1 | Link |
Registered User
Join Date: May 2016
Posts: 235
|
Merge transparent background image on some frames?
I got a clip I want to add an intro-text on but only for a few frames, lets say frame 156-256. the image is a png with transparent background (same resolution as the video). I want the image to show only the text in it (bland and white is used with transparent background) over the video (moving images).
I have tried to search but I only finds how to add a transparent logo for a full clip and that is not what I am looking for.
__________________
Automatic Colorization Last edited by color; 28th May 2018 at 20:33. |
28th May 2018, 19:21 | #2 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
You can mix and match versions with Trim()
e.g. Let's say "A" is original "B" has the overlay A.Trim(0,155) ++ B.Trim(156,256) ++ A.Trim(257,0) There are other ways too, such has helper functions like ReplaceFrames, ReplaceFramesSimple, ClipClop etc... They would be easier depending on how many sections you are doing |
28th May 2018, 20:28 | #3 | Link |
Registered User
Join Date: May 2016
Posts: 235
|
I feel stupid.
A=DirectShowSource("thefile.mkv") B=ImageSource("01.png") Overlay(A, B.Trim(1852, 1986), mode="difference") I don't know what mode to try, I did try the most of them but no one worked. And trim don't seems to work as I think it does, the first isn't that the start frame and the last one the end?
__________________
Automatic Colorization Last edited by color; 28th May 2018 at 20:32. |
28th May 2018, 22:59 | #4 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
It would look something like this Code:
A=DirectShowSource("thefile.mkv") B=ImageSource("01.png", start=0, end=A.framecount-1, fps=A.framerate, pixel_type="RGB32") C=Overlay(A,B, mask=B.showalpha()) A.Trim(0,155) ++ C.Trim(156,256) ++ A.Trim(257,0) I would avoid using DirectShowSource, because it is prone to many problems, including seek/frame accuracy Think of it like this: A is the original B is the image itself, made into a "video", with the parameters of "A" in terms of framecount, fps C is the original with the image overlaid with alpha channel on the entire video You're mixing and matching parts of A with C. Last edited by poisondeathray; 28th May 2018 at 23:04. |
|
|
|