Build a Proxy and associate with a sequence.
Goal
Our goal is to make a proxy of an original file, and associate the proxy created to the current sequence.
Proxy will be displayed in forms without bothering with paths management.
Furthermore proxies will be deleted when the sequence is deleted.
Components used
What do you need before starting?
- A path to the original file.
- A File Connector configured to access the proxy's storage.
Solution Overview
The Register media task
This task will collect information and create path variables where to generate the proxy and where to optionnaly move the original file
Input:
a smartpath or a full URL to the original file
Result
After Register Media execution, your context will contain new value:
local_file_path
: path to the original.proxy_path
: path where to create the proxy in
The FFMPEG task
In order to create a proxy, we need to transcode the original file into a format that can be played in your browser. h264 is the most widely used codec used as proxy code, and it is supported by all the browsers.
[Input] path in FFMPEG will be set to local_file_path
as it points to the original file.
[Output] path will be set to proxy_path
as a target to save the proxy file.
FFMPEG Command
The full FFMPEG command will replace input / output placeholders and will generate in this example a very simple proxy generation command that could be optimized for your own needs.
'ffmpeg -i [input] -vf scale=320:-1 [output] -y'
After executing the FFMPEG command, execution will go to the green dot of Register media with a new variable in context: registered_media
which could be used in forms
to display the proxy, or in get registered media task to retrieve source and proxy path