# Video preview conversion

## Component/part description

Convert input video into lower res video preview. For hypertranscript view.

Uses ffmpeg. Fluent ffmpeg.

## Related projects

NA

## Implementations Options considered

initially converted to `ogg` video. Quality was very poor, so moved to webm.

Then in previous implementation using NWJS this needs to be `webm` coz `mp4` not supported. Issue is making it cross browser compatible. `webm` not supported by safari and iOS.

## Current implementation

However with the recent move to Electron, was able to refactor and add support for `mp4`.

ffmpeg command&#x20;

```bash
ffmpeg -i inputfile -vf "scale=-1:360" -c:v libx264 -preset ultrafast -crf 40 output.mp4
```

see component&#x20;

{% embed url="<https://github.com/OpenNewsLabs/autoEdit_2/blob/master/lib/interactive_transcription_generator/video_to_html5/index.js>" %}

&#x20;

{% embed url="<https://trello.com/c/IPZ8mKhL>" %}
in textAV components
{% endembed %}

## What needs refactoring

Seems quiet fast now.&#x20;


---

# 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://autoedit.gitbook.io/documentation/transcriptions/transcriptions-intro/video-preview-conversion.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.
