Is there any way to pull out thumb from megavideo video?

Discussion in 'Programming' started by chaoscript, Dec 23, 2010.

  1. #1
    Hi,
    I want to know,
    If I have this video, for example,
    http://www.megavideo.com/?v=1T2A5YA0

    How I can pull out thumb of the video?

    *Mods, I hope that this is the best forum for this question.

    Regards.
     
    chaoscript, Dec 23, 2010 IP
  2. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #2
    What video format?
    if your server has ffmpeg installed you could use a command such as the following
    ffmpeg -i test.avi -ss 1.4 -vframes 33 -f image2 output%2d.jpg

    
    <?php
    $video = "/var/www/movies/myvideo.avi";
    $output_images = "/var/www/movies/thumbnails/myvideo%2d_thumb.jpg"
    $output = shell_exec("ffmpeg -i ".$video." -ss 1.4 -vframes 33 -f ".$output_images");
    $thumbnails = shell_exec("ls /var/www/movies/thumbnails/myvideo*");
    $thumbs = explode('\n',$thumbnails);
    foreach($thumbs as $image){
    echo "<img src=\"/movies/thumbnails/".trim($image)."\" alt=\"myvideo\"><br />\n";
    }
    ?>
    
    Code (markup):
    more on ffmpeg:
    http://www.hiteshagrawal.com/ffmpeg/extract-image-from-video-using-ffmpeg
     
    shofstetter, Dec 23, 2010 IP