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.

Silly Question - But Possible or not?

Discussion in 'PHP' started by Tom Thumb, Jan 18, 2009.

  1. #1
    Guys & Gals..

    Am wondering if anyone has any code to generate Movies ( avi,mov,mpeg) on the fly from images & content etc ?

    This is more out of curiousity more than anything...

    Nearly everything is possible with PHP :)

    Cheers!
     
    Tom Thumb, Jan 18, 2009 IP
  2. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #2
    You mean like take a bunch of images and merge them together to make a movie?

    I don't think it's possible in php, atleast not without a 3rd party app playing a role.
     
    bigrollerdave, Jan 18, 2009 IP
  3. Tom Thumb

    Tom Thumb Notable Member

    Messages:
    1,529
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    215
    #3
    Yep.. thats what i was thinking... hmmmmmm
     
    Tom Thumb, Jan 18, 2009 IP
  4. Tom Thumb

    Tom Thumb Notable Member

    Messages:
    1,529
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    215
    #4
    maybe with ffmpeg?
     
    Tom Thumb, Jan 18, 2009 IP
  5. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #5
    I've used ffmpeg quite a few times in the past but never for what you want. I'm not sure if it's possible or not using ffmpeg. I used ffmpeg to convert wmv to flv. I've also used it to pull images from a video and use as a thumbnail.
     
    bigrollerdave, Jan 18, 2009 IP
  6. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I've never used ffmpeg but it's a command line tool which makes me think there's a good possibility of being able to do what you want through PHP, as long as ffmpeg or similar program is installed.
    If it is possible you'll be using one of the program execution functions.
     
    LogicFlux, Jan 18, 2009 IP
  7. Shoro

    Shoro Peon

    Messages:
    143
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #7
    This is possible with ffmpeg, but you have to name the files sequentially (001.jpg, 002.jpg, 003.jpg, etc.) Then you can do it with the following command:

    ffmpeg -r framerate -b bitrate -i %03d.jpg movie.avi

    Of course you can use png, etc. images instead of jpegs, and you can output in formats other than avi.
     
    Shoro, Jan 18, 2009 IP
    Tom Thumb and jesusjonesuk like this.
  8. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #8
    Try mencoder, it can do it.

    
    exec('mencoder "mf://*.jpg" -mf fps=30000/1001 -o test.avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=800');
    
    PHP:
     
    Kaizoku, Jan 19, 2009 IP
    Tom Thumb likes this.
  9. riya_senk

    riya_senk Well-Known Member

    Messages:
    2,014
    Likes Received:
    174
    Best Answers:
    0
    Trophy Points:
    160
    #9
    yes. ffmpeg or mencoder can do that
     
    riya_senk, Jan 19, 2009 IP
  10. Tom Thumb

    Tom Thumb Notable Member

    Messages:
    1,529
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    215
    #10
    Cheers Guys.. will experiment and see :)
     
    Tom Thumb, Jan 19, 2009 IP
  11. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #11
    I hope you're on a dedicated server. If not 99% of the time hosts will not install ffmpeg for you.
     
    bigrollerdave, Jan 20, 2009 IP
  12. Tom Thumb

    Tom Thumb Notable Member

    Messages:
    1,529
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    215
    #12
    Gotya Bigrollerdave..Am looking at dedicated to try this out :)
     
    Tom Thumb, Jan 20, 2009 IP
  13. fatedesign

    fatedesign Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Use mencoder
     
    fatedesign, Jan 20, 2009 IP
  14. Tom Thumb

    Tom Thumb Notable Member

    Messages:
    1,529
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    215
    #14
    Any steps on using mencoder?
     
    Tom Thumb, Jan 22, 2009 IP
  15. t3nt3tion

    t3nt3tion Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Try checking sourceforge or phpclasses for code examples.
     
    t3nt3tion, Jan 22, 2009 IP
  16. Tom Thumb

    Tom Thumb Notable Member

    Messages:
    1,529
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    215
    #16
    thanks dude!
     
    Tom Thumb, Jan 22, 2009 IP
  17. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #17
    You need to install mencoder on your server first, would require atleast a VPS or dedicated server.

    Hop on to your shell, then issue the following commands, which ever works for your distribution.

    sudo apt-get update && sudo apt-get install mencoder
    apt-get update && apt-get install mencoder
    yum update && yum install mencoder
    rpm -i mencoder
    pacman -Sy mencoder

    A complete mencoder manual can be found at http://linux.die.net/man/1/mencoder

    You can then use mencoder via exec(); from php.
     
    Kaizoku, Jan 22, 2009 IP
  18. Tom Thumb

    Tom Thumb Notable Member

    Messages:
    1,529
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    215
    #18
    Hey Kaizoku! Thanks dude :) You the man :)
     
    Tom Thumb, Jan 23, 2009 IP