commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Wamara" <daol...@hotmail.com>
Subject Commons Exec not producing the same result as the command line
Date Tue, 13 Apr 2010 22:07:20 GMT
Good evening all, 

I am trying to call ffmpeg via the command exec in order to transcode some files and the strange
thing happening is that the files produced are not the same as the one I can create when calling
the same command via the command line.

This is how I am calling fmpeg and I get a file with a particular codec in it (strangely not
the right one) although launching in the command line exactly what I have in the sb.toString()
which is the command to be executed, the file created has a correct codec. So to say, the
same command started via Exec and the one started via the command line have not the same result.
Anyone has an idea?

Thanks.
Daniel Wamara

StringBuilder sb = new StringBuilder("/home/ect/scripts/transcoding.sh ");

sb.append(" " + source.getAbsolutePath());

sb.append(" " + attributes.getCodec());

sb.append(" " + String.valueOf(attributes.getSamplingRate().intValue()));

sb.append(" " + target.getAbsolutePath());


logDebug("command --> " + sb.toString());


CommandLine commandLine = CommandLine.parse(sb.toString());

DefaultExecutor executor = new DefaultExecutor();

executor.execute(commandLine);

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message