Generate Shake Effect with Bash in Kdenlive!?

(I am Japanese. I'm using DeepL, so forgive me if there are some odd words)
Hey guys.
I'm going to show you how to generate a shake effect in Kdenlive.
First, watch the video! (If you jumped from the video, go straight down!)
This is a macro using xdotool.
I'm using bash to build the macro. (In the video, you also ran the script "shake.bash" !)
------------------------------------------------------------------------------------------------------------------------
RANGE=5

shake(){
    #advance one frame
    xdotool mousemove 1633 529
    xdotool click 1
    #Increase the number of keyframes
    xdotool mousemove 1630 705
    xdotool click 1
    #Specify x-coordinate
    xdotool mousemove 1633 736 
    xdotool click 1
    xdotool key Ctrl+a
    xdotool key BackSpace
    VAR1=$((($RANDOM % 11)-5)) #Put once into variable to enter as string
    xdotool type " ${VAR1}" #Assign to string and enter

    xdotool mousemove 1691 736 
    xdotool click 1
    xdotool key Ctrl+a
    xdotool key BackSpace
    VAR2=$((($RANDOM % ($RANGE * 2 + 1))-$RANGE)) 
    xdotool type " ${VAR2}" 

for i in $(seq $1)
do
shake
done
------------------------------------------------------------------------------------------------------------------------
The actions performed by this macro are
1. advance frame by 1
2. add a key frame
3. enter a number in x,y

The number you enter in 3 is a random number. In the script I used this time, the range is from -5 to 5.

If you use this script, you should note that the two numbers in the "xdotool mousemove" argument will be different in your environment than in mine.

This number represents the coordinates in the screen. If you get this value wrong, the script will click somewhere completely unrelated and will not produce what you want.

The coordinates can be obtained by executing the command "xdotool getmouselocation" with the pointer over the button that needs to be pressed.

As for which buttons to press (it may be tedious), please check the video.
I am writing this article in a hurry and cannot provide images. (This is to answer those who commented on the video as quickly as possible.)
I will add images in the future when I have more time and the inclination to add them. Sorry for now, but please watch the video.

In this article, i showed how to generate shake effects with Kdenlive.
I hope this has been helpful for many kdenlive users (Linux users especially).
See you again when you get a chance!
Bye.

コメント

このブログの人気の投稿

RTMでワールドが開けなくなった!どうする?(RTM1.12.2版)

【随時更新】HoI4観戦の現況