Integrations

Create alternative video files

ResourceSpace can be configured to automatically generate a video file in a different size or format from the uploaded original. This may be particularly useful where a smaller size is required for uploading to the web.

alternative_videos

To configure this, the following options are used (with example values for two different video types):

$ffmpeg_alternatives[0]["name"]="QuickTime H.264 WVGA";
$ffmpeg_alternatives[0]["filename"]="quicktime_h264";
$ffmpeg_alternatives[0]["extension"]="mov";
$ffmpeg_alternatives[0]["params"]="-vcodec h264 -s wvga -aspect 16:9 -b 2500k -deinterlace -ab 160k -acodec mp3 -ac 2";
$ffmpeg_alternatives[0]["lines_min"]=480;
$ffmpeg_alternatives[0]["alt_type"]='mywebversion';

$ffmpeg_alternatives[1]["name"]="Larger FLV";
$ffmpeg_alternatives[1]["filename"]="flash";
$ffmpeg_alternatives[1]["extension"]="FLV";
$ffmpeg_alternatives[1]["params"]="-s wvga -aspect 16:9 -b 2500k -deinterlace -ab 160k -acodec mp3 -ac 2";
$ffmpeg_alternatives[1]["lines_min"]=480;
$ffmpeg_alternatives[1]["alt_type"]='mywebversion';

Note: Before applying the above, check that the values entered, in particular the vcodec and acodec, are supported by ffmpeg ('ffmpeg -formats'). Each configuration block represents a defined size. For more information about the 'params' available, see the documentation for ffmpeg.

Offline generation

It is recommended that system administrators enable the offline job queue so that users uploading files do not have to wait while previews and alternative files are created. 

Additional Options

If ResourceSpace is configured with $originals_separate_storage=true; then the following configuration can be used to vary the destination of the alternative file:

$originals_separate_storage_ffmpegalts_as_previews=false; 

The preview shown when viewing the resource may also be updated to allow selection and preview of the alternative files generated by $ffmpeg_alternatives. To make them available in the preview window, the configuration below can be added and updated to match your files:

$videojs_resolution_selection[0]["label"] = "Original";
$videojs_resolution_selection[0]["name"] = "";
$videojs_resolution_selection[1]["label"] = "Custom";
$videojs_resolution_selection[1]["name"] = "custom_size"

Note: "name" is the value specified in $ffmpeg_alternatives[]["name"]