Formatting code for CkAllAvi2Webm


show source only

======Avi to ""WebM"" convert======

This script converts all avi files (readable by ffmpeg) in the current directory to VP8/Vorbis videos, also known as ""WebM"".

====Requirements====

~-php5-cli
~-ffmpeg (with libvpx and libvorbis support + any other codecs that are going to be read)
~-coreutils

Tested on Linux.

====The script (version 1.0.3)====

%%(php;1;ckallavi2webm.php)
#!/usr/bin/php -q

<?php

/*
CkAllAvi2Webm - convert all avi files to webm using ffmpeg
Copyright (C) 2011 Ɓukasz "Cyber Killer" Korpalski

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

system('ls -1 ./*.[a,A][v,V][i,I] > /tmp/list-ckallavi2webm.txt');
$names = file('/tmp/list-ckallavi2webm.txt');
system('rm /tmp/list-ckallavi2webm.txt');

foreach($names as $name)
{
system('ffmpeg -i "' . rtrim($name) . '" -threads 2 "' . substr(rtrim($name),0,-4) . '.webm"');
}

?>
%%

Just click grab to save the file, or copy&paste it yourself to your favorite editor. Remember to add executable permissions.

====License====

This program is under the [[http://www.gnu.org/licenses/gpl.html GNU GPL v3]] or later.

----::c::
CategoryProjekty
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki