# Organize Videos

**Organize Videos** <img src="https://cdn.prod.website-files.com/67008ba73b4fd0346790d085/6793dd97f4b7381f5c91e641_24.Organize%20Videos.svg" alt="" data-size="line">

The Organize Videos tool converts a folder of videos into a structure that can be used by Theia3D. This functionality is useful when collecting large data sets.

{% hint style="danger" %}
Video names must not contain accents, as these can cause errors during the Organize Videos process. Use only alphanumeric characters with space, hyphen (-), underscore (\_), or period (.) as delimiters. Avoid using commas (,) or semicolons (;).
{% endhint %}

***

## **Basic**

The Basic tab is the best option when organizing videos that have user-defined file names, such as those collected using OptiTrack, Qualisys, or Vicon camera systems. To use this tool, it is recommended to include relevant details about the trial as part of the file name, consistently separated by one delimiter from the following options:

* Space (' ')
* Hyphen ('-')
* Underscore ('\_')
* Period ('.')
* Space (' ') and Underscore ('\_')

With video files named in this way, the dropdown options below can be assigned to each delimited portion of the filename, resulting in an intuitive file structure that maintains this information for each trial:

* Cam ID: (Required) The ID of the camera corresponding to the video file. This must be the same ID as in the calibration file.
* Subject: (Recommended) Unique subject identifier (e.g. sub001).
* Action: (Recommended) The action the subject is performing (e.g. walk).
* Trial: (Recommended) The trial number (e.g. 001 or walk01).
* N/A: (Optional) Additional terms in the filename not used by Theia3D.

{% hint style="info" %}
While these reserved terms are separated by the delimiter, the terms themselves cannot include the delimiter. For example, if underscores are the delimiter, “slow\_walk” is not a valid Action term because the program will parse it as two separate terms (“slow” and “walk”). In this case, consider using camel case ("SlowWalk") to specify the action.
{% endhint %}

{% hint style="danger" %}
Acceptable delimiters include space (' '), hyphen (-), underscore (\_*),* period (.), or space and underscore (' ' and \_). Delimiters that should not be used include comma (,) and semi-colon (;).
{% endhint %}

<figure><img src="/files/L2c7nFsp3bVgAOkP9Jts" alt=""><figcaption><p>The Basic tab of the Format Videos dialog.</p></figcaption></figure>

To format video data using this tool, follow the steps below:

1. Select the delimiter used in the file name.
2. Use the Browse button to select the folder containing the videos. Once the directory has been selected, the dialog will parse the name of a sample file. Note that the delimiter can be changed after the folder is selected and the sample file name will be re-parsed.&#x20;
3. Use the drop down menus to select the reserved term that each part of the filename corresponds to.&#x20;
4. Click Execute to organize the data into the required structure. The hierarchy of the created directory is Subject > Action > Trial > Cam ID. Cam ID is the only reserved term that *must* be included in the filename; however, it is recommended to include any other relevant details about the trial as part of the filename.

For example, consider a folder with the following video names:

* S0001\_Walk\_001\_8\_21375.avi
* S0001\_Walk\_001\_8\_21376.avi
* S0002\_Walk\_001\_8\_21375.avi

To format these videos, the reserved terms selected are: Subject, Action, Trial, N/A, and Cam ID. The data structure after formatting is:

<figure><img src="https://cdn.prod.website-files.com/67008ba73b4fd0346790d085/674420586c292ea78cc91761_data_maintenance_folder_structure.png" alt="_images/data_maintenance_folder_structure.png" width="375"><figcaption></figcaption></figure>

### **Top Level Only**

When enabled, this option sorts only the video files located directly within the current folder. Any subfolders and the files they contain are ignored during the sorting process. This ensures that only the top-level contents are affected, and can be useful when adding new, unorganized data into a folder with existing, organized data.

***

## **Advanced**

The Advanced tab is the best option when organizing videos that do not have user-defined file names, such as those collected using Sony RX0 II camera systems. To use this feature, the names of the video files must end with *camid\_trialid*, where *camid* is the ID of the camera that recorded the video and *trialid* is a unique identifier for the trial.

‍When exporting videos using the Sony RX0 II camera system browser interface, make sure that the Name of Imported File options are selected as follows:

* Add the Camera Label (prefix)
* Do not add the Shooting Date/Time

<figure><img src="/files/V6UEcrHR9cU71JOnX0ta" alt="" width="469"><figcaption><p>Video export filename options available in the Sony RX0 II camera system browser interface.</p></figcaption></figure>

<figure><img src="/files/E6jTb0YfpMnbxgL2IOHx" alt=""><figcaption><p>Advanced tab of the Organize Videos tool.</p></figcaption></figure>

To format video data using this tool, follow the steps below:

1. Use the Browse button to select the folder containing the videos. The trials table is then created with one row for each trial. The File column of each rorow is filled with the *trialid* for that trial.
2. Use the Load Subject and Action Assignments button to load the subject and action IDs for each of the trials from a csv file. Each row of the csv file must contain the *trialid*, *subjectid*, and *actionid* of a single trial, in that order, separated by commas. For example, the csv file used to assign the subject and action IDs in the above figure was:

```
C0001,Calibration,Chessboard
C0002,S0001,Walk
C0003,S0002,Walk
```

3. Press the ***Execute*** button to format the videos in the required folder structure.

Alternatively, Subject and Action details can be manually assigned to the trials table without using a CSV file:

1. Double click any cell to type in the Subject or Action ID.&#x20;
2. Click ***Save Subject and Action Assignments*** to save the filled table as a CSV.&#x20;
3. Press  ***Execute*** to format the videos in the required folder structure.

{% embed url="<https://youtu.be/7vrzn35wsG8>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.theiamarkerless.com/theia3d-documentation/theia3d-dropdown-menus/tools-menu/organize-videos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
