PDA

View Full Version : [ubuntu] Shell Variable Help



etechship
April 30th, 2009, 04:31 PM
I have the following command running from upload.sh


ffmpeg -i "$outputFile.flv" -v 0 -vn "$outputFile-a.flv"

The input file is read correctly, but it assumes the output is '.flv'. So how can I make the outpute, as stated above, $outputFile-a.flv.

Thanks
dave

FakeOutdoorsman
April 30th, 2009, 07:41 PM
I don't understand your question. What do you mean by, "it assumes the output is '.flv'"? Also, what are you trying to do with FFmpeg? Right now this command re-encodes the audio from the original file into a FLV container. This isn't as efficient as just copying the audio stream:

ffmpeg -i input.flv -acodec copy output.mp3

etechship
May 1st, 2009, 03:53 PM
I want to leave it as a flash file. I would just like the variable in the second part to work.

dave

koenn
May 1st, 2009, 08:10 PM
Your question is rather unclear. It would help if you'd specify what exactly the variable name is.
That's probably also the problem the shell has with your command.

assuming 'outputFile' is a variable, try


ffmpeg -i "${outputFile}.flv" -v 0 -vn "${outputFile}-a.flv"

FakeOutdoorsman
May 1st, 2009, 08:32 PM
I want to leave it as a flash file. I would just like the variable in the second part to work.

dave
Right now your command is re-encoding the original audio. This creates a loss in quality because you are (most likely) going from a lossy format to another lossy format. A better way to do this is to just copy the audio stream:

ffmpeg -i input.flv -acodec copy -vn output.flv