RamjiSam
asked on
Linux Shell Command Help
Im Using Command To search mp4 Files in directory and the directories below and it should convert mp4 files into 3gp.. output directtory shld be same
find . -name "*.mp4" -exec convert.sh {} \;
#!/bin/bash
rm -f tmp.3gp
ffmpeg -i "$1" -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k tmp.3gp && mv tmp.3gp "$1"
#
i Used This Command But Its Not Working
Waiting For Expert Answer
find . -name "*.mp4" -exec convert.sh {} \;
#!/bin/bash
rm -f tmp.3gp
ffmpeg -i "$1" -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k tmp.3gp && mv tmp.3gp "$1"
#
i Used This Command But Its Not Working
Waiting For Expert Answer
ASKER
#!/bin/bash
rm -f tmp.3gp
ffmpeg -i "$1" -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000
-r 25 -ab 32k tmp.3gp && mv tmp.3gp `basename "$1" .mp4`
#
I Used This By find . -name "*.mp4" -exec convert.sh {} \;
Im Getting Error
Must supply at least one output file
/home/public_html/test2/co nvert.sh: line 4: -r: command not found
rm -f tmp.3gp
ffmpeg -i "$1" -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000
-r 25 -ab 32k tmp.3gp && mv tmp.3gp `basename "$1" .mp4`
#
I Used This By find . -name "*.mp4" -exec convert.sh {} \;
Im Getting Error
Must supply at least one output file
/home/public_html/test2/co
ASKER
I Used This Command
ffmpeg -i video.mp4 -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k -y video.3gp
Its Working One
When I Use In Shell This Command Is Not Working
ffmpeg -i video.mp4 -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k -y video.3gp
Its Working One
When I Use In Shell This Command Is Not Working
Ues this
#!/bin/bash
inputfilename="$1"
outputfilename=${inputfile name%\.*}. 3gp
ffmpeg -i $inputfilename -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k -y $outputfilename
#!/bin/bash
inputfilename="$1"
outputfilename=${inputfile
ffmpeg -i $inputfilename -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k -y $outputfilename
ASKER
After Trying
#!/bin/bash
inputfilename="$1"
outputfilename=${inputfile name%\.*}. 3gp
ffmpeg -i $inputfilename -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k -y $outputfilename
Im Getting This Error
./50: no such file or directory
/home/tamilmob/public_html /test2/con vert.sh: line 7: -ar: command not found
The Directory Name Is 50 cent
But It Take Only 50 so it says no such directory
Do We Need To Change Anything In Code?
#!/bin/bash
inputfilename="$1"
outputfilename=${inputfile
ffmpeg -i $inputfilename -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k -y $outputfilename
Im Getting This Error
./50: no such file or directory
/home/tamilmob/public_html
The Directory Name Is 50 cent
But It Take Only 50 so it says no such directory
Do We Need To Change Anything In Code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
#!/bin/bash
set -x
inputfilename="$1"
outputfilename="${inputfil ename%\.*} .3gp"
ffmpeg -i $inputfilename -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k -y "$outputfilename"
#
I Tired Finally im getting this error
ffmpeg: missing argument for option '-ac'
/home/test2/convert.sh: line 7: 1: command not found
set -x
inputfilename="$1"
outputfilename="${inputfil
ffmpeg -i $inputfilename -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k -y "$outputfilename"
#
I Tired Finally im getting this error
ffmpeg: missing argument for option '-ac'
/home/test2/convert.sh: line 7: 1: command not found
ASKER
hai
its working for me now.. i had a space character in middle of code.. so it showed error before...
thanks amit_g... Good Job
its working for me now.. i had a space character in middle of code.. so it showed error before...
thanks amit_g... Good Job
The command in the convert.sh would move the converted file back to same file i.e. AnyFile.mp4 would get converted to tmp.3gp and then tmp.3gp would get moved back to AnyFile.mp4. You most likely you meant
ffmpeg -i "$1" -s 352x288 -vcodec h263 -acodec libfaac -ac 1 -ar 8000 -r 25 -ab 32k tmp.3gp && mv tmp.3gp `basename "$1" .mp4`