From 7c16e8bcbe77ea62cc66379903f4a2bc651c3130 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 30 Jan 2012 19:22:46 +0000 Subject: [PATCH] --- fluidbook/tools/webvideo | 39 ++++++++++++++++++--- inc/ws/Controlleur/class.ws.maintenance.php | 24 +++++++++++++ 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/fluidbook/tools/webvideo b/fluidbook/tools/webvideo index e639bc5d1..e42645b8d 100644 --- a/fluidbook/tools/webvideo +++ b/fluidbook/tools/webvideo @@ -5,9 +5,38 @@ extension=${filename##*.} 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 diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index d36ce6db8..62b58f01f 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -639,6 +639,30 @@ class wsMaintenance { wsLang::getV1Translations(); } + public static function reprocessVideos($args) { + global $core; + + $book_id = $args[0]; + + $dir = WS_BOOKS . '/working/' . $book_id; + + $dao = new wsDAODocument($core->con); + $dao->getLinksAndRulers($book_id, $links, $rulers); + + foreach ($links as $link) { + if ($link['type'] != 4) { + continue; + } + + $file=$dir . '/' . $link['to']; + if (!file_exists($file)) { + continue; + } + + wsTools::encodeWebVideos($file, null, true, true); + } + } + } ?> \ No newline at end of file -- 2.39.5