RuntimeExec transformer woes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2009 11:17 AM
10:55:45,040 User:admin DEBUG [content.transform.ContentTransformerRegistry] Searched for transformer: source mimetype: video/x-ms-wmv target mimetype: video/x-flv transformers: [RuntimeExecutableContentTransformer[ transform=RuntimeExec: command: ffmpeg -i '${source}' -vcodec flv -ar 44100 -ab 32 -b 800k '${target}' env props: null dir: null os: Linux10:55:45,197 User:admin DEBUG [util.exec.RuntimeExec] Execution result: os: Linux command: [ffmpeg, -i '/opt/Alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformer_source_730142860692261929.wmv', -vcodec flv, -ar 44100, -ab 32, -b 800k, '/opt/Alfresco/tomcat/temp/Alfresco/RuntimeExecutableContentTransformer_target_3588279390070062814.flv'] succeeded: true exit code: 1 out: err: FFmpeg version SVN-rUNKNOWN, Copyright © 2000-2007 Fabrice Bellard, et al. configuration: –prefix=/usr –libdir=/usr/lib –mandir=/usr/share/man –incdir=/usr/include/ffmpeg –enable-libmp3lame –enable-libogg –enable-libvorbis –enable-libogg
After the transformer has completed, the temporary target file (RuntimeExecutableContentTransformer_target_3588279390070062814.flv) exists but is 0kb large. A converted file has also been created, <video>.flv, but is similarly 0kb large.
When I take the same command and execute it on the command line (removing the commas between parameters) it works fine.
What might I be doing wrong? Is there a way to extend what is being reported in the 'err' output by log4j so I can actually see the whole ffmpeg output, rather than just the first two lines of version information?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2009 11:22 AM
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><beans> <bean id="transformer.ffmpeg.WMVtoFLV" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer" parent="baseContentTransformer"> <property name="transformCommand"> <bean id="commandListRootDir" class="org.alfresco.util.exec.RuntimeExec"> <property name="commandsAndArguments"> <map> <entry key="Linux"> <list> <value>ffmpeg</value> <value>-i '${source}'</value> <value>-vcodec flv</value> <value>-ar 44100</value> <value>-ab 32</value> <value>-b 800k</value> <value>'${target}'</value> </list> </entry> <entry key="Windows.*"> <list> <value>ffmpeg</value> <value>-i '${source}'</value> <value>-vcodec flv</value> <value>-ar 44100</value> <value>-ab 32</value> <value>-b 800k</value> <value>'${target}'</value> </list> </entry> </map> </property> <property name="errorCodes"> <value>2</value> </property> </bean> </property> <property name="explicitTransformations"> <list> <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails" > <property name="sourceMimetype"><value>video/x-ms-wmv</value></property> <property name="targetMimetype"><value>video/x-flv</value></property> </bean> </list> </property> </bean></beans>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2009 12:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2009 01:14 PM
Piping the output to /dev/null would defeat the purpose, no? I want to see the output, the more the better. Or did I misunderstand?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2009 01:29 PM
Another option would be to move all of the values from the list in to a single value. Something a little closer to:
<list> <value>ffmpeg -i '${source}' -vcodec flv -ar 44100 -ab 32 -b 800k '${target}'</value></list>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2009 01:48 PM
I added a parameter like '2> /somefolder/log' to log stderr (which is where all the output is coming from) to a file. Unfortunately, Alfresco doesn't seem to care - the message still shows up in catalina.log as before, and the /somefolder/log file doesn't get created (???). The user Alfresco is running as has permissions to the target folder and it all works just dandy through the CLI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2009 11:41 AM
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2009 12:08 PM
Why not try this:
<entry key="Linux"> <list> <value>sh</value> <value>-c</value> <value>ffmpeg -i '${source}' -vcodec flv -ar 44100 -ab 32 -b 800k '${target}' 2>/dev/null</value> </list> </entry>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2009 12:07 PM
Good luck and thank you again…
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2009 12:12 PM
I'm trying to create my content transformer using ocr.exe from intelliant.
I have in my extension folder file ocr-transformation-context.xml that looks like so:
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <bean id="transformer.Ocr.Tiff2Pdf" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker"> <property name="checkCommand"> <bean class="org.alfresco.util.exec.RuntimeExec"> <property name="commandsAndArguments"> <map> <entry key=".*"> <list> <value>ocr.exe</value> <value>–about</value> </list> </entry> </map> </property> <property name="errorCodes"><value>1,2</value></property> </bean> </property> <property name="transformCommand"> <bean class="org.alfresco.util.exec.RuntimeExec"> <property name="commandsAndArguments"> <map> <entry key="Windows.*"> <value>ocr.exe –replace –language fr –pdf –output-file "${target}" "${source}"</value> </entry> </map> </property> <property name="errorCodes"><value>1,2</value></property> </bean> </property> <property name="explicitTransformations"> <list> <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails" > <property name="sourceMimetype"><value>image/tiff</value></property> <property name="targetMimetype"><value>application/pdf</value></property> </bean> </list> </property> </bean> <bean id="transformer.ocrTopdf" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer"> <property name="worker"> <ref bean="transformer.Ocr.Tiff2Pdf"/> </property> </bean> </beans>
and when I startup tomcat I read:
18:02:03,407 DEBUG [util.exec.RuntimeExec] Execution result: os: Windows XP command: [ocr.exe, –about] succeeded: true exit code: 0 out: Intelliant OCR commandline utility, version 1.1.0. Copyright ® 2006. Credits: TIFF Library Copyright © 1988-1997 Sam Leffler Copyright © 1991-1997 Silicon Graphics, Inc. Independent JPEG Group Library Copyright (C) 1991-19 err:
Than I create a rule in a space specifing that all content with mimetype "tiff" should be transformed into pdf.
Rule condition: 'Item has a mimetype of 'TIFF Image'
Rule Actions: Copies content to 'my folder' and transforms to 'Adobe PDF Document'
It creates pdf, but If I open it clicking on name I see quick time simbol and than content not searchable (it's looks like more an image with pdf extension).
If I download it acrobat says it's damaged or not a valid file.
I can't figure out who (my ocr.exe or what else) is performing transformation and, also, I'm not sure if my transformer has been registered because on console I read:
18:07:38,251 User:admin DEBUG [content.transform.ContentTransformerRegistry] Searched for transformer: source mimetype: image/tiff target mimetype: text/plain transformers: []18:07:39,188 User:admin DEBUG [content.transform.ContentTransformerRegistry] Searched for transformer: source mimetype: image/tiff target mimetype: application/pdf transformers: []18:07:39,188 User:admin DEBUG [content.transform.ContentTransformerRegistry] Searched for transformer: source mimetype: image/tiff target mimetype: text/plain transformers: []18:07:42,126 User:admin DEBUG [content.transform.ContentTransformerRegistry] Searched for transformer: source mimetype: image/tiff target mimetype: text/plain transformers: []18:13:07,626 User:admin DEBUG [content.transform.ContentTransformerRegistry] Searched for transformer: source mimetype: image/tiff target mimetype: text/plain transformers: []18:13:13,219 User:admin DEBUG [content.transform.ContentTransformerRegistry] Searched for transformer: source mimetype: image/tiff target mimetype: text/plain transformers: []
How could I register it? What am I missing?
If you need more info, let me know…I'm newbie, so I can't know what it's important to understand the issue.
Hope in some help, it's very urgent for me!
Thanks in advance!
