# manage the SPECIAL options for resizing and letterboxing
size=`echo "$ffident" | grep Video | awk '{print $6}'` #current size per ffmpeg
size=`echo $size | sed 's/,//'`
curw=`echo $size | sed 's/x.*$//'` #current width
oldw=$curw
curh=`echo $size | sed 's/^.*x//'` #current height
cura=`echo -e "scale=2\n$curw / $curh\nquit" | bc` #current aspect
wopt=`echo "$ffopts" | grep "w-" | sed 's/^.*w-//' | \
sed -e 's/|.*//' -e 's/#.*//'` #new width
neww=$wopt
disp=`echo "$ffopts" | grep "d-" | sed 's/^.*d-//' | \
sed -e 's/|.*//' -e 's/#.*//'` #disp asp
if [ ! -z "$neww" ]
then neww=`expr $neww / 2 \* 2` #round down
scale=`echo -e "scale=5\n$curw / $neww\nquit" | bc` #height chg
newh=`echo -e "scale=5\n$curh / $scale\nquit" | bc` # new HHH
newh=`echo $newh | sed 's/\..*//'` #integer
newh=`expr $newh / 2 \* 2` #round down
curh=$newh #new HHH
oldw=$curw
curw=$neww
nopt="$neww"x"$newh" #WWWxHHH string
ffopts=`echo "$ffopts" | sed "s/w-$wopt/s-$nopt/"` #substitute
fi
if [ ! -z "$disp" ]
then # *10000 and remove decimal, so "test" can treat as integer
# which aspect is wider? to calculate padding
curam=`echo -e "scale=5\n$cura * 10000\nquit" | bc`
dispm=`echo -e "scale=5\n$disp * 10000\nquit" | bc`
curam=`echo $curam | sed 's/\..*//'`
dispm=`echo $dispm | sed 's/\..*//'`
if [ "$cura" != "$disp" ]
then if [ "$curam" -ge "$dispm" ]
then # current aspect is wider than target aspect
# pad top and bottom
xtra=`echo -e "scale=5\n$cura / $disp * $curh\nquit" | bc` #dots
pad=tb
else # target aspect is wider than current aspect
# pad left and right
xtra=`echo -e "scale=5\n$disp / $cura * $curw\nquit" | bc` #dots
pad=lr
fi
# $xtra is the total dots HHH or WWW in display aspect
xtra=`echo $xtra | sed 's/\..*//'` #integer
# ACTUAL pad is $xtra - soze-of-image
case $pad in
tb) xtra=`expr $xtra - $curh + 1` ;; #subtract HHH
lr) xtra=`expr $xtra - $curw + 1` ;; #subtract WWW
esac
# the padding should be half/half either L/R or T/B
xtra=`expr $xtra / 2` #top/bottom
xtra=`expr $xtra / 2 \* 2` #round down
# create command option
case $pad in
tb) padding="padtop-$xtra|padbottom-$xtra" ;;
lr) padding="padleft-$xtra|padright-$xtra" ;;
esac
ffopts=`echo "$ffopts" | \
sed "s/d-$disp/$padding|aspect-$disp/"`
fi
fi
## end of aspect and padding section
ffopts=`echo "$ffopts" | tr '|' '\012' | sed 's/^[A-Z].*//' | grep -v '^$'`
if echo "$ffopts" | grep rotate >/dev/null
then rotate=`echo "$ffopts" | grep rotate`
ffopts=`echo "$ffopts" | grep -v rotate`
case $rotate in
*right) rotate=90 ;;
*vert) rotate=180 ;;
*left) rotate=270 ;;
*vflip) rotate=vflip ;;
*hflip) rotate=hflip ;;
esac
fi
ffopts=`echo "$ffopts" | sed -e 's/^/ /' -e 's/#.*//'`
ffopts=`echo "$ffopts" | sed -e 's/~/ /g' -e 's/-/~/g' -e 's/ / -/g' -e 's/~/ /g'`
case "$ffopts" in
" -") ffopts=" -sameq" ;;
esac
ffopts="$ffopts $keyin"
# echo -e "\n\nThe final ffmpeg options look like this:\n"
# echo $ffopts
# END OF OPTION-SETTING
fi
new=`echo $target | sed "s/$ext$/$dot$choice/"`
case $av in
frame) new="$target.frame-%04d.$outf"
specialopts="-f image2 -r $step" ;;
esac
case $new in
*3gp) x264=`ls /usr/lib/*x264* | sed 's/\..*//' | head -1`
x264=`basename $x264`
specialopts="-vcodec $x264 -acodec libfaac" ;;
*flv) case "$ffopts" in
*-ar*) ;;
*) ar=`echo "$ffident" | grep Audio | \
awk -F, '{print $2}' |
sed -e 's/Hz//' -e 's/ //g'`
if [ "$ar" -gt "11025" ]
then nr=11025
fi
if [ "$ar" -gt "22050" ]
then nr=22050
fi
if [ "$ar" -gt "44100" ]
then nr=44100
fi
ffopts="$ffopts -ar $nr"
;;
esac
esac
case "$outdir/$new" in
"$dir/$target") title=`mytranslate "У конечного файла то же имя, как у исходного!! Выберите новое имя"`
newout=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="$title"` || exit 0
outdir=`dirname "$newout"`
new=`basename "$newout"`
;;
esac
if test -s "$outdir/$new"
then text=`mytranslate "существует - Переписать?
(ДА, чтобы перезаписать; НЕТ, чтобы переименовать)"`
zenity --question --text="$outdir/$new $text" || newout=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="Выберите новый файл/папку"` || exit 0
if [ ! -z "$newout" ]
then outdir=`dirname "$newout"`
new=`basename "$newout"`
fi
fi
oldsize=`du -a -b "$target" | awk '{print $1}'`
case $rotate in
?*) tempfile=`echo "$target" | sed 's/^/rotate-/'`
avwatcher "$outdir/$tempfile" "mencoder" "$oldsize" $$ &
# first attempt:
# mencoder -vf rotate=$rotate -o "$outdir/$tempfile" -oac copy -ovc lavc "$target"
# better quality:
mident=`midentify "$target"`
arate=`echo "$mident" | grep "AUDIO_BITRATE" | tail -1 | awk -F= '{print $2}'`
vrate=`echo "$mident" | grep "VIDEO_BITRATE" | tail -1 | awk -F= '{print $2}'`
rpass1=`mencoder "$target" -ovc lavc -lavcopts vbitrate=$vrate:vpass=1:turbo:threads=2 -oac copy -passlogfile $outdir/2pass.log -o "/tmp/mencoder-pass1-$tempfile" 2>&1`
rpass2=`mencoder "$target" -vf rotate=$rotate -ovc lavc -lavcopts vbitrate=$vrate:vpass=2:vhq=4:threads=2:abitrate=$arate -oac copy -passlogfile $outdir/2pass.log -o "$outdir/$tempfile" 2>&1`
echo -e "\tPASS 1\n\n$rpass1" > /tmp/mencoder-rotate.$$
echo "\n\n\tPASS 2\n\n$rpass2" >> /tmp/mencoder-rotate.$$
rm -f $outdir/2pass.log
midentr=`midentify "$outdir/$tempfile"`
arater=`echo "$midentr" | grep "AUDIO_BITRATE" | tail -1 | awk -F= '{print $2}'`
vrater=`echo "$midentr" | grep "VIDEO_BITRATE" | tail -1 | awk -F= '{print $2}'`
sizeof=`wc "$outdir/$tempfile" | awk '{print $3}'`
if [ "$arater"="0" -o "$vrater"="0" -o "$sizeof"="0" ]
then zenity --warning --title="Изменить не удалось" --text="Изменить не удалось! :-(\n\nMencoder не работает хорошо со всеми кодеками.\nПопытайтесь сначала преобразовать свой файл (возможно, в AVI) и получите результат"; exit 0
fi
# NEW WAY with VLC, which apparently doesn't work "yet"
# BECAUSE vlc will NOT write 'transforms' to a file!
# so the IMPROVED MENCODER code above is being used
# avwatcher "$outdir/$tempfile" "vlc" "$oldsize" $$ &
# vlc -I dummy "$target" -vvv --vout-filter=transform --transform-type=$rotate --sout '#transcode{deinterlace,audio-sync}:standard{dst="$tempfile",access=file}' vlc://quit > /tmp/vlc.$$ 2>&1
target="$outdir/$tempfile"
oldsize=`du -a -b "$target" | awk '{print $1}'`
;;
esac
avwatcher "$outdir/$new" "$prog" "$oldsize" $$ &
echo -e "ffident:\n$ffident\n" >/tmp/ffmpeg.$$
echo "ffmpeg command as executed:" >>/tmp/ffmpeg.$$
echo ffmpeg -y -i "$target" $vol $specialopts $ffopts "$outdir/$new" >>/tmp/ffmpeg.$$
echo >>/tmp/ffmpeg.$$
# set -x
ffmpeg -y -i "$target" $vol $specialopts $ffopts "$outdir/$new" 2>&1 | tr '=' '\012' >> /tmp/ffmpeg.$$
case $rotate in
?) echo "mencoder rotated original file to $outdir/$tempfile" >>/tmp/ffmpeg.$$
if test -s "/tmp/$tempfile"
then : it worked
else echo "but that operation failed" >>/tmp/ffmpeg.$$
fi ;;
esac
result=`tail -5 /tmp/$prog.$$`
result="$result
The full text output from this conversion is in /tmp/$prog.$$
"
grep "lame: output buffer too small" /tmp/ffmpeg.$$ && note=`mytranslate "
Сообщение о буфере libmp3lame безсмысленно.
Если это - единственное сообщение жалобы, преобразование действительно сработало."`
grep "bitrate tolerance too small" /tmp/ffmpeg.$$ && note=`mytranslate "
Сообщение о слишком маленьком допуске скорости передачи должно
к пути ffmpeg работы. Секунды между фреймами не могут быть
больше, чем о 2/3 кадров в секунду в видео.
ВОЗМОЖНОЕ РЕШЕНИЕ: Определите меньшие секунды между фреймами"`
grep "does not support" /tmp/ffmpeg.$$ && note=`mytranslate "
ffmpeg требует больше/различных вариантов для этого преобразования
ИЛИ
Ваш исходный файл необычен и требует специальных опций
POSSIBLE SOLUTIONS:
specify a video or audio codec
specify a sample rate
specify a different output size"`
newsize=`du -a -b "$new" | sed 's/ .*//'`
# show results summary
case $quiet in
y) notify="--notification --window-icon=/usr/share/zenity/zenity-progress.png"
cp /usr/share/zenity/zenity.glade.progress-under /usr/share/zenity/zenity.glade 2>/dev/null ;;
n) notify="--info"
cp /usr/share/zenity/zenity.glade.progress-over /usr/share/zenity/zenity.glade 2>/dev/null ;;
esac
title=`mytranslate "Результаты преобразования"`
text=`mytranslate "Последнее сообщение в"`
text2=`mytranslate "Размер файла:"`
zenity $notify --title="$title" --text="$target --> $new
$text2 $newsize
$note
$prog $text /tmp/$prog.$$:
$result" &
sleep .25
zpid=`ps -ef | grep -v grep | grep -e "--notification" | awk '{print $2}'`
case "$zpid" in
'') ;;
*) (sleep 60; kill -9 $zpid >/dev/null 2>&1) & ;;
esac
case $autoloop in
y) echo -e "choice=\"$choice\"\nbits=\"$bits\"" > /tmp/avffmpeg.env ;;
esac
}
# end of ffmpeg
#####
# ISO conversions
#####
myaviso() {
case $it in
bchunk)
which bchunk >/dev/null 2>&1 || exec zenity --warning --text="Необходимо установить сначала пакет \"bchunk\" !"
tracks=`grep TRACK $base.cue | awk '{print $2}'`
zenity --question --text="BIN/CUE преобразуют в ISO\nCUE показывает дорожки $tracks\nПрогресс будет указан для первой дорожки только \nкоторая будет названа "$base"01.iso" || exit 0
new="$outdir/$base"
if test -s "$new"01.iso
then zenity --question --text="$new"01.iso" существует - Переписать?" || new=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="Выберите новый файл/папку"` || exit 0
fi
prog=bchunk
oldsize=`du -a -b "$base.bin" | awk '{print $1}'`
avwatcher "$new"01.iso "$prog" "$oldsize" $$ &
bchunk "$base.bin" "$base.cue" "$new" >/tmp/bchunk.$$ 2>&1
;;
daa*|nrg*|b?i*|cdi*|mdf*|pdi*|ccd*|uif*)
which $it >/dev/null 2>&1 || exec zenity --warning --text="Никакая программа \"$it\" не найдена для обработки \"$target\"!\n\nДля преобразования ISO, установите один или более из этих пакетов...\n\nAcetoneISO для: b5i cdi mdf nrg pdi\nnrg2iso для: nrg\ndaa2iso для: daa\nbchunk для: bin/cue\nccd2iso для: cdd\nuif2iso для: uif\n\ncdd2iso доступно на: sourceforge.net/projects/ccd2iso\nuif2iso доступно на: aluigi.altervista.org/mytoolz.htm\n\nостальные находятся в репозиториях."
base=`echo $target | sed 's/....$//'`
zenity --question --text="Исходный файл $target\n$ext преобразованный в ISO\nбудет назван $base.iso" || exit 0
new="$outdir/$base".iso
if test -s "$new".iso
then zenity --question --text="$new".iso" exists - Overwrite?" || new=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="Choose a new file/folder"` || exit 0
new="$new".iso
fi
prog=$ext"2iso"
oldsize=`du -a -b "$target" | awk '{print $1}'`
avwatcher "$new" "$prog" "$oldsize" $$ &
case $ext in
b?i|pdi) new="" ;;
esac
$prog "$target" "$new" >/tmp/$prog.$$ 2>&1
;;
esac
}
# end of iso conversions
#####
# Text conversions
#####
myavtext() {
#
# processing text between formats and into other things
# set -x
case $it in
text) # image->avconvert sound->espeak html->txt2tags
out=" image sound html"; height=300 ;;
doc) # text->antiword
out=" text"; height=300 ;;
rtf) # text->unrtf html->unrtf
out=" text html"; height=300 ;;
odt) # text->odt2txt xml->odt2txt
out=" text xml"; height=300 ;;
esac
out=`echo "$out" | sed -e 's/ $ext //' -e "s/ / FALSE /g"`
# loop for output conversion type
while true
do
title=`mytranslate "Конвертированный"`
text=`mytranslate "Формат исходного файла"`
text2=`mytranslate "Конвертировать в формат"`
choice=`zenity --list --height=$height --title="$title $target" --text="$text $show\n$ffident\n" --radiolist --column "$s1" --column "$text2" $out` || exit 0
if [ -n "$choice" ]
then break
fi
done
# pre-check for installed application
case $it$choice in
textsound) if ! which espeak >/dev/null 2>&1
then zenity --warning --title=HELP --text="\"espeak\" package needs to be installed"
exit 0
fi ;;
texthtml) if ! which txt2tags >/dev/null 2>&1
then zenity --warning --title=HELP --text="\"txt2tags\" package needs to be installed"
exit 0
fi ;;
doctext) if ! which antiword >/dev/null 2>&1
then zenity --warning --title=HELP --text="\"antiword\" package needs to be installed"
exit 0
fi ;;
esac
case $it$choice in
textimage) prog=convert; myavconvert 2>/tmp/avconvert.debug ;;
textsound) title=`mytranslate "Язык"`
text=`mytranslate "Выберите язык для произношения"`
pronun=`zenity --list --height=500 --title="$title" --text="$text" --radiolist --column "$s1" --column "$title" FALSE af_afrikaans FALSE bs_bosnian FALSE cs_czech FALSE cy_welsh FALSE de_german FALSE el_greek TRUE en_english FALSE es_spanish FALSE fi_finnish FALSE fr_french FALSE hi_hindi FALSE hr_croatian FALSE hu_hungarian FALSE is_icelandic FALSE it_italian FALSE la_latin FALSE mk_macedonian FALSE nl_dutch FALSE no_norwegian FALSE pl_polish FALSE pt_brazil FALSE ro_romanian FALSE ru_russian FALSE sk_slovak FALSE sr_serbian FALSE sv_swedish FALSE sw_swahihi FALSE vi_vietnam FALSE zh_Mandarin` || exit 0
pronun=`echo $pronun | sed 's/_.*//'`
title=`mytranslate "Голос"`
text=`mytranslate "Выберите речь для использования"`
voice=`zenity --list --height=400 --title="$title" --text="$text" --radiolist --column "$s1" --column "$title" FALSE m1_male-1 FALSE m2_male-2 FALSE m3_male-3 FALSE m4_male-4 FALSE f1_female-1 TRUE f2_female-2 FALSE f3_female-3 FALSE f4_female-4 FALSE croak FALSE whisper` || exit 0
voice=`echo $voice | sed 's/_.*//'`
text=`mytranslate "Высота"`
pitch=`zenity --scale --text="$text" --min-value=0 --max-value=99 --value=50` || exit 0
text=`mytranslate "Скорость"`
speed=`zenity --scale --text="$text" --min-value=0 --max-value=99 --value=43` || exit 0
speed=`expr $speed \* 4`
new=`echo "$target" | \
sed -e 's/.txt$//' -e 's/$/.wav/'`
oldsize=`du -a -b "$target" | awk '{print $1}'`
avwatcher "$outdir/$new" "$prog" "$oldsize" $$ &
cat "$target" | espeak --stdin -v$pronun+$voice -p $pitch -s $speed -w "$outdir/$new" >/tmp/espeak.$$ 2>&1
;;
texthtml) new=`echo "$target" | \
sed -e 's/.txt$//' -e 's/$/.html/'`
oldsize=`du -a -b "$target" | awk '{print $1}'`
avwatcher "$outdir/$new" "$prog" "$oldsize" $$ &
txt2tags --infile="$target" --outfile="$outdir/$new" -t xhtml >> /tmp/txt2tags.$$ 2>&1
if test -s /tmp/txt2tags.$$
then title=`mytranslate "вывод программы"`
zenity --info --title="txt2tags $title" --text=`cat /tmp/txt2tags.$$`
fi
rm -f /tmp/txt2tags.$$
;;
doctext) new=`echo "$target" | \
sed -e 's/.doc$//' -e 's/$/.txt/'`
title=`mytranslate "Опции"`
text=`mytranslate "Включить любой из них?
r = \"revisioning text\"
s = \"hidden text\""`
text2=`mytranslate "Встроенный текст"`
incl=`zenity --list --height=300 --title="$title" --text="$text" --checklist --column "$s1" --column "$text2" FALSE r FALSE s ` || exit 0
case $incl in
'') ;;
*) opts=`echo "$incl" | sed 's/|/ /g' | \
sed 's/^/ /' | sed 's/ / -/g'` ;;
esac
oldsize=`du -a -b "$target" | awk '{print $1}'`
avwatcher "$outdir/$new" "$prog" "$oldsize" $$ &
antiword $opts "$target" > "$outdir/$new" 2>>/tmp/antiword.$$
if test -s /tmp/antiword.$$
then zenity --info --title="antiword output" --text=`cat /tmp/antiword.$$`
fi
rm -f /tmp/antiword.$$
;;
*) text=`mytranslate "Не готов еще"`
zenity --info --title="OOPS!" --text="$text"; exit 0 ;;
esac
}
# end of text
#####
# Initial script #~/.gnome2/nautilus-scripts; export PATH
#####
PATH=$PATH:.:~/.config/caja/scripts/Мультимедиа; export PATH
# check some stuff first...
# have we been renamed?
case `basename $0` in
avconvert) ;;
*) exec xterm -hold -geometry 70x2 -bg red -T "Пожалйста, переименуйте скрипт назад в 'avconvert'" -e true ;;
esac
# if zenity is not installed, use xterm to display a warning
which zenity >/dev/null 2>&1 || exec xterm -hold -geometry 50x2 -bg red -T "OOPS! Must install zenity first!" -e true
# if imagemagick is not installed, display warning
which convert >/dev/null 2>&1 || im="\n\t\"ImageMagick\""
# if ffmpeg is not installed, display warning
which ffmpeg >/dev/null 2>&1 || ffmpeg="\n\t\"ffmpeg\""
# etc, etc
which wget >/dev/null 2>&1 || wget="\n\t\"wget\""
which curl >/dev/null 2>&1 || curl="\n\t\"curl\""
which gawk >/dev/null 2>&1 || gawk="\n\t\"gawk\""
which links >/dev/null 2>&1 || which elinks >/dev/null 2>&1 || links="\n\t\"links\" or \"elinks\""
which bc >/dev/null 2>&1 || bc="\n\t\"bc\""
# special handling for translate
translate="\n\t\"libtranslate\" or \"libtranslate-bin\"\n\t (whichever your distro offers)"
which translate-bin 2>&1 >/dev/null && info translate-bin | grep -q "translate a text" && trbin=/usr/bin/translate-bin
which translate >/dev/null 2>&1 && info translate | grep -q "translate a text" && trbin=/usr/bin/translate
case $trbin in
/*) translate="" ;;
esac
case $im$ffmpeg$wget$curl$gawk$links$bc$translate in
?*) exec zenity --warning --text "Пожалуйста, установите пакет$im$ffmpeg$wget$curl$gawk$links$bc$translate\nи запустите конвертер снова!" ;;
esac
# the config files are now moved....
mkdir -p ~/.config/avconvert
if test -f ~/.avconvert
then for each in ~/.avconvert*
do
new=`echo "$each" | sed 's/^.*\/.//'`
mv $each ~/.config/avconvert/$new
done
fi
# translation
langlist=`$trbin -f en -l | \
sed -e 's/.*-> //' -e 's/ /=/' -e 's/:.*//' | \
tr -d '()\040'`
dlang=`echo "$LANG" | sed 's/_.*//'`
langlist=`echo -e "en=English\n$langlist" | sort | uniq | \
sed -e 's/^/FALSE /' -e "/ $dlang=/s/FALSE/TRUE/"`
online=n
#echo "$langlist" | grep English >/dev/null && online=y
if ping -c 1 google.com >/dev/null 2>&1
then online=y
fi
# if language preference file is out of date, remove it
if grep "lang=" ~/.config/avconvert/avconvert.lang >/dev/null 2>&1
then :
else rm -f ~/.config/avconvert/avconvert.lang
fi
# requirements for translations
if which curl >/dev/null 2>&1
then curlok=y
else curlok=n; text="$text\n\tcurl"
fi
if which elinks >/dev/null 2>&1
then linksok=y; links=elinks
else if which links >/dev/null 2>&1
then linksok=y; links=links
else linksok=n; text="$text\n\telinks -OR- links"
fi
fi
# if we are not online, do not ask about language
if [ "$online" = "n" ]
then lang=en
else
# check language
if test -s ~/.config/avconvert/avconvert.lang
then . ~/.config/avconvert/avconvert.lang
case $curlok$linksok in
*n*) if [ "$lang" = "en" ]
then : ok
else zenity --info --title="Required for translation" --text="Please install$text\nfor translation"
lang="en"
fi
;;
esac
export lang service
else lang=`zenity --list --height=520 --title="Language" --text="Выберите язык для всего текста" --radiolist --column="Select" --column="Language" $langlist` || exit 0
lang=`echo $lang | sed 's/=.*//'`
echo "lang=$lang" > ~/.config/avconvert/avconvert.lang
export lang
if [ "$lang" = "en" ]
then online=n
else text="Пожалуйста, установите пакет(s):\n"
case $curlok$linksok in
*n*) zenity --info --title="Необходимы пакеты" --text "$text\n\nдля показа перевода.\nПереход на английский язык, пока не установлено."
online=n ;;
esac
#service=`zenity --list --title="Service" --text="Which service should be used" --radiolist --column="Select" --column="Language" TRUE google FALSE babel` || exit 0
#echo "service=$service" >> ~/.config/avconvert/avconvert.lang
#export lang service
export lang
fi
title=`mytranslate "Параметры языка"`
text=`mytranslate "Когда Интернет будет доступен, этот сценарий будет
отправлять текст через сервис онлайн-перевода.
Если не будет интернет-соединения, то все будет на английском языке.
Если Интернет медленный, переводы могут работать не хорошо.
Пожалуйста, сообщите мне, если есть проблемы, чтобы я мог это улучшить.
Ваш язык сохранен в ~/.config/avconvert/avconvert.lang
Удалите или отредактируйте тот файл, чтобы изменить язык."`
[ "$lang" = "en" ] && text="Вы приняли решение вывести на экран текст на английском языке.
Вы можете изменить язык, редактируя или удаляя
~/.config/avconvert/avconvert.lang"
zenity --info --title="$title" --text="$text"
fi
fi
# if language is EN, we do not need to translate
case $lang in
en) online=n ;;
esac
if grep "trash=" ~/.config/avconvert/avconvert >/dev/null 2>&1
then : UP TO DATE
else rm -f ~/.config/avconvert/[Aa]vconvert
fi
if test -s ~/.config/avconvert/avconvert
then : defaults already set
else echo -e "destdir=n\nautoloop=n\nzenityfix=n\nquiet=n\ntrash=n" > ~/.config/avconvert/avconvert
title=`mytranslate "Набор значения по-умолчанию"`
text=`mytranslate "Это - Ваш первый показ avconvert.
Файл ~/.config/avconvert/avconvert может сохранить некоторые поведения по-умолчанию. Вы можете теперь создать тот, выбирая из опций ниже,
и Вы можете изменить его в любое время, редактируя его непосредственно или удаляя его, который инициирует этот диалог, чтобы вновь появиться.
Читайте каждую опцию ниже и выберите Ваши параметры, сопровождая OK, или нажмите Cancel, чтобы задержать это до позже."`
p1=`mytranslate "Всегда всплывающее окно, чтобы попросить место назначения, в которое можно сохранить переделанные файлы"`
p2=`mytranslate "Когда выбрано много файлов, то обрабатывать каждый таким же образом"`
p3=`mytranslate "Проверьте zenity значения по-умолчанию и предложите фиксировать их раскрытие так, как ЗАКОНЧЕНЫ, а не ПОД"`
p4=`mytranslate "Тихий режим - использует 'уведомление' вместо 'информации', чтобы показать некоторые результаты преобразования"`
p5=`mytranslate "ОЧЕНЬ тихий режим - НИКОГДА не показывает индикаторы хода выполнения"`
p6=`mytranslate "После преобразований, предложение переместить оригиналы в ~/Desktop/avconvert-Trash"`
behavior=`zenity --list --height=400 --title="$title" --text="$text" --checklist --column="" --column="Description" TRUE "$p1 (destdir=y)" TRUE "$p2 (autoloop=y)" TRUE "$p3 (zenityfix=y)" TRUE "$p4 (quiet=y)" FALSE "$p5 (veryquiet=y)" FALSE "$p6 (trash=n)"` || exit 0
echo "$behavior" | tr '|' '\012' | sed -e 's/^.*(//' -e 's/.$//' | grep "=" >> ~/.config/avconvert/avconvert
title=`mytranslate "Набор значения по-умолчанию изображения"`
text=`mytranslate "При преобразовании изображений система может установить значение по-умолчанию для типа файла быть преобразованным в.
выберите один из следующих"`
col=`mytranslate "Расширения изображения по-умолчанию"`
i1=`mytranslate "Никакого значения по-умолчанию не должно быть предварительно выбрано"`
i2=`mytranslate "Создайте изображение того же типа, как исходный"`
i3=`mytranslate "Тип изображения по-умолчанию должен быть"`
imageext=none
imageext=`zenity --list --height=370 --title="$title" --text="$text" --radiolist --column="" --column="$col" TRUE "$i1 (imageext=none)" FALSE "$i2 (imageext=same)" FALSE "$i3 gif (imageext=gif)" FALSE "$i3 jpg (imageext=jpg)" FALSE "$i3 ico (imageext=ico)" FALSE "$i3 pdf (imageext=pdf)" FALSE "$i3 png (imageext=png)" FALSE "$i3 tif (imageext=tif)"` || exit 0
echo "$imageext" | tr '|' '\012' | sed -e 's/^.*(//' -e 's/.$//' >> ~/.config/avconvert/avconvert
. ~/.config/avconvert/avconvert
echo "# Defaults file for avconvert, created `date`
destdir=$destdir
autoloop=$autoloop
zenityfix=$zenityfix
quiet=$quiet
veryquiet=$veryquiet
trash=$trash
imageext=$imageext
" > ~/.config/avconvert/avconvert
fi
# set everything to 'defaults' regardless of preferences file
# in case there's no file, or some are missing
destdir=y; autoloop=x; zenityfix=y; imageext=none; quiet=n trash=n
# now "dot" the file if it is there
# due to google translator, be sure it is linked to Avconvert as well
if test -s ~/.config/avconvert/avconvert
then . ~/.config/avconvert/avconvert
if cmp ~/.config/avconvert/avconvert ~/.config/avconvert/Avconvert >/dev/null 2>&1
then : alldone
else rm -f ~/.config/avconvert/Avconvert
ln ~/.config/avconvert/avconvert ~/.config/avconvert/Avconvert
fi
fi
# here we go.....
# let's get some common translated phrases in advance first:
# export them all!!
s1=`mytranslate "Выбор"`; export s1
while true
do
case $1 in
--no-destdir) destdir=n; shift ;;
--no-loop) autoloop=n; shift ;;
--no-zenityfix) zenityfix=n; shift ;;
*) break ;;
esac
done
case $1 in
'') which avconvert >/dev/null 2>&1 || exec zenity --warning --text="Внимание необходимо:\n\nНикакие исходные файлы не были выбраны. Это OK,\nно для того, чтобы работать должным образом, программа avconvert должна быть скопирована или соединена\nк расположению, которое находится по Вашему ПУТИ.\nИли Вы можете изменить свой ПУТЬ, чтобы включить расположение этого сценария."
title=`mytranslate "Выберите исходные файлы. Они должны быть все того же типа (все изображения или все видео, и т.д.)"`
files=`zenity --title="$title" --file-selection --multiple --separator="|"` || exit 0
files=`echo "$files" | sed -e 's/^/"/' -e 's/$/"/' -e 's/|/" "/g'`
echo "avconvert $* $files" > /tmp/avconvert.rerun
sh /tmp/avconvert.rerun &
rm -f /tmp/avconvert.rerun
exit 0
;;
esac
# if this is not a "fixable" zenity, do not try to fix it
# (at least) ubuntu 9.10 lacks the configuration file
if test -s /usr/share/zenity/zenity.glade
then : good
else zenityfix=n
fi
case $zenityfix in
n) ;;
*)
if test -s /usr/share/zenity/zenity.glade.orig
then : already done
else cat << ZenityFix > /tmp/zenity.fix
# zenity.fix
# written by
# marc brumlik, tailored softare inc
# distributed with
# avconvert, posted on gnome-look, to correct the behavior of zenity
# The driectory containing zenity.glade is:
DIR=/usr/share/zenity
if test -s \$DIR/zenity.glade
then cd \$DIR
else echo -e "Файл /usr/share/zenity/zenity.glade\nне может быть найден!\n\nПожалуйста, измените скрипт /tmp/zenity.fix с корректным\nрасположением файла 'zenity.glade'.\nТогда выполните его непосредственно из командной строки.\n\nВыйдите теперь...\n\nНажмите Возврат (Return) \c"; read fred; exit 0
fi
echo -e "\nИзменение файла \$DIR/zenity.glade\n\nСохраняет безопасную копию Вашего файла как zenity.glade.orig"
if test -s zenity.glade.orig
then echo "Кажется, это было выполнено прежде."
echo "Выполнить его снова..."
else cp zenity.glade zenity.glade.orig
fi
cat zenity.glade.orig | sed '/focus_on_map/s/False/True/' > zenity.glade
cp zenity.glade zenity.glade.progress-over
progline=\`grep -n "zenity_progress_dialog" zenity.glade | sed 's/:.*//'\`
focusline=\`sed -n "\$progline,\$"p < zenity.glade | grep -n focus_on_map | \
head -1 | sed 's/:.*//'\`
targetline=\`echo -e "\$progline + \$focusline - 1 \n quit" | bc\`
sed "\$targetline s/True/False/" < zenity.glade.progress-over > zenity.glade.progress-under
chmod 666 /usr/share/zenity/zenity.glade
echo -e "/tmp/zenity.fix now exiting\n\nPress Return \c"; read fred
ZenityFix
chmod 755 /tmp/zenity.fix
if which xterm >/dev/null 2>&1
then message=`mytranslate "Нажмите OK, если Вы хотите, чтобы это было выполнено для Вас прямо сейчас, или если Вы предпочитаете, нажмите Cancel, чтобы препятствовать тому, чтобы avconvert сделал это. Если Вы, Отмена, avconvert создаст сценарий /tmp/zenity.fix, который Вы можете выполнить как \'root\' вручную. Это изменит Ваше значение по-умолчанию Zenity, таким образом, его окна появятся поверх любых других."`
else message=`mytranslate "Это изменение не может быть автовыполнена для Вас, потому что у Вас не установлен \'xterm\'. Нажмите Cancel и выполните /tmp/zenity.fix как \'root\'. Это изменит значения по-умолчанию Zenity, таким образом, его окна появятся поверх любых других."`
fi
title=`mytranslate "Значения по-умолчанию Zenity"`
text1=`mytranslate "Утилиту Linux, которую avconvert использует для раскрывающихся диалоговых окон, вызывают Zenity. В некоторых выпусках эти диалоговые окна раскрываются под существующими окнами. Это делает чтение вывода и ответ на подсказки от avconvert очень неудобными.
Ваша установленная версия Zenity - та, которая ведет себя этот путь. Для Вашего удобства маленькая программа, названная 'zenity.fix', была просто записана в Вашей директории /tmp."`
text2=`mytranslate "ВНИМАНИЕ: это окно и некоторые другие могут быть постоянно заставлены замолчать или с параметрами командной строки или создавая файл конфигурации ~/.config/avconvert/avconvert. Считайте конец avconvert сценария для деталей.
Кроме того, это окно не появится вновь, как только zenity значения по-умолчанию были изменены ИЛИ, пока файл /tmp/zenity.fix существует."`
zenity --question --title="$title" --text="$text1\n\n$message\n\n$text2" && xterm -e ' echo -e "To fix zenity requires Root \c"; su -c /tmp/zenity.fix '
fi
;;
esac
case $quiet in
y) cp /usr/share/zenity/zenity.glade.progress-under /usr/share/zenity/zenity.glade 2>/dev/null ;;
n) cp /usr/share/zenity/zenity.glade.progress-over /usr/share/zenity/zenity.glade 2>/dev/null ;;
esac
rm -f /tmp/avconvert.env /tmp/avffmpeg.env
for each in "$@"
do
allargs=`echo -e "$allargs\n$each"`
done
allargs=`echo -e "$allargs" | grep -v "^$"`
chkavi=`echo -e "$allargs" | sed 's/^.*\.//' | egrep "avi$|AVI$" | sort | \
uniq | wc | awk '{print $1}'`
case $chkavi in
1) qtyavi=`echo -e "$allargs" | wc | awk '{print $1}'`
case $qtyavi in
[01]) ;;
*) multiavi=y ;;
esac ;;
esac
case $multiavi in
y) title=`mytranslate "Объединить AVI файлы"`
text1=`mytranslate "Вы выбрали один или несколько AVI файлов."`
text2=`mytranslate "Нажмите CANCEL, чтобы продолжить с нормальными преобразованиями."`
text3=`mytranslate "Если эти файлы все имеют те же настройки аудио и видео"`
text4=`mytranslate "Вы можете нажать "OK", чтобы объединить их в один AVI файл."`
text5=`mytranslate "Заключительный файл будет назван MergedAVI.avi"`
if zenity --question --title="$title" --text="$text1\n\n$text2\n\n$text3\n$text4\n\n$text5"
then if ! which avimerge >/dev/null 2>&1
then zenity --warning --title=HELP --text="Необходима программа \"avimerge\" , но не была найдена.\nЭто должно быть обеспечено пакету \"transcode\" .\nПожалуйста, установите его и попробуйте снова."
exit 0
fi
dest=`echo -e "$allargs"| head -1`
dest=`dirname "$dest"`
oldsize=`du -b -c "$allargs" | grep total | awk '{print $1}'`
avwatcher "$dest/MergedAVI.avi" "avimerge" "$oldsize" $$ &
avimerge -o "$dest/MergedAVI.avi" -i "$@" >/tmp/avimerge.$$ 2>&1
exit 0
fi ;;
esac
chkvob=`echo -e "$allargs" | sed 's/^.*\.//' | egrep "vob$|VOB$" | sort | \
uniq | wc | awk '{print $1}'`
case $chkvob in
1) qtyvob=`echo -e "$allargs" | wc | awk '{print $1}'`
case $qtyvob in
[0]) ;;
*) multivob=y ;;
esac ;;
esac
case $multivob in
y) title=`mytranslate "Объединить VOB файлы"`
text1=`mytranslate "Вы выбрали один или несколько VOB файлов."`
text2=`mytranslate "Нажмите CANCEL, чтобы продолжить с нормальными преобразованиями."`
text3=`mytranslate "Вы можете нажать "OK", чтобы объединить их в один AVI файл"`
text4=`mytranslate "со всем набором опций, чтобы отделить от DVD."`
text5=`mytranslate "Заключительный файл будет назван $HOME/Desktop/MergedVOB.avi"`
if zenity --question --title="$title" --text="$text1\n\n$text2\n\n$text3\n$text4\n\n$text5"
then dest=`echo -e "$allargs"| head -1`
dest=`dirname "$dest"`
oldsize=`du -b -c "$allargs" | grep total | awk '{print $1}'`
avwatcher "$HOME/Desktop/MergedVOB.avi" "ffmpeg" "$oldsize" $$ &
cat "$allargs" | ffmpeg -i - -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k $HOME/Desktop/MergedVOB.avi
exit 0
fi ;;
esac
until [ -z "$1" ]
do
fileargs="$fileargs
$1"
echo "$1" > /tmp/files
targetpath=$1; shift
target=`basename "$targetpath"`
# had used this due to an earlier bug, but dirname is better
# dir=`echo "$targetpath" | sed "s/\/\$target//"`
dir=`dirname "$targetpath"`
case "$dir" in
*/*) ;;
*) dir=`pwd` ;;
esac
test -d "$dir" && cd "$dir"
dir=`pwd`
if test -f "$target"
then if test -s "$target"
then : OK
else text=`mytranslate "Исходный файл ПУСТОЙ"`
exec zenity --warning --text="$target\n\n$text"
fi
else text=`mytranslate "Исходный файл, НЕ НАЙДЕН!"`
exec zenity --warning --text="$target\n\n$text"
fi
echo destdir: $destdir
echo target: $target
echo outdir: $outdir
case $outdir in
'')
case $destdir in
n) outdir=`pwd` ;;
esac
case "$outdir" in
'') outdir=`dirname "$target"` ;;
esac
case $destdir in
y) outdir="" ;;
esac
if test -z "$outdir"
then cwd=`pwd`
title=`mytranslate "Целевая папка (ОТМЕНА запишет в ИСХОДНЫЙ КАТАЛОГ)"`
outdir=`zenity --file-selection --directory="$dir" --title="$title"`
if test -z "$outdir"
then outdir=$cwd
fi
fi
;;
esac
case "$target" in
*.*) ;;
*) zenity --question --title="Что сделать?" --text="Это было бы хорошо, если \"$target\" имел расширение...\nПереименование этого файла рекомендуется!\n\nЧтобы мог avconvert продолжить, так или иначе, нажимите OK.\nЧтобы выйти теперь, таким образом, Вы можете переименовать файл, нажмите Cancel" || exit 0 ;;
esac
type=`file "$target" | tr '[A-Z]' '[a-z]' | sed 's/^.*://'`
mtype=`file -i "$target" | tr '[A-Z]' '[a-z]' | sed 's/^.*://'`
show=`file "$target" | awk -F: '{print $2}'`
case "$target" in
*.rm|*.rmvb|*.???|*.????) ext=`echo "$target" | sed 's/^.*\.//'` ;;
*) ext="" ;;
esac
lcext=`echo "$ext" | tr '[A-Z]' '[a-z]'`
# imagemagick identify does not properly execute mencoder on *avi files
# and instead generated a png image for every frame.
# until fixed, this like should be commented out.
## ident=`identify "$target" 2>/dev/null | sed "s/^.*$ext //"`
# ffmpeg provides lots of info anyway
ffident=`ffmpeg -i "$target" 2>&1 | tail -4 | head -3`
if echo "$ffident" | grep Unable >/dev/null
then ffident=""
fi
echo "$ffident" | grep audio >/dev/null && fftype=audio
echo "$ffident" | grep video >/dev/null && fftype=video
[ "$fftype" = "video" ] && echo "$ffident" | grep "bitrate: N/A" && fftype=image
[ "$fftype" = "image" ] && imident=`echo "$ffident" | grep Video | \
awk -F, '{print $1, $2, $3, $4}' | sed 's/^.*://'`
# based on source file, what might the destinations be?
# what application will we use to create them?
# the case wildcards are things we know how to convert FROM
# "prog" is the actual conversion program
# "out" is a list of formats we can choose to convert TO
it=""; av="" # for "image/text" and "audio/video"
# strings from file, and extensions, which imply input file type
case "$fftype$type$mtype$lcext" in
*bin)
base=`echo "$target" | sed 's/.bin$//'`
if test -s "$base".cue
then prog=iso; it=bchunk
fi ;;
*cue)
base=`echo "$target" | sed 's/.cue$//'`
if test -s "$base".bin
then prog=iso; it=bchunk
fi ;;
*daa)
prog=iso; it=daa2iso ;;
*nrg)
prog=iso; it=nrg2iso ;;
*b?i)
prog=iso; it=b5i2iso ;;
*cdi)
prog=iso; it=csi2osi ;;
*mdf)
prog=iso; it=mdf2iso ;;
*pdi)
prog=iso; it=pdi2iso ;;
*ccd)
prog=iso; it=ccd2iso ;;
*uif)
prog=iso; it=uif2iso ;;
*text/plain*|*ascii*)
# recognized plain text formats, out to other text or image
prog="text"; it="text" ;;
*image*|*pdf|*ico|*orf)
# recognized image formats, output will also be an image
prog="convert"; it="image" ;;
*video*|*3g2|*3gp|*ogv|*mkv|*mpg|*wmv|*asf|*mp4|*ogg|*rm|*rmvb)
# recognized multimedia formats, output to multimedia or audio
prog="ffmpeg"; av="video" ;;
*audio*|*mp3|*wav|*m4a|*wma)
# recognized audio-only formats, output to audio
prog="ffmpeg"; av="audio" ;;
*msword*)
# micro$oft office word document, v2 / v6 or newer
prog=text; it="doc" ;;
text/html)
prog=text; it="html" ;;
*text/rtf*)
prog=text; it="rtf" ;;
*Unicode*)
prog=text; it="uni" ;;
*opendocument*|*openoffice*)
prog=text; it="odt" ;;
*openoffice*)
prog=text; it="oo" ;;
*) prog=`zenity --list --height=520 --title="Неизвестно!" --text="Не уверенны, что сделать с этим файлом!\n\nКонечный файл: \"$target\"\n\nИнформация найдена:\n$type\n$mtype\n$ffident$ident\n\n\nВероятно, этот тип файла не был\nявно распознан, но avconvert может его обработать\nпреобразованием (Images) или ffmpeg (Audio/Video).\n\nЕсли Вы хотите ПОПРОБОВАТЬ выбрать утилиту, которая Вы думаете\nподойдет, то avconvert приложит все усилия.\n\n" --radiolist --column "Выбор" --column "Утилита, чтобы использовать" FALSE convert FALSE ffmpeg` || exit 0
case $prog in
ffmpeg) av=`zenity --list --title="Выбор" --text="Скажите ffmpeg, является ли этот файл:" --radiolist --column "Выбор" --column "Тип контента" FALSE audio FALSE video` || exit 0 ;;
convert) it=image ;;
esac
;;
esac
# export everything we know so far and launch the appropriate function quality
case $prog in
ffmpeg|convert) audiovideo=y ;;
*) audiovideo=n ;;
esac
case "$1$audiovideo$autoloop" in
?*yx) autoloop=n
zenity --question --title="Auto-Loop though Source Files??" --text="Вы выбрали разнообразные исходные файлы. Avconvert циклично пройдется по ним и преобразует их всех.\n\n*ЕСЛИ* Вы знаете, что все исходные файлы имеют тот же тип\n (images, audio, и т.д.)\nи *ЕСЛИ* Вы хотите их, чтобы все они преобразовались тем же путем\n (images->1024/jpg, audio->128bit/mp3, и т.д.)\n*ТОГДА* кликните OK\n\n Но...\n\n*ЕСЛИ* исходные файлы имеют различные типы\n (не ВСЕ изображения или не ВСЕ видео)\nили, *ЕСЛИ* Вы хотите управление за файл того, как каждый источник обработан you want per-file control of how each source is handled\n*ТОГДА* нажмите Cancel\n\nOK, желая auto-loop (авто-цикл), Cancel, желая рассмотреть каждый файл отдельно." && autoloop=y
;;
esac
today=`date +%Y%m%d`
if grep "$today" ~/.config/avconvert/versioncheck >/dev/null 2>&1
then : already checked
else echo "$today" > ~/.config/avconvert/versioncheck
versioncheck=`wget -q --timeout=3 --tries=1 \
http://www.gtk-apps.org/CONTENT/content-files/92533-avconvert.tar.gz -O - | \
gunzip 2>/dev/null | grep -a version= | head -1 | \
sed -e 's/"$//' -e 's/^.*"//'`
case "$versioncheck" in
[0-9].[0-9][0-9]*)
case "$versioncheck" in
"$version") ;;
*) zenity --info --height=500 --title="Более новая версия 'avconvert' доступна для скачивания" --text="Вы используете версию\n\t$version\n\nДоступно для скачивания\n\t$versioncheck"
;;
esac
esac
fi
export dir target ext type mtype show ident ffident it av prog autoloop base
myav$prog
# this 'done' is for looping through multiple selected input files
done
case $overwrite in
YES) ;;
*) case $trash in
y) totrash=`zenity --list --title="Отправить в мусор?" --height=210 --text="Вы можете переместить исходный файл(ы) в\n$HOME/Desktop/avconvert-Trash" --radiolist --column "Выбор" --column "Trashcan the исходный файл(ы)?" TRUE NO FALSE YES` || exit 0
case $totrash in
NO) ;;
YES) mkdir -p ~/Desktop/avconvert-Trash/$$ 2>&1
echo "$fileargs" | while read each
do mv "$each" ~/Desktop/avconvert-Trash/$$; done
;;
esac
;;
esac
;;
esac
exit 0
#####
# READ ME
#####
avconvert
marc brumlik, tailored software inc, Thu Nov 13 18:50:35 CST 2008
tsi-inc@comcast.net
#######
# IF YOU READ NO FURTHER THAN THIS, please note that when using
# "kcolorchooser" in text-to-image, there is a delay after choosing your
# color before the next window from avconvert comes up. I have no idea why
# kcolorchooser is behaving this way.
#######
This project started out because I needed to create jpg files of numerous
resolutions from a number of source files and wanted an automatic way to
generate them more quickly. Then my daughter asked for a way to convert
"unplugged" YouTube files into formats her friends could view.
Combining these two short scripts is where avconvert began.
Upon completion of each use of avconvert, a file for debugging purposes
is written to, with lots of output showing exactly what the script
has done. This can help a lot if you are getting unexpected results.
The file name is derived from the conversion, followed by "dot" PID. In the
case of text->image and if intermediary files were generated, there will be
another "dot" and a sequence number. These files will be named:
/tmp/convert.$$
/tmp/convert.$$.$count
/tmp/ffmpeg.$$
/tmp/avconvert.debug
/tmp/txt2tags.$$
/tmp/antiword.$$
and more may be added in the future.
You can create a startup file ~/.config/avconvert/avconvert to contain preferences.
Currently there are three items that can be specified there.
A ~/.config/avconvert/avconvert which specifies the defaults for these would contain this:
destdir=y
autoloop=y
zenityfix=y
The line "destdir" specifies whether or not there should be a popup prompting
for a destination directory for converted files. The line "autoloop" determines
whether, if multiple files are selected, you will be prompted and asked if you
want to treat them all the same way. Y means prompt, N means always treat the
files individually. THe line "zenityfix" has to do with the prompt which offers
to fix zenity popups so they appear above (instead of below) other items on the
desktop. Y means detect "popunder" and offer to fix it, N means ignore current
zentiy configuration.
Строка "destdir" определяет, должен ли быть popup, вызывающий для справочника назначения для переделанных файлов.
Строка "autoloop" определяет, побудят ли, если многократные файлы отобраны,
Вас и спросят, хотите ли Вы рассматривать их все равно путь.
Y быстрые средства, N средства всегда рассматривают файлы индивидуально.
Строка "zenityfix" имеет отношение к быстрому, которое предлагает фиксировать zenity popups,
таким образом, они появляются выше (вместо ниже) другие пункты на рабочем столе.
Y средства обнаруживают "popunder" и предлагают фиксировать, это, N средства игнорирует ток zentiy конфигурация.
Things you might want to customize (starting from the top of the script):
Вещи Вы могли бы хотеть настроить (начинающийся с верхней части подлинника):
Too much verbage that gives information about source files?
Слишком много verbage, который дает информацию об исходных файлах?
comment out the "ident=" and "ffident=" lines
Too much window activity and want to eliminate "progress" window?
Слишком много деятельности окна и хочет устранить окно "прогресса"?
uncomment the "exit 0" at the top of "myavconvert-watch"
To add more extensions to recognized file types for image/video/audio:
the script uses two different forms of output from the
"file" command plus the source file extension, to decide
what type of file it has to work with. "file" isn not
always useful, which is why extensions are needed at all.
find the comment "# strings from file". Below that are
four cases. Each contains first something that may have
been output by "file", followed by a set of extensions.
Just follow the example to add more extensions.
To add more extensions to the default list of output file types:
Find the comment line beginning "Show appropriate output".
Below that are four entries - two for "convert" and two
for "ffmpeg". These are each divided into two more.
Just add any extension you like into that space-separated
list (do NOT remove the leading space in the list).
To prevent a "default" output type for images:
Currently the default output for images is the same as
the source file type. To prevent this, find the comment
"This line sets default" and, on the line for "convert",
and comment out the "out=" line below that.
To change the list of image resolutions presented:
Find the comment "# set resolution here". Add or
remove any resolutions from the list. Also, setting
one or more from FALSE to TRUE will cause them to be
checkboxed when the window appears.
To change the list of jpg quality settings:
Find the comment "# if this is a jpeg". Add or remove.
You may also set the default by changing a FALSE to TRUE
To change the list of font sizes:
Modify the line beginning "sizelist=".
To change bitrate choices for ffmpeg audio conversion:
Find the comment line "# audio bitrate".
To set a default bitrate, change one of the FALSE to TRUE.
To prevent the final window showing summary after completion:
(Not recommeded, since this is ALSO where you might see
diagnostic output after a failure)
Find the comment " Show results summary" and comment out the
"zenity" line that follows it.
COMMENTS WELCOME!