5 Replies Latest reply on Jun 23, 2008 11:49 AM by msk0802

    Save cfexecute output

      Hello all-

      I am on a quest to determine .flv file dimensions. (Posted in the Flash section already- but my current attempts are not Flash specific)

      I am currently trying to use ffmpeg via cfexecute to get the file information.

      One 'feature' of ffmpeg is that any time you address a .flv file, the ffmpeg output will tell you the file dimensions.

      Awesome, fantastic....but how can I save that information?!?

      I have tried:

      cfexecute name = "d:\websites\test\media\ffmpeg.exe"
      arguments = "-i wheel.flv"
      timeout = "90"

      With both the 'variable=' and 'outputfile=', but neither of them seem to work. In fact, the variable name I set does not even exist, and the outputfile is never created.

      Also, I have tried this with DOS (on Windows...) with the ffmpeg -i videoname.flv >info.txt but the file that comes back is completely empty.

      If anyone has an idea of how to save what is essentially an error message on a cfexecute, I would greatly appreciate it.


        • 1. Re: Save cfexecute output
          -==cfSearching==- Level 4
          I ran into a similar problem recently. The two issues I had were that ffmpeg was timing out and I was unable to capture the error stream. What solved it for me was two excellent tips on cfexecute from Ben Forta's blog.

          I wrote up an entry on it here
          • 2. Re: Save cfexecute output
            I am having the same problem, and I have tried the /c and the 2>&1 suggestions, but they haven't worked. I am trying to call an Exchange Management Shell cmdlet after loading the EMS extension into Powershell. Writing this code to a batch file and running that directly works. I've also tested that it's not a permissions issue. CF runs under a domain account in my setup so I was able to log in and run the batch file under the same account. Here are 2 versions of the cfexecute tag I've tried. I've also tried executing the batch file itself with the /c and the 2>&1 redirect. In all cases, the cfexecute times out leaving cmd.exe and/or powershell.exe running on the server.
            Please help! Thanks!
            • 3. Re: Save cfexecute output
              -==cfSearching==- Level 4
              Hi msk0802,

              I used /c and the 2>&1 fix were for a very specific issue: ffmpeg writes to stderr and cfexecute was not capturing the stderr stream. Though that issue was fixed in CF8 Update 1.

              Not being familiar with Powershell, I do not know if your problem is caused by the same issue. I did see one article that mentioned a problem using Powershell with java's Runtime.exec().

              I have not read it thoroughly, but you might try the suggestion of writing the output to a file, instead of a variable. Just to see if the process always hangs, or just when using the "variable" attribute.

              • 4. Re: Save cfexecute output
                DCwebGuy Level 1
                cfexecute can be very unpredicatable. Your best bets are to a) try it using CF8.1, if it works great, 2) if not, or if you don't have access to CF8.1, trying writing it directly through a Java object using CF's built-in native Java support and CFSCRIPT. There are some pretty good resources out there if you Google it (they are too specific to mention any single solution here).

                I happen to come across this post while researching how to capture a "success" message once cfexecute is finished (I'm using CF8.1). I think the Java route is the best for this because you can get very granual control over the messages.
                • 5. Re: Save cfexecute output
                  msk0802 Level 1
                  Thanks very much for your response. I meant to post again a few days ago, when I was able to use suggestions from the link that CFSearching posted on 6/17 (thanks very much CFSearching!) to write my own Java object and call that instead of CFExecute (specifically the comment about proc.getOutputStream().close(); did the trick). Thanks everyone.