> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/online/re-encoding-a-video-stimulus.md).

# Re-encoding a video stimulus

Re-encode a video stimulus that does not play in every browser, such as an interlaced video, into an MP4 file that you can upload to iMotions Online.

Some video formats, such as interlaced video, do not play in all browsers and on all devices that respondents use. This guide shows three ways to re-encode such a video into an MP4 file that you then upload as a stimulus in iMotions Online.

When you add a video to a study, iMotions Online checks whether it is interlaced H.264 video. Interlaced H.264 video shows as a black screen in Safari on iPhones and iPads, so iMotions Online does not add it to the study and shows the error **This video format is not supported.** This applies both to videos you upload and to videos you choose under **Browse**. Re-encode the video with one of the methods below and upload the new file.

Keep the re-encoded video at 1920x1080 or lower. Higher resolutions can make the video buffer for respondents with slower internet connections.

{% tabs %}
{% tab title="iMovie (Mac)" %}
iMovie is free from the App Store.

1. Create a new **Movie** project and import your video.
2. Drag the video onto the timeline.
3. Choose **File > Share > File**, set **Resolution** to **1080p** and save. iMovie saves an MP4 file.

Do not trim the video or add anything to it, and keep the original aspect ratio.
{% endtab %}

{% tab title="HandBrake" %}
[HandBrake](https://handbrake.fr) is a free video converter for Windows and Mac.

1. Open your video with **Open Source**.
2. Under **Preset**, choose **General > Fast 1080p30**.
3. On the **Filters** tab, set **Deinterlace** to **Decomb** or **Bwdif**, not **Off**.
4. On the **Video** tab, set **Framerate** to **Same as source** and select **Constant Framerate**.
5. On the **Summary** tab, set **Format** to **MP4** and select **Web Optimized**.
6. Choose a file name under **Save As** and click **Start Encode**.
   {% endtab %}

{% tab title="ffmpeg" %}
Run this command, replacing `input.mp4` with your video file:

```bash
ffmpeg -i input.mp4 -vf bwdif=mode=send_frame -c:v libx264 -crf 18 -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart output.mp4
```

The command deinterlaces the video and re-encodes it as progressive H.264 with AAC audio, keeping its frame rate and length. To also scale a video larger than 1920x1080 down, use `-vf bwdif=mode=send_frame,scale=-2:1080` instead.

To check the result, run this command. If any line shows `1`, the video is still interlaced.

```bash
ffprobe -v error -select_streams v:0 -show_entries frame=interlaced_frame -read_intervals %+1 -of csv=p=0 output.mp4
```

{% endtab %}
{% endtabs %}

When the re-encoding is done, upload the new MP4 file in the Study Builder.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/online/re-encoding-a-video-stimulus.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
