Page 1 of 1

FFmpeg Wrapper 0.0.5

Posted: Mon 18 Oct 2010, 15:24
by abushcrafter
Here is the FFmpeg Wrapper script. It corrects the acodec "vorbis" parameter to "libvorbis". This is because older versions of FFmpeg used "vorbis" as the acodec parameter and in new version it was changed to "libvorbis". It also corrects "-vcodec xvid" to "-vcodec libxvid". This way old pre-sets/scripts are still compatible with this version of FFmpeg.

To use, rename the "ffmpeg" binary to "fmpeg.bin" and save this script in "/usr/bin/" using the name "ffmpeg".

Code: Select all

#!/bin/sh

#FFmpeg Wrapper
#Version=0.0.5
#Date (dd.mm.yyyy hh:mm:ss)=08.10.2010 22:42:38
#Thanks to the dad (SSR) of Alexander .S.T. Ross (abushcrafter) (Again :).)

#ChangeLog ----------------------------------------------------------------------
#	 12.10.2010 Alexander .S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#		* 0.0.5: Now corrects "-vcodec xvid" to "-vcodec libxvid". 

# Bash script to modify edit parameters in command line.
# Designed to cope with spaces in parameters .

prevparam="none"
count=1
args=("$@")

while [ $count -ne  $# ] ; do
if [ "$prevparam" = "-acodec" ] ; then
    args[$count]=$(echo ${args[$count]}| sed s/vorbis/libvorbis/g )
fi
if [ "$prevparam" = "-vcodec" ] ; then
    args[$count]=$(echo ${args[$count]}| sed s/xvid/libxvid/g )
fi
prevparam=${args[$count]}
#echo $count "  " ${args[$count]}  #Debugging: Comment out in final code.
count=$((count+1))
done
ffmpeg.bin "${args[@]}"


On the subject of compatibility you might find this info useful: http://www.murga-linux.com/puppy/viewto ... 774#457774 and http://www.murga-linux.com/puppy/viewto ... 019#458019