Created

Jun 18, 2012

Integrating FFmpeg with CQ DAM

Posted by Sneh Arora

Communiqué Digital Asset Management (CQ DAM) provides enterprise-wide sharing and distribution of an organization’s key digital assets. Users across an organization can store, manage, and access digital assets such as images, graphics, audio, video, and documents through a Web interface (or a CIFS or WebDAV folder). As soon as an asset is uploaded to DAM, a number of asynchronous workflows get triggered in the background which extract metadata information from the asset and generated renditions of different size/format/resolution for the uploaded image. For any video asset, 3 image renditions and 3 video renditions get generated by default .CQ DAM relies on ffmpeg executable for producing video renditions of the uploaded file. This executable is not shipped along with CQ and user needs to install it manually on his system. The following section covers installation of ffmpeg on Red Hat Server.

Installing FFmpeg on RHEL [Red Hat Enterprise 5.5]

1.       Download and install packages for ffmpeg and its transitive dependencies . Install them in the following sequence

1.       libavutil51-0.10.2-54.el5.x86_64.rpm

2.       libtheoradec1-1.1.1-13.el5.x86_64.rpm

3.       libtheora-1.1.1-1.fu14.x86_64.rpm

4.       libtheoraenc1-1.1.1-13.el5.x86_64.rpm

5.       libx264_118-0.118-17_20111111.2245.el5.x86_64.rpm

6.       libopencore-amrnb0-0.1.3-1.el5.x86_64.rpm

7.       libopencore-amrwb0-0.1.3-1.el5.x86_64.rpm

8.       libva-0.32.0.2_1-0.32.0-4_sds2.el5.x86_64.rpm

9.       libswscale2-0.10.2-54.el5.x86_64.rpm

10.   libswresample0-0.10.2-54.el5.x86_64.rpm

11.   libpostproc52-0.10.2-54.el5.x86_64.rpm

12.   libdc1394_22-2.0.2-11.el5.x86_64.rpm

13.   libxavs1-0.1.51-2.el5.x86_64.rpm

14.   libmp3lame0-3.99.3-23.el5.x86_64.rpm

15.   libxvidcore4-1.2.2-14.el5.x86_64.rpm

16.   libgsm1-1.0.13-2.el5.x86_64.rpm

17.   libavcodec53-0.10.2-54.el5.x86_64.rpm

18.   librtmp0-2.3-1.el5.x86_64.rpm

19.   libavformat53-0.10.2-54.el5.x86_64.rpm

20.   libavfilter2-0.10.2-54.el5.x86_64.rpm

21.   SDL-1.2.14-2rt.x86_64.rpm

22.   libavdevice53-0.10.2-54.el5.x86_64.rpm

23.   ffmpeg-0.10.2-54.el5.x86_64.rpm

*Please check for the latest version of each of the above dependencies

2.       Modify the audio codec and video codec according to the server platform and ffmpeg build used.

             For example for ffmpeg-0.10.2-54.el5.x86_64.rpmto work on RHEL 5.5, audio codec needs to be changed to alac.

Follow the steps below to make the above change:

1.       Go to url http://<server>:<port>/etc/dam/video/hq.html

2.       Click Edit

3.       Go to Audio tab

4.       Set Codec to alac

Video Profile Settings

Tuning ffmpeg for best performance

Media encoding is a CPU intensive process and hence may result in very high CPU usage on server machine. This might result in ffmpeg hogging all the CPU and slowing down of CQ instance.

Limit the number of renditions produced for each video

By default for each video file DAM generates renditions in 3 file formats namely ogg,m4v and flv .You might want to limit the number of renditions depending upon your use case. This can be achieved via following steps.

1.       Go To workflow console http://<server>:<port>/libs/cq/workflow/content/console.html

2.       Edit DAM Update Asset workflow

3.       Double click on workflow step Ffmpeg transcoding

4.       Go to Process tab

5.       Edit arguments to set the required profile. Default value is set to profile:firefoxhq,profile:hq,profile:flv for generating ogg,m4v and flv renditions respectively.

6.       Click OK.

7.       Click Save

The following snapshot shows the setting for limiting rendition to flv.

Limiting Renditions to flv

Limit the number of threads spawned by ffmpeg process

By default, the maximum number of threads spawned by each ffmpeg process is equal to the number of cpu cores available on the server. To limit the number of threads launched by each ffmpeg process, follow the below steps:

1.       Go to url http://<server>:<port>/etc/dam/video/hq.html

2.       Click Edit

3.       Go to Advanced tab under Video Profile Settings

4.       Add argument –threads X in the Custom ffmpeg arguments text box where X is number of threads launched by ffmpeg.

Limiting threads spawn by ffmpeg

*For details on FFmpeg, please refer to http://ffmpeg.org/.

COMMENTS

  • By Alessandro Drago - 7:30 AM on Oct 05, 2012   Reply
    I have a radio Station that delivery audio over streaming with shoutcast. Now I´m making one test pilot with video stream. I´m trying to integrate ffmpeg with CQ5 with my Debian server, but no sucess. I´m considering in download and compile a ffmpeg version to my kernel to see if works. I´m looking for more articles here to help this. Thanks
    • By sneakers - 7:35 PM on Feb 07, 2013   Reply
      This post is helpful with an analysis I am doing for a specific group of people. Do you have any other articles to suggest on this topic? Thanks
      • By scooby doo - 7:52 PM on Feb 07, 2013   Reply
        I am researching this topic for use in a future business I am thinking about starting. Thank you for this information, it has been educational and helpful to me.
        • By hydro heel ointment - 9:32 AM on Mar 13, 2013   Reply
          CQ Dam enables to access digital assets like images,graphics,video,audio etc.This created a wave in the field of digital media as well.Installation of FFmpeg can also be done with this interface.Really a great post on new advancements in digital technology.
          • By may ozone - 9:30 AM on Mar 24, 2013   Reply
            Your blog is very informative for me. Keep the good work going. It will be very useful for anyone.
            • By liquidy - 12:27 PM on Mar 30, 2013   Reply
              By default for each video file DAM generates renditions in 3 file formats namely ogg,m4v and flv .You might want to limit the number of renditions depending upon your use case. This can be achieved via following steps.
              • By diễn đàn seo - 4:35 AM on Apr 17, 2013   Reply
                I´m considering in download and compile a ffmpeg version to my kernel to see if works. I´m looking for more articles here to help this. Thanks
                • By cộng đồng lập trình - 3:44 AM on Apr 18, 2013   Reply
                  thanks
                  • By nj photo booth rental - 4:55 PM on Apr 27, 2013   Reply
                    Thanks for keeping us informed
                    • By wedding photographers nj - 5:42 PM on Apr 27, 2013   Reply
                      Its great to see you taking the time to share this information
                      • By limo nyc - 2:33 AM on Apr 29, 2013   Reply
                        CQ DAM is tough to figure out for the mpeg, glad to see someone took the time to explain this. Very straight forwawrd.

                        ADD A COMMENT