SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Video conversion using PHP

    Hello All
    I'm trying to convert video files to .flv files, i.e. flash video. My users would be uploading any video to the server, for example .wmv, .rm, .qt, .mpeg, .mpg, .mp4 etc. All these video formats should be automaticvally converted to .flv file using php. So far I've discovered only one tool and it is - FFMPEG. It seems that this is the only tool that could be used for LAMP. But somehow it is only converting a very very few video formats for me (surprisingly it is even missing out .wmv).

    My next problem is I'm not being able to generate screen shots out of my videos. Could any one please help me so that I may use FFMPEG to get screenshots from my videos, or any other tool on LINUX which does the same. I'm stuck with this for the last 3 days and urgently need a solution.
    If somebody has done this before, please please help me out.
    Thanks a lot in advance.

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, welcome to the forums!

    IIRC ffmpeg is perfectly able to decode wmv (you can also try renaming to asf). Encoding to wmv is "strongly discouraged" for legal reasons (see ffmpeg faq).

    To extract a still image from the video just "wind" it to the desired position (-ss) and convert to jpeg:
    Code:
    ffmpeg -i video.mpeg -ss 10 -t 1 -f mjpeg screenshot.jpg

  3. #3
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot buddy, it worked for me flawlessly. Thanks again.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •