[add] use external video encoder

This commit is contained in:
Knah Tsaeb 2014-08-01 15:54:31 +02:00
parent b18a444b79
commit 463c635855
1 changed files with 14 additions and 9 deletions

View File

@ -9,7 +9,6 @@ nbProcessLauch=$(ps -ef | grep -v grep | grep youtube-dl | wc -l)
if [ $nbProcessLauch != 0 ]
then
echo 'bye'
exit
fi
@ -17,19 +16,25 @@ for file in $tempDest*.hash
do
if [ -f $file ];
then
while read urlHash url destination
do
/usr/local/bin/youtube-dl -R 0 -c --write-thumbnail --write-info-json --recode-video webm --no-check-certificate -f 45/46/37/45/22/44/35/34/5 -o "$urlHash.%(ext)s" "$url"
convert "$urlHash.jpg" -resize 260 "$urlHash.thumb.jpg"
sleep 10
while read ddl urlHash url destination
do
if [ ddl != 0 ]
then
/usr/local/bin/youtube-dl -R 0 -c --write-thumbnail --write-info-json --no-check-certificate -f 45/46/37/45/22/44/35/34/5 -o "$urlHash.%(ext)s" "$url"
convert "$urlHash.jpg" -resize 260 "$urlHash.thumb.jpg"
sleep 2
avconv -i $urlHash\.mp4 -codec:v libvpx -cpu-used 0 -b:v 500k -qmin 20 -qmax 42 -maxrate 500k -bufsize 1000k -threads $threads -codec:a libvorbis -b:a 128k $urlHash\.webm
sleep 2
else
wget -O urlHash url
fi
if [ ! -f $urlHash.*.part ]
then
rm $file
sleep 1
sleep 2
mv $urlHash* $destination
fi
done < $file
fi
rm $pageCache*.html
rm $pageCache*.html 2> /dev/null
done
# -rc_lookahead 16 -g 360 -threads 3