I'm trying to extract some frames from a video with ffmpeg when the video file is selected (not submittet) so i can create a video thumbnail preview. All i could come up with was this php version, but i'd like the preview to be live, so it needs to be a javascript function. For a js noob, how do i make javascript do the same as this php?
<input type="file" name="video" onchange="JSfunction-that-extracts-video-frames();"/>
<?php
$ffmpeg = "/usr/local/bin/ffmpeg";
$size = "320x180";
$videoFile = $_FILES['file']['tmp_name'];
for($num = 1; $num <= 15; $num++)
{
$interval = $num * 3;
shell_exec("$ffmpeg -i $videoFile -an -ss $interval -s $size videos/$num.png");
}
?>