TechSpot

Ffmpeg & Php

By Drenholm
Jun 18, 2007
  1. Ho everyone!

    I've found little documentation that'll help me out on that there interweb, so I hope someone here is in the know!

    I'm working on a Youtube type system for a local school, so far everything's going fine, but I want it to automatically convert uploaded video files of various types to flv. Currently I have it set to only allow upload of flv files.

    FFMPEG, a command line video conversion tool seems to be the solution, unless someone can tell me of a better one.
    documentation is here: http://ffmpeg.mplayerhq.hu/
    SVNs are here: http://svn.mplayerhq.hu/ffmpeg/trunk/
    Windows compiled downloads here : http://ffdshow.faireal.net/mirror/ffmpeg/ (this is what I'm using)

    The propram itself works very well, but trying to get it to work on an external server is something quite new to me.

    Here are a couple of brief tutorials I've looked at:
    http://www.onlamp.com/pub/a/php/2007/05/24/creating-mytube-with-flex-and-php.html?page=2
    http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/
    They're brief in that they just provide and explain (to some extent) the code needed but don't talk about files that should be used.

    I get no errors and no results (converted files) so I struggle to figure out where I'm going wrong. That is if it's even possible to do since I'm developing on my University's web space; would it be likely that the server restricts executing programs.

    I believe that the servers are Linux so would I need a different version to the Windows compiled one? I'm not sure if by Windows compiled it means compiled under Windows or specifically FOR Windows.

    Well thanks for reading! Hope someone can help!
     
  2. Mictlantecuhtli

    Mictlantecuhtli TS Evangelist Posts: 4,919   +9

    For a Linux server you'd need Linux binaries of ffmpeg (& PHP).

    You could check if exec() is disabled with a simple PHP script (unless phpinfo() is disabled too):
    <?php phpinfo(); ?>

    If phpinfo() is disabled as well, you can see the same (sort of) output from command line with "php -i".

    It's also possible (but a bit odd, in my opinion) that PHP error logging is disabled completely on that server, so if something fails, you wouldn't see it.

    Also note that servers have a maximum file size for uploading data (in $_POST). The default varies, but the parameters are post_max_size and upload_max_filesize in php.ini.
     
  3. jobeard

    jobeard TS Ambassador Posts: 13,514   +336

    also make sure you understand where the converted files will be placed on the
    server. you make need to relocate them to your desired location before the
    server returns results to the user.
     
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.