filename=${filename%.*}
-ulimit -t 360;/usr/local/bin/ffmpeg -i $1 -y -r 1 -ss 00:00:04 -t 00:00:01 -f image2 $2/$filename.jpg
-ulimit -t 360;/usr/local/bin/ffmpeg -i $1 -keyint_min 0 -g 250 -skip_threshold 0 -qmin 1 -qmax 51 -vcodec libvpx -b 614400 -acodec libvorbis -y $2/$filename.webm
-if[extension!="mp4"]
- ulimit -t 360;/usr/bin/ffmpeg -i $1 -y -acodec aac -ab 128k -vcodec libx264 -b 1200k -mbd 2 -cmp 2 -subcmp 2 -strict experimental $2/$filename.mp4
+ulimit -t 3600;/usr/local/bin/ffmpeg -i $1 -y -r 1 -ss 00:00:04 -t 00:00:01 -f image2 $2/$filename.jpg
+ulimit -t 3600;/usr/local/bin/ffmpeg -i $1 -keyint_min 0 -g 250 -skip_threshold 0 -qmin 1 -qmax 51 -vcodec libvpx -b 614400 -acodec libvorbis -y $2/$filename.webm
+if [ extension != "mp4" ]
+then
+ ulimit -t 3600;/usr/bin/ffmpeg -i $1 \
+-y \
+-acodec aac \
+-ab 64k \
+-vcodec libx264 \
+-b 384k \
+-mbd 2 \
+-cmp 256 \
+-subcmp 2 \
+-subq 6 \
+-strict experimental \
+-coder 0 \
+-trellis 0 \
+-bf 0 \
+-refs 5 \
+-flags +loop+mv4 \
+-partitions +parti4x4+parti8x8+partp4x4+partp8x8 \
+-flags2 +mixed_refs \
+-me_range 16 \
+-g 250 \
+-keyint_min 25 \
+-sc_threshold 40 \
+-i_qfactor 0.71 \
+-qmin 10 -qmax 51 \
+-qdiff 4 \
+-ac 1 \
+-ar 16000 \
+-r 13 \
+$2/$filename.mp4
fi
-ulimit -t 360;/usr/local/bin/ffmpeg2theora $1 -o $2/$filename.ogv
\ No newline at end of file
+ulimit -t 3600;/usr/local/bin/ffmpeg2theora $1 -o $2/$filename.ogv
wsLang::getV1Translations();\r
}\r
\r
+ public static function reprocessVideos($args) {\r
+ global $core;\r
+\r
+ $book_id = $args[0];\r
+\r
+ $dir = WS_BOOKS . '/working/' . $book_id;\r
+\r
+ $dao = new wsDAODocument($core->con);\r
+ $dao->getLinksAndRulers($book_id, $links, $rulers);\r
+\r
+ foreach ($links as $link) {\r
+ if ($link['type'] != 4) {\r
+ continue;\r
+ }\r
+\r
+ $file=$dir . '/' . $link['to'];\r
+ if (!file_exists($file)) {\r
+ continue;\r
+ }\r
+\r
+ wsTools::encodeWebVideos($file, null, true, true);\r
+ }\r
+ }\r
+\r
}\r
\r
?>
\ No newline at end of file