Hello,
I want to create an overlay HTML on shotcut, with an image continuously going up and down of my screen.
I am quite new in HTML coding and I have tried to use a marquee tag (with alternate and corresponding direction). However, the image is moving only by the height of the image (-ish).
Even if I try to set up a different height, the image is not going down to the bottom of my screen. Can someone help me how to define the height of the animation to full screen?
Or is there another way to do this kind of animation?
CSS3 Animations (and the <marquee> tag, which is now obsolete) do not âplayâ well with Shotcut, due to the lack of synchronisation between CSS and Shotcutâs processing of frames. There are ways to do it and I have created several utilities to make it a bit simpler for users. You can also use Shotcutâs Size-and-Position filter to move text around the screen.
If you want to use the Text:HTML filter (which used to be called Overlay-HTML) for animation (and other things) then have a look at my website: http://elusien.co.uk/shotcut/index.html
If you post a copy of your HTML file I could have a look at it and maybe sort out what you want to do.
Many thanks for your reply Elusien !
And thank you for your links
I am not sure I can use Size-and-Position as I want the image to keep moving during the whole video, but again, I may be wrong
Above my background video, I want to insert an image which would slowly move on a vertical line (up and down, and so on). Like a bouncing ball in a wayâŚ
The purpose of my video, if that can help you understand what Iâm looking for, is for a relaxation tool in which the image would help the person for respiration (inhale during the rise of the image and exhale when going down)âŚ
Iâve tried to write the following (again I tried different options and Iâm not at all sure of the accuracy of my codingâŚ) :
"
marquee behavior=âalternateâ direction=âdownâ scrollamount=â2â height=â500â
marquee behavior=âalternateâ direction=âupâ scrollamount=â2â height=â500â
img src=âImage1.pngâ hspace=â100â
"
It is as I suspected. Your HTML animation is not synchronised with Shotcutâs framerate and also the parameters on <marquee> do not allow you easily to set the positions on the screen. If you give me an hour I may be able to come up with something for you to experiment with.
OK I have put something together. It is in the following file : marquee.zip (49.1 KB)
Download it and then un-zip it.
The file contains 2 javascript library files (ending in .js) you need not worry about these, just leave them as they are as they are used by the HTML file (New_Marquee.html). You will have o edit this file. You see one line that says:
img {margin: 0 100px; height: 50px;} /******* 50px is the height of the image */
Change the â50pxâ to be the height of your image.
You will later on see two lines thus:
{offset:1, "transform": " translateY( 310px)",} //******** SEE ABOVE FOR WHY IT IS 360 pixels
{offset:1, "transform": " translateY(-310px)",} //******** SEE ABOVE FOR WHY IT IS 360 pixels
change the value"310" to half the videoâs vertical resolution minus the height of the image.
You can now use this as your Text:HTML (Overlay-HTML) filter. It looks complicated, but it isnât really, itâs the only way though that I know to do what are wanting to do. Let me know if you have any problems with it.
Wow this is perfect, thank you very much !
After the changes for the height as suggested, and deleting âA/Bâ it works well on my screen!!
Thanks also for the additionnal comments about the speed
Last question, if I may⌠If I want to use this code but with only one image going up and down of the screen (instead of two moving here), should I just change the height (not dividing the total height in two and so on), and probably comment all the parts related to âdown-upâ for instance⌠Would it be ok or am I missing something?
More or less - yes. You only need to delete the HTML that says:
<div id="up">
<img src="Image.gif">
</div>
and change the line that says
{offset:1, "transform": " translateY( 310px)",} //******** SEE ABOVE FOR WHY IT IS 360 pixels
To replace the â310â to the videoâs vertical resolution minus the image height. You can leave everything else as it is, rather than inadvertantly deleting something you shouldnât have.
One more point. Instead of a linear speed for the animation you could play around by replacing the easing:âlinearâ by easing:âease-inâ or easing: âease-outâ or easing : âease-in-outâ.