Skip to the content.

GoPro Labs Command Language

Setting Commands

All QR Codes are simple text strings, alphanumeric characters to describe settings and actions for your GoPro camera. It is fairly easy to learn, so you can create you own custom commands. Here is an example command to set video at 4K 60fps with some Protune customization: mVr4p60x-.5cFw55. Breaking-down how that command works, firstly all GoPro QR settings commands are separated with lowercase characters, so this command is interpreted in these groups mV r4 p60 x-.5 cF w55. This is what each command group means:

Any of these can be used on their own, or in a different order, however the order can have meaning. If the camera was currently in a photo mode, and you set the Protunes settings first, then switched to video, any Protune changes would be to the photo preset, the video will have whatever Protune settings you had previously. The individual commands within a QR code are performed in order, just like you would when using the touchscreen.

Option Commands

Just like settings, these alter camera options, not the settings used in a preset. Examples like beep volume and screen brightness. It turns out there are a lot of these. While each setting command is a single lowercase character, it can be followed by a number of either uppercase or numbers for the parameters. Option commands, starting with o can stack many parameter in one command. This is a single options command oV1B4D2 which translates to Volume - 10%, Brightness 40%, and LEDs rear only. The same command can be written as oV1oB4oD2, three separate option commands, but as storage in a QR code is limited so options can be stacked for more efficiency, this is also why spaces are not used between commands.

The Full List of Settings and Option Commands

Mode commands:

* Video Looping: You need to create this preset on camera, before this command will select it.
** Time/Night-Lapse modes: The camera defaults to having presets for only one time-lapse mode and one night-lapse mode, yet both modes have two configurations (video or photo.) For all QR Code mode commands to work, a preset is needed for every mode you wish to use. e.g. If you only have a preset for night-lapse video (NLV), the QR command for NLV will work, but will not for night-lapse photo (NLP). To solve this, create a new preset for NLP, and both video and photo night-lapse commands will work.

Defaults modes (on power up):

Resolutions:

Resolutions are also in the format rX(Y) - where X is the first character of the resolution, and the optional Y is aspect ratio, T - Tall 4:3, X - eXtreme 8:7, nothing is 16:9

Frame rates:

Timelapse and NightLapse frame rates:

Lens - FOV:

Audio (Raw controls):

Bitrate:

Color:

Depth (H11/12 only):

EIS (Hypersmooth control):

Exposure Lock:

Hindsight (Video modes H9-13):

White Balance:

ISO Minimum and Maximum (set to together with format i(max)M(min)):

(All cameras and Older Labs):

Note: Angles between 22 and 1 degrees are supported. Experiment for higher shutter speeds. You will need a good amount of light and/or a higher ISO.

EV Compensation:

Sharpness:

Night Photo exposure time:

GoPro MAX Shooting Modes

Feature with off and on commands:

Option (‘o’) commands:

GoPro HERO9-13 Front Screen option commands

Shortcut Menu Types (to be used with oSA, oSB, oSC and oSD)

Feature value Feature value Feature value Feature value
clear shortcut 0 burst rate 8 ISO max 15 horizon control 24
zoom 1 duration 9 mic type 16 speed ramp 25
fov 2 color 10 raw audio 18 scheduled capture 26
slowmo 3 EV comp 11 sharpness 19 hindsight 27
white balance 5 hypersmooth 12 timer 20 10-bit 28
shutter 6 interval 13 timewarp speed 21 nightphoto 29
bit rate 7 ISO min 14 wind noise 23 trail length 30

HERO11-13 UX modes: (limited, best to use the camera menu)

Action and Conditional Commands

Now you know how to set up your camera with QR commands, the fun really begins with Actions and Conditionals. Actions are starting !S or ending a capture !E, manual upload !U, beginning a live stream !G. As these actions are typically just pressing a button or camera menu, these actions can be enhanced based on time. e.g. !08:00S, which will sleep the camera until 8am, and then start capture (in the camera’s default mode.) We can also do an conditional capture based on time. e.g. >06:00<19:00mV~mNL!S with this command, if the time is greater than 6am and less than 7pm, set mode Video, else set mode NightLaspe, then start. You can start pre-programming actions with QR codes.

The Full List of Actions

Capture Triggers (Classic, invent your own below.)

examples:

Storing metadata (Permanent, survives power off)

Old style (firmware released before March, ‘24)

New style (after March, ‘24)

Example for display the owner’s name

*OWNR="Joe Bloggs"

Note: All strings must use " (ASCII 34) and not the (148) character.

All tags between OWNA and OWNZ will be displayed and stored in GoPro-owner.txt.

All tags between OWNa and OWNz will be only stored in the GoPro-owner.txt

Any four character code can be used for store other information. You can also store numeric data examples:

Storing metadata (Temporarily, until power off)

Old style (firmware released before March, ‘24)

New style (after March, ‘24)

Metadata extraction

All metadata in stored in a GPMF format with the MP4, 360 or JPG files, this is an open source, so if it free to integrated within any third party tool. The above global metadata can be extracted with this demo web tool

Some Four Character Codes are reserved for feature extensions

Macro support (since March, ‘24)

Added support for macros, or crude scripting subroutines. This expands the potential complexity for QR scripting, as the entire script is no longer limited to 255 characters. It would be possible to run scripts nearing ~1.2KB. Note: recursion is supported, macros can call other macros, and can call themselves.

Macros are saved in string FourCCs:

Example: This macro calculates the Light Value and stores the result in variable E
*LVAL="=Ii=Ss=I/100=S/I=E6.25=E*S=E#2"

e.g. *SUBA=”mVr4p60’60p’!S!2E!1N” Note: Use single quotes for text within double quotes.

In a separate QR Code will call LVAL and display the result
^LVAL"Current LV $E"

Note: for Macros that print output use single quotes for text within. *DPLV="^LVAL'current LV $E'"

Reset Actions

Scripting

The geek factor is highest in this section. This is close to a Turing-complete language, you can get many interesting capture control jobs done. There are save and load commands, additive metadata and clock time conditionals

Conditionals Based on Time

< , > and == characters are used to indicate a conditional: less than, greater than equal, and equal (== Since March 2024 firmware)

<08:45!S is equivalent to

if(current_time < 8:45)
    Start

>18:30!R is equivalent to

if(current_time >= 18:30)
    Repeat

==10:10!R is equivalent to

if(current_time == 10:10)
    Repeat

The if condition defaults to effecting only the one command after the condition

<08:45!S"Hello World" is equivalent to:

if(current_time < 8:45)
    Start
print "Hello World"

The start will happen if the condition is true, but the print message occurs whether true or false. To make the print also part of the true state you can use + between the joined commands.

<08:45!S+"Hello World" is equivalent to

if(current_time < 8:45)
{
    Start
    print "Hello World"
}

These can be stacked too, e.g. <08:45!S+"Hello World"+!60E is equivalent to

if(current_time < 8:45)
{
    Start
    print "Hello World"
    After 60 seconds End the capture
}

Conditions support else statements using the ~ character after the last ‘true’ command

<08:45!S+"Hello World"+!60E~!08:44N!R is equivalent to

if(current_time < 8:45)
{
    Start
    print "Hello World"
    After 60 seconds End the capture
}
else
{
    Sleep until 8:44 the next day
}
Repeat

Conditionals themselves can be stacked like >09:15<10:00!S is equivalent to

if(current_time >= 9:15)
    if(current_time <= 10:00)
       Start

However the else can only be applied to the last condition. >09:15<10:00!S+"Hello World"+!60E~!09:30N!R is equivalent to

if(current_time >= 9:15)
{
    if(current_time <= 10:00)
    {
       Start
       print "Hello World"
       After 60 seconds End the capture
    }
    else
    {
       Sleep until 9:30 the next day
    }
}
Repeat

The command language is kept simple, so it doesn’t maintain a stack on the conditional nesting.

Conditionals Based on Camera Status (HERO11-13)

New conditional commands for 2023. Now >xValue and/or <xValue and/or ==xValue can be used to test camera states, where ‘x’ is the camera state to test, and Value the amount to test against:

Assignments, Variables and Math

QR Command scripts can include variables and operation on them. Why? Fun maybe? More power, for sure! A complete program in a QR Code.

As ‘a’ to ‘z’ and system system fields, ‘A’ to ‘Z’ are the variable can contain any floating point number. This new variables are all initialized to zero, and can be tested with the ‘<’ and ‘>’ conditionals. To make them non-zero, they can be assign with and ‘=’ command. Just like with conditions and action, the ‘=’ character is the command delimiter and comes first.

=A5 is the command variable A = 5.

=P3.14159265 assigns Pi to variable P.

Now math can be used to modify your variables.

There should be a prize if some can come up with a practical use for all of these ;)

So if thought the above is crazy, it gets weirder.

Why Add Math to QR codes

You the user can have very particular shooting needs, this improves the robustness of Labs to cover a wider range of automatic captures. And is it cool. ;)

Say you want use a GoPro as a crude light meter, and report the output as an exposure value, then make capture decision based on that EV value.

EV = logbase2 (f-number^2/(time x gain_above_base_iso)) is the formula for EV

As a QR command: =E6.25=Gi=G*0.01=E/G=E*s=E#2"Exposure value $E"!R

Command steps explained:

E=6.25
G=ISO value
G=G*0.01
E=E/G
E=E*shutter value (1/s)
E=log(E)/log(2)
print E
repeat

updated: November 5, 2024

Learn more on QR Control