Video Plugin 4.1
This plugin provides low level facilities to process video files : automatic conversion of uploaded videos, thumbnail selection from pictures extraction of the video.
This module provides a mechanism to automatically convert videos submitted to JCMS as Document, in a specific format (default to MP4). It can also extract thumbnails from video, and it provides utility methods to process the videos (which can be used in other modules).
Upload plugin in JCMS and restart
FFmpeg MUST be installed on your system and the FFmpeg main binary must properly be referenced in the administration area of the plugin.
Installation on Windows :
Download Windows binary suitable for your architecture or compile your own distribution, then reference the
ffmpeg.exe path in the administration area.
- Downloading binaries : Jalios DOES NOT recommand nor endorse any particular site for precompiled Windows binary, none the less, you can check the following site to retrieve uptodate release for win32 and win64 architecture : Zeranoe FFmpeg
- In the plugin administration area, fill the FFmpeg path with the absolute path of the
ffmpeg.exebinary, without any double quote for example :
Installation on Linux / Unix:
Install FFmpeg by using the packaging system of your linux distribution, then reference the
ffmpeg binary path in the adminisration area.
Detailed steps, using Debian linux as an example :
- Install FFmpeg :
apt-get install ffmpegThis usually includes the installation of dependency libraries to support additional codecs, though, on some Linux distribution you might be required to explicitely specify the additional package. Refer to the documentation of your linux distribution to ensure proper codecs are installed..
For example, here is the installation command for Ubuntu 10.10 to support all video codec :
apt-get install libavcodec-extra-52
- In the plugin administration area, fill the ffmpeg executable path with the absolute path of the
ffmpegbinary, without any double quote for example :
2.2 Video conversion profile
The video plugin comes with predefined video conversion profiles which provides all the required FFmpeg settings. Thus, you do not have to perform advanced configuration of FFmpeg (it is none the less possible should you need it, see advanced configuration chapter).
The default video conversion profile is set to "mp4".
- mp4 (default)
- This settings convert videos in 320x240 pixel, in the MPEG4 container format using the H264 video codec, in a medium compression format. This format is suitable for the default flash video player of JCMS 7 and compatible with all smartphone including iPhone and iPad.
- Settings for use with ffmpeg < 1.0:
This settings use an FFmpeg pre-settings file which requires an FFmpeg version after 0.6, but before 1.0.
This settings are not compatible with latest FFmpeg build version available on Windows or on very recent linux distribution. Using it will result in error "Invalid option or argument: 'directpred=1', parsed as 'directpred' = '1'".
If you are using a recent ffmpeg version, you will have to configure a custom settings (see advanced configution) or use the mp4-latest settings below
- mp4-latest (available in plugin version 3.2)
This settings provide the same features as the mp4 settings described above (320x240, MPEG4, H264 codec, supported by flash player, smartphones compatible), but it must be used with recent version of ffmpeg.
Settings for use with ffmpeg >= 1.0:
This settings use an FFmpeg pre-settings file which requires FFmpeg version 1.0 or above.
This settings are not compatible with older FFmpeg build version available on classic linux distribution . Using it will result in error "Unable to parse option value "baseline"Invalid value 'baseline' for option 'vprofile'".
- This settings convert videos in 320x240 pixel, in the FLV container format using the FLV1 video codec. This format is suitable for the default flash video player of JCMS 7 but will not be readable iPhone and iPad. It does not require recent version of FFmpeg, thus is suitable for most linux distribution.
- This settings convert videos in 320x240 pixel, in the AVI container format using the hufyuv video codec. This format is suitable for the Internet Explorer viewing through Windows Media Active-X
2.3 Auto Convert
If the module is set in "autoconvert on" all submitted video files through JCMS interface and corresponding to the listed mime types in the module parameter are submitted to FFmpeg for conversion to FLV.
If the module is set in "autoconvert off" when submitting a file with the docChooser, the contributor must explicitly specify whether to convert the video or not. These conversions may fail for technical reasons, usually due to the original file (codec unknown, or not being decoded by FFmpeg or partially corrupted file).
The conversion is performed in the background and do not block the user.
3. Advanced configuration
If you want to fine tune the video conversion settings, you can define your own FFmpeg configuration profile in the properties.
- Choose a unique identifier for your custom configuration profile. e.g: "fastmp4"
- Define the following properties in the custom.prop file or in the plugin.prop of you site plugin
The mime type of the video autorized for conversion
The file extension (and container format) to use for the converted video.
The FFmpeg parameter to use for video conversion (this does not include source and destination filename)
- Reference your unique identifier in the administration area of the plugin or through property
Example : This example will convert most videos in a MP4/H264 combination using a fast FFmpeg conversion setting to prevent high CPU usage of the server.
jcmsplugin.videoplugin.conversion.profiles.fastmp4.valid-mime-types: video/avi video/quicktime video/x-flv jcmsplugin.videoplugin.conversion.profiles.fastmp4.targetformat: mp4 jcmsplugin.videoplugin.conversion.profiles.fastmp4.cmd-options: -s 320x240 -vcodec libx264 -fpre /usr/share/ffmpeg/libx264-ultrafast.ffpreset jcmsplugin.videoplugin.conversion.profile: fastmp4