Alfresco support, by default, the preview in your browser of some video formats like mp4 but doesn’t support some others like mkv, avi or wmv. Even if Google Chrome can read mkv files for example, if you try to use the action “View in Browser” (this is not the same thing as the preview), Chrome will not try to play the mkv file but will download it instead. That’s why if you upload an mp4 video in Alfresco, you will certainly be able to watch this video directly in your browser. In this blog, I will try to explain how to configure an external tool to take care of the thumbnails creation and transformations for your videos. To achieve that, we will install and configure ffmpeg. In addition to that, you can also very easily configure Alfresco to embed an external video player like “FlowPlayer” that would take care of playing all video formats directly “streaming” from Alfresco, not using your browser. Basically, this is done by replacing the preview page for some Mime types but I will not describe it in details here.
For this blog post, I will use /opt/alfresco-4.2.c as the $ALF_HOME environment variable: the folder where Alfresco has been installed. The current release of ffmpeg is version 2.6.3. This is at least working for Alfresco v4.2.x and v5.x.
I. Installation of ffmpeg
The ffmpeg binaries/executables are available in the ffmpeg website. From this website, download the “Static” build for Windows, Linux or Mac depending on the Operating System on which Alfresco has been installed. For this example, I will use a linux host (RedHat 6.x, 64 bits) but I can assure you that it’s working properly on Windows too. I already installed ffmpeg with several versions of Alfresco from v4.2.x to 5.x.
These commands will download, extract, change the permissions/ownership and rename the folder to something more friendly (at a more proper location too).
II. Configuration of Alfresco
Once ffmpeg has been installed, the next step is to configure Alfresco to use it. The first thing to do is to add some parameters in the well-known alfresco-global.properties file. Don’t hesitate to customize these paremeters, remove the lines that aren’t needed, aso…
In the above configuration, the parameter “ffmpeg.exe=/opt/alfresco-4.2.c/ffmpeg/ffmpeg” is the location of the binary file named ffmpeg. If you install Alfresco and ffmpeg on a Windows host, then this parameter looks like: “ffmpeg.exe=C:/Alfresco-4.2.c/ffmpeg/bin/ffmpeg.exe”
Once this is done, you need to enable the thumbnail & transformation extensions in Alfresco and this is done using the following steps:
If you want, you can parse these two files to understand what Alfresco will do with ffmpeg but basically these files define the commands and options that will be used by Alfresco.
And that’s it, Alfresco has been configured to use ffmpeg for thumbnails creation and transformations of your video. For Alfresco to take these changes into account, simply restart your Application Server using an Alfresco service:
Or using Alfresco default scripts:
To check if ffmpeg is working properly, simply open Alfresco Share, browse your repository to find a video with an avi or wmv format and a thumbnail should now be present (if not, just refresh the page…). You can also try to upload a video and if a thumbnail is created for this video, then ffmpeg is working!
We use cookies on our website to provide you with the most relevant experience by remembering your preferences. No personal data is stored. By clicking on "Accept All", you consent to the use of ALL cookies. However, you can visit "Cookie Settings" to provide controlled consent. Read More
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.