---
title: "Batch process files in Shogun Post"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737847/Batch%20process%20files%20in%20Shogun%20Post"
format: markdown
---
Batch processing in Shogun Post enables a specific operation to be performed on a group of files. Operations can range from reprocessing, file export, custom pipelines, or scripts. Generally, an operation opens a file, performs a process that you have defined, and exports a new file (however, not all of those steps are required and it depends on your selected process).

Shogun Post can batch process files sequentially in the application or in parallel—the latter enables you to continue with other tasks while batch processing continues in the background. You can process files in parallel within a single PC, or “farm” out the work across multiple PCs.

For examples of the different batch processing methods and when to use them, see the following descriptions.

<details>
<summary>Batch process locally within Shogun Post</summary>

For simple processing jobs, one approach is to process the files on a single machine. For example, you may have 100 files that are all cleaned up, ready to export, and the exporting process takes less than a minute per file. In this case, it’s much easier to process the files on one machine (as it only uses one core of your PC’s CPU). You can do other tasks in another instance of Shogun Post while the files are being processed. However, you can achieve the same result quicker by batch processing the jobs in parallel, or by distributing the work (also known as “farming”). For more information, see [Set up distributed batch processing](#SetUpDistributedBatch).

For simple processing jobs, load your files into the **Batching** panel, configure the processing settings (in either the **Batching** or **Processing** panel), and start processing your files. The smaller the file size, the quicker the processing time.
</details>

<details>
<summary>Batch process files in parallel using a single PC </summary>

Some processing operations are limited to a single or small number of CPU cores, most often to achieve better processing quality. If you use this approach, we recommend you use a machine with the most cores available, so the processing can be done on a single machine using these different cores. To use this single-machine approach, run multiple instances of the ShogunPostCL workers on the same machine as the Shogun Post controller, and then farm out the processing job across the ShogunPostCL workers. For more information on running workers on the same machine as the controller, see [Set up workers locally](#LocalBatching).
</details>

<details>
<summary>Batch process files in parallel using multiple PCs</summary>

Use a single PC to run Shogun Post as a controller and farm out the work by running ShogunPostCL on other machines to act as workers. Each file to be processed is then sent to a worker that opens the file, performs the required processing, and saves the processed file as a new file.
</details>

<details>
<summary>Distribute reconstruction of a single file across multiple cores or machines</summary>

For better reconstruction quality, use a low number of CPU cores when processing the files. Longer takes require more time to reconstruct, however, you can use an option to split the take into time ranges so you can distribute the reconstruction for each of these time ranges.
</details>

For information on how to set up batch processing, see these topics:

> Macro (toc)

## Set up local processing

If you need to process one or two moderately sized files (less than 1 GB) or have lots of small files to process, it is easier to process these files on a single machine. To do so, follow these steps:

1. In Shogun Post, on the **Panels** tab of the ribbon, select **Batching**.
2. From the Mode list, select one of the batching modes:
  - Reconstruct
  - Post Process
  - Reprocess Markerless
  - Process Video
  - Replace Subjects
  - Custom
3. Configure the options. The mode that you select determines the available options.
4. In the **Batching** panel, expand the **Farm** section and make sure **Farm Work Group** is not selected. (Farming is only required for parallel batch processing).
5. Ensure the **Files and Processing** section is expanded and click **Add Files** to select the files to process.
6. After you have added the files, click **Start**.  
When Shogun Post is processing locally, the progress of each file in the batch operation is displayed in the lower left of the **Batching** panel.


    > Macro (anchor)




## Set up distributed batch processing

To set up batch processing, first set up your workers and then set up the controller to set up the distribution.

Before you begin, make sure all the machines are using the same version of Shogun Post and that each machine can access the input materials: 

**To prepare for distributed batch processing:**

1. Check the version number of the controller (Shogun Post):
  1. In Shogun Post, go to **Help** > **About Shogun Post**.
  2. Note the version number that is displayed in the dialog.
2. Check the version number of the workers:
  1. Open ShogunPostCL on each machine (see [Open ShogunPostCL](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736791/Work+with+ShogunPostCL#ShogunPostNormalMode)).
  2. Note the version number that is displayed in the first line on startup.
3. Ensure all machines (controller and workers) are using the same version of Shogun Post.
4. Make sure each machine can access the input materials, such as the files to batch, calibrations, and custom scripts.   
:check_mark: **Tip**: Place these files in a shared network location so each machine can point to the same input material source.

After you’ve ensured all machines are using the same version of Shogun Post and can access all input materials, you can set up workers in these ways:

> Macro (toc)

### Set up workers across multiple machines

1. Ensure ShogunPostCL is opened on each machine.
2. In each instance of ShogunPostCL, enter `slave on`.

ShogunPostCL is now in batch worker mode and is ready to receive commands from the controller (Shogun Post).

> Macro (anchor)



### Set up workers locally

1. Open as many instances of ShogunPostCL as required. The number of instances needed depends on the type of processing you require and the resources of the local machine (such as the number of cores or available memory).
2. In each instance of ShogunPostCL, enter `slave on`.

The workers are now in batch worker mode and are ready to receive commands from the controller (Shogun Post).

## Set up distribution in Shogun Post

After you have set up the workers, set up the batch processing distribution using a controller (Shogun Post).

1. In Shogun Post, on the **Panels** tab of the ribbon, select **Batching**.
2. From the **Mode** list, select one of the batching modes:
  - Reconstruct
  - Post Process
  - Reprocess Markerless
  - Process Video
  - Replace Subjects
  - Custom
3. Configure the options. The mode that you select determines the options available to configure.
4. If you are processing across multiple machines, ensure the file paths to the input material are specified and the location is accessible to each worker machine.
5. In the **Batching** panel, expand the **Farm** section and select **Farm Work Group**.
6. A list of workers is displayed in the Farm section. You can add and remove workers by selecting or clearing the check box in the **Enabled** column for the relevant worker.
7. Expand the **Files and Processing** section and click **Add Files** to select the files to process.
8. After you have added the files, click **Start**.

The **Batch Log** at the bottom of the panel displays the file status along with the worker that is processing each file.

> ✅ **Tip**  
> ✅ You can optionally group workers and a controller so that, for example, workers in a specified workgroup only process files from the controller in the same workgroup. For details, see [Group workers and a controller](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736791/Work+with+ShogunPostCL#CreateWorkgroup).

> Macro (anchor)



## Set up a watched folder to automate processing

In Shogun Post 1.19 and later, you can set up Shogun Post to monitor a specified folder for new files. Shogun Post automatically adds the files to a farm batch process as soon as they’re captured in Shogun Live or Shogun Markerless. Use this feature to automate reprocessing (to remove dropped frames), cleaning of takes, and file export.

1. In Shogun Post, on the **Panels** tab of the ribbon, select **Batching**.
2. From the **Mode** list, select the type of processing you want to be run on each file, for example, **Reprocess Markerless**.
3. Under **Settings**, configure any other batch settings you want, such as adding an appendage to the output filename.
4. Under **Files and Processing**, in the **Folder** box, enter or browse to the location of the files that will be captured and in the **File Format** list, select the type of file that is to be processed.
5. Select **Auto Add Files**.
  Batching immediately enters watching mode.
  If farming was not already set up, farming is automatically enabled and an instance of ShogunPostCL is opened.
  ShogunPostCL performs the processing of each file while Shogun Post watches for new files and coordinates the batching.  
As files of the type you selected in Step 4 are added to the folder you specified, they are added to the list of files to be batch processed.
6. To stop watching, clear the **Auto Add Files **check box.

> ✅ **Using a watched folder with distributed batch processing**  
> ✅ To use multi-instance or multi-PC batch farming with a watched folder, before enabling watching, configure the farm and ShogunCL instances as desired.