Freeze-frame automation with Auto Hotkey

I wrote an Auto Hotkey script to automate making a Freeze-frame still image quickly in a video. Please note, Auto Hotkey is for Windows only (as I understand it).
Here’s my quick YouTube tutorial:

How it works: It’s basically a sequence of standard Shotcut keyboard shortcuts.

NB Before starting, select the desired duration of the freeze-frame (eg 1 second or 5 seconds), using the JUMP feature (CTRL/J).

Explanation of how the AHK script works:

 numpad1::

Sets number-pad 1 as the first hotkey (trigger).

Send, +s

Splits all clips at the playhead (Shift/s) - note - this feature has only recently been added to Shotcut

 Send, ^+e

Exports frame (Ctrl/Shift/E)

 Send, Freeze-frame image
 Sleep, 100
 Send, {space}
 Sleep, 100
 Send,% clipboard		; Type the text saved in the clipboard

Clever! This types “Freeze-frame image 01” before saving the frame.
The next time you use the script it will save the frame as “Freeze-frame image 02”
(increasing incrementally).
The “sleep, 100” entries pause the AHK action by 100 milliseconds so as not to overwhelm Shotcut.

 send, {return}

Save the exported frame

send, !{PgDn}

Moves the playhead forward the number of seconds you chose (Jump) Ctrl/J.

Return

Ends the script.

NB for the next part to work, you must have the “Recents” panel showing, and the mouse co-ordinates shown in the script below (1720, 187) must be positioned so that the mouse clicks on the top-most entry.

If this is not the case, change the co-ordinates to make this happen, or alternatively the second part can easily done manually without pressing the Auto Hotkey hotkey.

  numpad2::

Makes number-pad 2 the hotkey (trigger)

 MouseClick, left, 1720, 187

Mouse clicks at these co-ordinates of your screen (selecting the top entry in the Recents panel)

  send {LButton 2}

Double-clicks

Return

End of script.

Then you drag the PNG to the timeline. Press O (out) if necessary, or drag out the clip if the gap is longer than 4 seconds. Or you could change the default duration of clips if you want to do a lot of these at a certain gap length.

Note that the Auto Hotkey “hotkeys” can be changed - for example CTRL/1 would be written as ^1:: instead of numpad1:: - just change in a text editor, say Notepad, and save.

Here’s my AHK script if anyone wants to use it. Just to add though I’m not responsible if anything goes wrong with using AHK scripts… however it’s very stable in my experience - in years of using it I’ve never had any issues with it.
Shotcut - FREEZE FRAME fully automated (two clicks - numpad 1 and 2) by JonRay.zip (1.1 KB)

3 Likes

That’s clever @jonray. :+1:

One question, if you don’t mind: I kind of remember that one million years ago, you mentioned that you didn’t use the latest version of Auto Hotkey. I don’t recall the exact reason, but I think it had something to do with it not being compatible with the script you were promoting at the moment…
Anyways, is it still the case? Older version or latest?

2 Likes

Hi @MusicalBox - thank you.

You have a long memory. This was in the days when we all had a Woolly Mammoth as a pet. :smiley:

Good point, and an important one.
The AHK script I wrote is for version 1. Current version is v.2. V2 scripts are completely different from V1. I don’t understand V2 scripting (yet).
However, to my understanding if you are running V2, AHK will detect V1 scripts and run them with no problems.

Certainly works for me - I have V2.02 installed, but all my V1 scripts work fine.

auto hot key version

Thanks for bringing this up!

2 Likes

Frame export to clipboard. Great idea! How can this be implemented on Linux systems?

1 Like

Hi @zmintzoltan, this was posted before a new version came out exporting a frame automatically saved it with seconds/frames data - eg:

   Shotcut_00_00_03_167.jpg

so really my AHK script is out of date in this respect, although the principle remains the same.
In case you didn’t know, the export frame feature is available to all, including Linux:
Export frame shotcut

Thanks, I know frame export. But I don’t want to save the frame to the disk, only to the clipboard. ONLY ON THE Clipboard and from there put it back into the project.

1 Like

Did you also know that Export > Frame is also kind of doing something similar as copy the frame to the clipboard?

In fact it copies it in the Recent panel. From there you can double-click on it (to send it to the Source panel) and then drag it in the Timeline.

You still save it to the disk, but you don’t need to open the folder to add the saved frame to the Timeline.

2 Likes

I didn’t know that, thank you very much! It also simplifies video editing.

1 Like

Thanks for the help.
It’s ok, but should (in my opinion) be made easier by a direct freeze function in SC.

I need and use it often for Badminton-Lessons.
As soon as a video (or the whole track) has filters, it only works very awkwardly:
The filters have to be deactivated first before the image is exported.
Otherwise, after changing the video filters, the image no longer matches the video.

1 Like