1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Create Thumb of video in php

Discussion in 'PHP' started by Kewal, Oct 6, 2014.

  1. #1
    Hello Friends,

    I need Help to upload video and create a thumb image of that video like youtube using php.

    Thank
     
    Kewal, Oct 6, 2014 IP
  2. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #2
    You could use something like ffmpeg-php which needs to be installed on the server you are using. You could then use that to generate the thumbnail, here is a relevant question that seems to be answered along with an example on how to do that http://stackoverflow.com/questions/3911797/ffmpeg-php-to-create-thumbnail-of-video

    php alone wont let you do this, you will need something on the server to help you. I assume most shared hosts would not support this.
     
    Anveto, Oct 6, 2014 IP
  3. Kewal

    Kewal Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #3
    Can you tell me how i can install ffmpeg on my server.
     
    Kewal, Oct 6, 2014 IP
  4. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #4
    Last edited: Oct 6, 2014
    Anveto, Oct 6, 2014 IP
  5. nitsanbn

    nitsanbn Active Member

    Messages:
    382
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #5
    There is no simple way to do it using only PHP. you should use an external tool for shrinking the video resolution.
    Such a tool may be ffmpeg/mencoder/avconv. On Ubuntu you can use apt-get * to install packages, on CentOS you can use yum install *

    You should run the tool carefully using PHP since any system() / exec() calls may lead to a security issues.
    Use google and lookup the mentioned tools. Good luck!
     
    nitsanbn, Oct 6, 2014 IP
  6. xhtmlchamps

    xhtmlchamps Active Member

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    53
    #6
    Hi,

    Creating thumbnails for a video with php is a bit easy task, can you please go through this link.
    A better understandable explanation is here http://code.tutsplus.com/articles/how-to-dynamically-create-thumbnails--net-1818
     
    xhtmlchamps, Oct 10, 2014 IP
  7. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #7
    Anveto, Oct 11, 2014 IP