Output of cfexecute

203 views
Skip to first unread message

Michael Hnat

unread,
Dec 1, 2013, 5:33:58 AM12/1/13
to ra...@googlegroups.com
Hello,

I'm trying to figure out the length of a video file. Since ffmpeg is
dead and cfplayer isn't working righ now, I installed libav. There's a
useful command for that, which I call with cfexecute. But unfortunately
cfexecute isn't giving me back a result.

I tried this:
execute arguments='/var/www/myVideo.mp4' name='avprobe'
variable="sExeOut" timeout="5";

also I tried this (since the documenation says if no variable is
specified the output is displayed on the screen):
savecontent variable="sExeOut" {
execute arguments='/var/www/myVideo.mp4' name='avprobe' timeout="5";
}

my variable sExeOut is always empty. Even using the outputfile parameter
generates only an empty file.

Any idea how I can get the output of my execute command?

System:
Railo 4.1.1.009
Ubuntu 12.04

Thanks,
Michi




--
Mit herzlichen Grᅵᅵen,
Michael Hnat

bluegras - Internetlᅵsungen
Kriegerstr. 49
82110 Germering
Tel.: 089 81029340
Fax: 089 81029339
E-Mail: m.h...@bluegras.de


Chris Blackwell

unread,
Dec 1, 2013, 5:42:18 AM12/1/13
to railo
is avprobs in the PATH for the user that runs railo? 
try specifying the full path to the avprobe binary, for example 

execute arguments='/var/www/myVideo.mp4' name='/usr/bin/avprobe'
variable="sExeOut" timeout="5";


On 1 December 2013 10:33, Michael Hnat <m.h...@bluegras.de> wrote:
Hello,

I'm trying to figure out the length of a video file. Since ffmpeg is
dead and cfplayer isn't working righ now, I installed libav. There's a
useful command for that, which I call with cfexecute. But unfortunately
cfexecute isn't giving me back a result.

I tried this:
execute arguments='/var/www/myVideo.mp4' name='avprobe'
variable="sExeOut" timeout="5";

also I tried this (since the documenation says if no variable is
specified the output is displayed on the screen):
savecontent variable="sExeOut" {
    execute arguments='/var/www/myVideo.mp4' name='avprobe'  timeout="5";
}

my variable sExeOut is always empty. Even using the outputfile parameter
generates only an empty file.

Any idea how I can get the output of my execute command?

System:
Railo 4.1.1.009
Ubuntu 12.04

Thanks,
Michi




--
Mit herzlichen Grüßen,
Michael Hnat

bluegras - Internetlösungen

Kriegerstr. 49
82110 Germering
Tel.: 089 81029340
Fax: 089 81029339
E-Mail: m.h...@bluegras.de


--
Did you find this reply useful?  Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/529B1096.6040208%40bluegras.de.
For more options, visit https://groups.google.com/groups/opt_out.

Michael Hnat

unread,
Dec 1, 2013, 6:40:06 AM12/1/13
to ra...@googlegroups.com
Hi,

it is. I tried the same thing with avconv (also part of this package) to grab a picture of a frame. This one doesn't have an output, but it will be executed.
Also when calling my avprobe with a wrong parameter I get back an error message. The result is only empty when everything is working well.

It looks like that errormessages will be filled in to the parameter variable, but correct output doesn't.

Andrew Scott

unread,
Dec 1, 2013, 7:56:48 AM12/1/13
to ra...@googlegroups.com
That will never do what you want it to do, in this example to do this you would have the requirement that execute actually return something... It never will.

Another way would be to pipe the output in the executed command and then get ColdFusion to load this in via cffile or fileRead or something.

Or

You could google java how to find the length of a video file which would result in some interesting options, namely


Never used it, but looks interesting enough.


Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/



On Sun, Dec 1, 2013 at 9:33 PM, Michael Hnat <m.h...@bluegras.de> wrote:
Hello,

I'm trying to figure out the length of a video file. Since ffmpeg is
dead and cfplayer isn't working righ now, I installed libav. There's a
useful command for that, which I call with cfexecute. But unfortunately
cfexecute isn't giving me back a result.

I tried this:
execute arguments='/var/www/myVideo.mp4' name='avprobe'
variable="sExeOut" timeout="5";

also I tried this (since the documenation says if no variable is
specified the output is displayed on the screen):
savecontent variable="sExeOut" {
    execute arguments='/var/www/myVideo.mp4' name='avprobe'  timeout="5";
}

my variable sExeOut is always empty. Even using the outputfile parameter
generates only an empty file.

Any idea how I can get the output of my execute command?

System:
Railo 4.1.1.009
Ubuntu 12.04

Thanks,
Michi




--

Mit herzlichen Grüßen,
Michael Hnat

bluegras - Internetlösungen
Kriegerstr. 49
82110 Germering
Tel.: 089 81029340
Fax: 089 81029339
E-Mail: m.h...@bluegras.de


Michael Hnat

unread,
Dec 1, 2013, 10:04:42 AM12/1/13
to ra...@googlegroups.com
Hm, I wonder, because the execute does generate an output on the command line:
# avprobe myMovie.mp4

avprobe version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2007-2013 the Libav developers  built on Mar 30 2013 22:20:06 with gcc 4.7.2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myMovie.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf50.5.0
    comment         : Convertified by iSquint - http://www.isquint.org
  Duration: 00:25:04.16, start: 0.000000, bitrate: 1186 kb/s......


But I will have a look into the java class.

Thanks,
Michi

Andrew Scott

unread,
Dec 1, 2013, 10:41:59 AM12/1/13
to ra...@googlegroups.com
Michi,

What I mean is that execute doesn't return anything and it is all outputted to the stdout of the console itself, execute doesn't see or know about that. So as I said the only way to get it into ColdFusion is pipe it out to a file and then read it in ColdFusion.

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/



Adrian Lynch

unread,
Dec 1, 2013, 11:15:31 AM12/1/13
to ra...@googlegroups.com

It's been a while, but can you look at standard error for non errors?

I had a similar issue way back when.

If you run your code with an added pipe to file, does the file get written to?

Adrian

Igal @ getRailo.org

unread,
Dec 1, 2013, 1:10:28 PM12/1/13
to ra...@googlegroups.com
if the output is supposed to show the information then maybe it goes to the Err stream?

in Railo 4.1.2.003 we added the attributes "errorVariable" and "errorFile" to cfexecute, which work like "variable" and "outputFile" but for the Err stream.

For more options, visit https://groups.google.com/groups/opt_out.

-- 
Igal Sapir
Railo Core Developer
http://getRailo.org/

Adrian Lynch

unread,
Dec 2, 2013, 3:09:16 AM12/2/13
to ra...@googlegroups.com
Yup! It did with ffmpeg at the time.

A
Reply all
Reply to author
Forward
0 new messages