How to make looping videos (for cinemagraphs, looping GIFs) using Davinci Resolve

The challenge: Loop a short video clip seamlessly so that it appears to go on forever.

Let’s take this drone footage*:

It’s not terribly interesting or noteworthy but it’s good enough to demonstrate the concept.

If we simply repeat the same video multiple times, there will be a noticeable jump (repeated 4 times below):

If we reverse the video, the frames will match but the direction of the movement won’t, which makes it look rather goofy (this is what Instagram does with Boomerang):

The solution: Blend the video onto itself

I have used DaVinci Resolve for the following steps (a powerful free version is available),  but the concept is the same, regardless of the software. I first cut the video down to a shorter clip (which cannot start at the very beginning of the original footage). As far as the length of the clip is concerned, this is up to your artistic vision and experience. If there’s a discernible repeating movement in your video, you can use this for orientation. I picked a one-third rotation of the wind turbine in the upper left corner:

Wind turbine

The looping playback control can be very useful during this step:

loop playback

The resulting clip was just a little over 2 seconds long:


I then copied it to another track and moved both to the right for demonstration purposes:

clip copied

Next, I lengthened the clip on the upper track by dragging the “in” point to the left:

in point dragged to left

Note that the upper clip starts earlier in time and contains footage which is not a part of the lower clip.

I then shortened the upper clip by also dragging the “out” point to the left. The end of the upper clip now perfectly matches the beginning of the lower clip (because it is the part of the original video that comes just before it):

Out point dragged left

So far, this looks like a needlessly complicated way to split a clip (and yes, you could do it on a single video track). Things got more interesting as I moved the entire upper clip to the end of the lower clip (and moved both of them to the beginning of their tracks):

upper clip moved to end

Obviously, yhis resulted in a clearly visible jump at the point where the upper clip starts. However, this jump can be made a lot less noticeable by slowly fading the upper clip in:

blended onto itself 1

The video had now been blended onto itself and I had ensured that the frame at the end was a perfect match for the frame at the beginning.

Here’s the result, repeated 10 times:

If you know what to look for, you can see the blending happening (particularly in the water). To make it less obvious, I lengthened the upper clip and the blend:

video blended onto itself 2

This is the result (again repeated 10 times):

This is the basic concept. You can improve the result in DaVinci Resolve by freezing everything except for the parts where movement should be visible (and also by stabilizing and color grading the video):

If you want to learn more about DaVinci Resolve, I recommend reading the extensive user manual or watching some video tutorials (like the ones made by Casey Faris or Ripple Training). Should you have any questions, I recommend posting them in the official DaVinci Resolve forum (and not in the comments below).

* The video was recorded on a DJI Phantom 3 Standard. The ruin of the mill you see on the left is located in the Luxembourgish town of Moersdorf. The drone was launched from the German side of the river.



Java: Missing key codes on non-US keyboards

Java does not seem to have key codes for several keys on non-US keyboards. This does not prevent the typed characters from being recognized, but it makes it impossible for the Robot class to simulate pressing these keys.

Examples of missing key codes

On a standard French AZERTY keyboard, 2 keys result in a key code of 0 (unknown key code): The key above the tab which generates the character “²” and the much more important ù% key.

On a German QWERTY keyboard, the ß?\ key and the äÄ,öÖ and üÜ keys are undefined.

You can confirm this using the Java KeyEventDemo:
Percentage key on AZERTY keyboard


Use the Alt Numpad input method.


Create GS1 DataMatrix barcodes with Brother P-touch Editor

Create GS1 compatible DataMatrix barcodes in P-touch Editor by following these steps:

Insert the DataMatrix barcode

In P-Touch Editor, select Insert > Bar Code from the menu. Switch to the Protocol tab and select the DataMatrix protocol:

DataMatrix Protocol

Add the Function 1 Symbolic Character (FNC1)

This special character is used to differentiate GS1 DataMatrix from other Data Matrix barcodes. Go to the Setup tab and check the Specify Industrial Protocol (FNC1) box:


Add the GS1 element strings

You must follow the GS1 rules when encoding data in a GS1 DataMatrix. I highly recommend that you review Chapter 2 (Encoding data) in the GS1 DataMatrix Guideline (PDF). P-touch editor won’t prevent you from making any mistakes!

As an example, I’m going to recreate the GS1 DataMatrix barcode found in TL A-0032 Part 1, Edition 7 (page 12).

It contains both a GTIN-13 (4012345000016) and a serial number (ABC17829). The corresponding GS1 DataMatrix Application Identifiers are 01 (GTIN-13) and 21 (serial no.). The GTIN-13 has to be padded with a leading 0 to match the expected length of 14 characters. Therefore, the concatenated string is  010401234500001621ABC17829:

GS1 DataMatrix data

The resulting barcode matches the example, though it seems that P-touch Editor cannot add the Human readable Interpretation (HRI):

GS1 DataMatrix comparison

You could, of course, add the HRI using the text tool.

For further information, please consult the GS1 DataMatrix Guideline (PDF)!