cancel
Showing results for 
Search instead for 
Did you mean: 

Content Transformation - FFmpeg 'cannot run program'

stevegreenbaum
Champ in-the-making
Champ in-the-making
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">
               <map>
                  <entry key=".*">
                     <list>
                        <value>C:/Alfresco_Dev/Alfresco33/FFmpeg/bin/ffmpeg.exe -i  ${source} -t 00:00:00.05 -r 1 ${target}</value>
                     </list>
                  </entry>
               </map>
            </property>
            <property name="errorCodes">
               <value>1,2</value>
            </property> 
         </bean>
      </property>

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
   out:       
   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
2 REPLIES 2

sibe
Champ on-the-rise
Champ on-the-rise
hello,

Have you resolve this problem, i have the same error

Thank

stevegreenbaum
Champ in-the-making
Champ in-the-making
I was never able to resolve this issue.  I've had some tell me that org.alfresco.util.exec.RuntimeExec can have problems when there are "too many" command line parameters.  I installed the thumbnail extension which provided me the functionality I needed in this particular case.