AnsweredAssumed Answered

Content Transformation - FFmpeg 'cannot run program'

Question asked by stevegreenbaum on Jul 30, 2010
Latest reply on Oct 1, 2010 by stevegreenbaum
I have configured a flv to png transformer for the purpose of creating a thumbnail from a video.  I have a ffmpeg command which works fine from the command line, but doesn’t work when invoked via org.alfresco.util.exec.RuntimeExec when declared in a transformation context file.  I receive a “cannot run program” error message in the debug log and a exit code equal 1.  The checkCommand step runs successfully with an exit code equal zero. 

Environment: Windows XP, 3.3g

I tried redirecting stderror output per suggestion of a previous post, but no luck.  I’ve tried using the ffmpeg.exe included with Alfresco and I also downloaded a more recent version. 

Has anyone successfully integrated ffmpeg using RuntimeExec?  

Context file:

<property name="transformCommand">
         <bean class="org.alfresco.util.exec.RuntimeExec">
            <property name="commandsAndArguments">
                  <entry key=".*">
                        <value>C:/Alfresco_Dev/Alfresco33/FFmpeg/bin/ffmpeg.exe -i  ${source} -t 00:00:00.05 -r 1 ${target}</value>
            <property name="errorCodes">

Error message from log:

18:50:23,109 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer: 
   source mimetype: video/x-flv
   target mimetype: image/png
   transformers: [ProxyContentTransformer[ average=60000ms]]
18:50:23,375 DEBUG [org.alfresco.util.exec.RuntimeExec] Execution result:
   os:         Windows XP
   command:    [C:/Alfresco_Dev/Alfresco33/ImageMagick/bin/ffmpeg.exe -i C:\ALFRES~1\ALFRES~2\tomcat\temp\Alfresco\RuntimeExecutableContentTransformerWorker_source_40468.flv -t 00:00:00.05 -r 1 C:\ALFRES~1\ALFRES~2\tomcat\temp\Alfresco\RuntimeExecutableContentTransformerWorker_target_40469.png]
   succeeded:  false
   exit code:  1
   err:        Cannot run program "C:/Alfresco_Dev/Alfresco33/ImageMagick/bin/ffmpeg.exe -i C:\ALFRES~1\ALFRES~2\tomcat\temp\Alfresco\RuntimeExecutableContentTransformerWorker_source_40468.flv -t 00:00:00.05 -r 1 C:\ALFRES~1\ALFRES~2\tomcat\temp\Alfresco\RuntimeExe
18:50:23,375 INFO  [org.alfresco.repo.thumbnail.CreateThumbnailActionExecuter] Creation of thumbnail 'doclib' failed