usando la libreria ffmpeg
import commands
import os
def execute():
cmd = 'c:/ffmpeg/ffmpeg.exe -y -itsoffset -4 -i c:/input.mpg -vframes 1 -s 100x90 -f image2 c:/uploads/img_gen.jpg'
#c = commands.getoutput(cmd) # linux
c = os.system(self.cmd) #windows
return c
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2058"></script>
$videofile = "fichier.flv";
passthru("ffmpeg -i "{$videofile}" 2>&1");
$search='/Duration: (.*?),/';
$duration=
preg_match($search,
$duration,
$matches, PREG_OFFSET_CAPTURE,
3);
Pour récupérer la durée, en seconde, on peut utiliser cette fonction :
echo hms2sec
($matches[1][0]);
function hms2sec ($hms) {
$seconds = 0;
$seconds +=
(intval($h) *
3600);
$seconds +=
(intval($m) *
60);
return $seconds;
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2052"></script>
Kino DV permet de faire un montage à partir de vidéos au format DV uniquement
ffmpeg -i video.avi -target pal-dv video.dv
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1333"></script>
It works only on linux.
ffmpeg -i fichiervideo.flv -vn -f mp3 fichierson.mp3
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/576"></script>