I wanted to try the Adobe Media Server for streaming videos. On the development machine, Apache was already preinstalled. Adobe describes on their page, what to regard in order to install AMS (Adobe Media Server), when Apache is already installed (Use an external Apache HTTP Server for HTTP Dynamic Streaming and HTTP Live Streaming). The instructions don’t seem to be complete, here are some things I had to figure out:
The apache modules: On the page they list some windows libraries (dll) and some shared objects (so). Since I am using Ubuntu 12.04, I didn’t have any of the dlls. I ended up copying the three shared objects, in my case to:
/usr/lib/apache2/modules/mod_f4fhttp.so
/usr/lib/apache2/modules/mod_hlshttp.so
/usr/lib/apache2/modules/mod_jithttp.so
The modules are loaded through the httpd.conf file:
# Load required modules for Adobe Media Server
LoadModule f4fhttp_module /usr/lib/apache2/modules/mod_f4fhttp.so
LoadModule hlshttp_module /usr/lib/apache2/modules/mod_hlshttp.so
LoadModule jithttp_module /usr/lib/apache2/modules/mod_jithttp.so
After that, I figured out step by step what other modules I have to add in order to get it running, here’s the list:
unzipped-adobemediaserver-package/Apache2.2/modules/libadbe_dme.so
unzipped-adobemediaserver-package/Apache2.2/modules/libadbe_license.so
unzipped-adobemediaserver-package/Apache2.2/modules/libasneu.so.1
unzipped-adobemediaserver-package/Apache2.2/modules/libcrypto.so.1.0.0
unzipped-adobemediaserver-package/Apache2.2/modules/libexpat.so.1.5.2
unzipped-adobemediaserver-package/Apache2.2/modules/libhds.so
The listed modules need to be copied to the apache modules folder (in my case /usr/lib/apache2/modules). After that, apache configtest was still complaining about two missing libraries: libcares.so.2 and libexpat.so.0.
libcares.so.2 can be easily installed via sudo apt-get install libc-ares2, check pkgs.org for more information. On the fly I didn’t find a way to get libexapt.so.0 for Ubuntu 12.04, so I just copied libexpat.so.1.5.2 to libexpat.so.0 on the development machine (not recommended to do so).
After installing the libraries, I was able to start Apache, so I made the vhost configuration for the host using Adobe Media Server. The configuration can be found also on the adobe homepage. I copied the following:
<IfModule f4fhttp_module>
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath "../applications"
HttpStreamingContentPath "../applications"
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingFragMaxAge -1
HttpStreamingDrmmetaMaxAge 3600
Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule hlshttp_module>
<Location /hls-live>
HLSHttpStreamingEnabled true
HttpStreamingLiveEventPath "../applications"
HttpStreamingContentPath "../applications"
HLSMediaFileDuration 8000
HLSSlidingWindowLength 6
HLSAmsDirPath ".."
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule jithttp_module>
<Location /hds-vod>
HttpStreamingJITPEnabled true
HttpStreamingContentPath "../webroot/vod"
JitAmsDirPath ".."
Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule hlshttp_module>
<Location /hls-vod>
HLSHttpStreamingEnabled true
HLSMediaFileDuration 8000
HttpStreamingContentPath "../webroot/vod"
HLSAmsDirPath ".."
Options -Indexes FollowSymLinks
</Location>
</IfModule>
After adding these, restarting Apache was not possible, apache gave me the following message:
Invalid command 'HLSAmsDirPath', perhaps misspelled or defined by a module not includedin the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
I didn’t find any answers on Google, so I started to view the httpd.conf which is shipped with the package:
unzipped-adobemediaserver-package/Apache2.2/conf/httpd.conf
I found out that they use the commands “HLSFmsDirPath” instead of “HLSAmsDirPath” and “JitFmsDirPath” instead of “JitAmsDirPath”. After changing these two values apache successfully started and the video streaming over http is working.
My vhost configuration file looks like this (extracted):
<IfModule f4fhttp_module>
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath "/opt/adobe/ams/applications"
HttpStreamingContentPath "/opt/adobe/ams/applications"
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingFragMaxAge -1
HttpStreamingDrmmetaMaxAge 3600
Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule hlshttp_module>
<Location /hls-live>
HLSHttpStreamingEnabled true
HttpStreamingLiveEventPath "/opt/adobe/ams/applications"
HttpStreamingContentPath "/opt/adobe/ams/applications"
HLSMediaFileDuration 8000
HLSSlidingWindowLength 6
HLSFmsDirPath "/opt/adobe/ams"
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
Options -Indexes FollowSymLinks
</Location>
<Location /hls-vod>
HLSHttpStreamingEnabled true
HLSMediaFileDuration 8000
HttpStreamingContentPath "/opt/adobe/ams/webroot/vod"
HLSFmsDirPath "/opt/adobe/ams"
Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule jithttp_module>
<Location /hds-vod>
HttpStreamingJITPEnabled true
HttpStreamingContentPath "/opt/adobe/ams/webroot/vod"
JitFmsDirPath "/opt/adobe/ams"
Options -Indexes FollowSymLinks
</Location>
</IfModule>