Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    How to use ffmpeg if libmp3lame support is not present

    12th April 2008

    I’m providing regularly updated compiled linux and freebsd ffmpeg binaries, and also described how to use ffmpeg on shared hostings if not all the required libraries (like libmp3lame) are present. However, the solution recommended might not “fit all”, so here is another one – simpler and even more portable/universal than setting LD_LIBRARY_PATH.
    Read the rest of this entry »

    Share

    Posted in Software | 4 Comments »

    Instructions on installing libmp3lame-enabled ffmpeg on shared linux hosting

    12th March 2008

    Note: this post is based on the comment by Simon, who generously shared his experience.

    Step-by-step:

    • Download the compiled ffmpeg with libmp3lame support (direct download links: older version ffmpeg.with.lame and newer version ffmpeg.2007-10-28.with-libmp3lame-support).
    • Rename the downloaded executable file to “ffmpeg” (no extension), upload it to the directory on your server (in this example /home/myusername/).
    • Download libmp3lame.so.0.
    • Upload libmp3lame.so.0 to the same directory where you placed ffmpeg in.
    • Create a php file with the following code (remember to change the paths to your own, where you actually uploaded binaries in previous steps):
      1. <?php
      2. exec("export LD_LIBRARY_PATH=/home/myusername/");
      3. echo passthru("/home/myusername/ffmpeg -formats");
      4. ?>
    • If you access that PHP file with your browser, you should be able to see a list of formats which are supported by ffmpeg, and if you find “EA libmp3lame” somewhere in the output, then it means you now can Encode Audio in libmp3lame!
    • If that doesn’t work for you: LD_LIBRARY_PATH can be a protected variable in PHP (you can check for this by searching for the “safe_mode_protected_env_vars” value in phpinfo() output). The workaround here can be to write your commands to a file from php, then chmod that file with 0755 permissions (rwx-rx-rx), and run the file through exec(). In this way, PHP is not changing the LD_LIBRARY_PATH, but telling the server to run a file, which tells the server to change it. This method worked for the original author of these instructions.

    For passing arguments to the PHP wrapper script – check out PHP’s $argv variable (more on this here). If you decided to use shell-script as a wrapper for “export LD_LIBRARY_PATH”, then using $1, $2 etc will allow you to pass parameters to the shell script, e.g. in the example below

    1. #!/bin/bash
    2. export LD_LIBRARY_PATH=/home/myusername/
    3. /home/myusername/ffmpeg -i /home/myusername/$1 $2 /home/myusername/$3

    you could pass “input file” as first argument, “parameters” as second and “output file” as third to make such a wrapper script work.

    Share

    Posted in *nix, PHP, Programming, Software, Web | 19 Comments »

    Using libmp3lame-enabled ffmpeg on shared hosting

    25th October 2007

    Update: there’s now a much more recent post on how to install libmp3lame-enabled ffmpeg on shared linux hosting.

    As Gabe pointed out in my post with compiled ffmpeg Linux binaries, there is a relatively simple method of adding libmp3lame.so.0 file to your shared hosting so that ffmpeg executable will see the library:

    You can upload libmp4lame.so as well to the shared hosting site and when you call ffmpeg, call something to set an environment variable right before the call to ffmpeg i.e. in php I’d do exec(”export LD_LIBRARY_PATH=/path/to/lib/with/lame; /path/to/ffmpeg [ffmpegargs]”); That way you can use the uploaded lame. I hope that helps someone as I have been unable to find any info on how to use an uploaded lame. I’ve tried it and it works on godaddy.

    Hope this helps.

    Update: here’s libmp3lame.so.0.0.0 (from slackware 2.4.x, lame-3.97). I have no idea if it’ll work in your (shared hosting) environment; it is provided AS IS, use at your own risk etc. I can only state that the archived binary file at the moment of upload was indeed libmp3lame.so.0.0.0 from my elderly Slackware with 2.4.x kernel.

    Share

    Posted in *nix, Software, Web | 9 Comments »

    Compiled linux ffmpeg binary for Gallery2: download

    28th June 2007

    Updated on Apr 8, 2008.

    Stimulated by the post of Eric Daniel (who used to have a blog at termitenshort.com), I compiled the most recent ffmpeg SVN source into Linux binary, which runs fine on my shared hosting (note: I’m using older ffmpeg binaries, which are at the end of the post).

    mini-FAQ:
    Q: Why the title has “for Gallery2″?
    A: Just because I avoided the inclusion of libraries, which were not found on my shared hosting server. I hope this will work for other shared hosting environments.

    Configuration, version and date can be found in the output of ffmpeg.

    Versions built on April, 8, 2008:
    ffmpeg (no lame) (checked: can be executed on godaddy shared hosting)

    FFmpeg version SVN-r12769, Copyright (c) 2000-2008 Fabrice Bellard, et al.
    configuration: –enable-gpl –enable-postproc –enable-swscale –enable-pthreads –disable-debug –enable-gray –disable-ffserver –disable-ffplay –enable-avfilter –disable-network –disable-ipv6
    libavutil version: 49.6.0
    libavcodec version: 51.54.0
    libavformat version: 52.13.0
    libavdevice version: 52.0.0
    libavfilter version: 0.0.0
    built on Apr 8 2008 15:13:14, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
    usage: ffmpeg [[infile options] -i infile]… {[outfile options] outfile}…

    ffmpeg (with lame). For this one, grab libmp3lame.so.

    FFmpeg version SVN-r12769, Copyright (c) 2000-2008 Fabrice Bellard, et al.
    configuration: –enable-gpl –enable-postproc –enable-swscale –enable-pthreads –disable-debug –enable-gray –disable-ffserver –disable-ffplay –enable-avfilter –disable-network –disable-ipv6 –enable-libmp3lame
    libavutil version: 49.6.0
    libavcodec version: 51.54.0
    libavformat version: 52.13.0
    libavdevice version: 52.0.0
    libavfilter version: 0.0.0
    built on Apr 8 2008 15:44:31, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

    Based on single request: ffmpeg (with lame and libfaac and libfaad). For this one, grab libfaac.so and libfaad.so.

    FFmpeg version SVN-r12769, Copyright (c) 2000-2008 Fabrice Bellard, et al.
    configuration: –enable-gpl –enable-postproc –enable-swscale –enable-pthreads –disable-debug –enable-gray –disable-ffserver –disable-ffplay –enable-avfilter –disable-network –disable-ipv6 –enable-libmp3lame –enable-libfaac –enable-libfaad
    libavutil version: 49.6.0
    libavcodec version: 51.54.0
    libavformat version: 52.13.0
    libavdevice version: 52.0.0
    libavfilter version: 0.0.0
    built on Apr 8 2008 23:53:57, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

    As an experiment, here’s ffmpeg freebsd binary without lame support. Did ran on some FreeBSD 6.3 hosting.

    FFmpeg version SVN-r12769, Copyright (c) 2000-2008 Fabrice Bellard, et al.
    configuration: –enable-gpl –enable-postproc –enable-swscale –enable-pthreads –disable-debug –enable-gray –disable-ffserver –disable-ffplay –enable-avfilter –disable-network –disable-ipv6 –target-os=freebsd
    libavutil version: 49.6.0
    libavcodec version: 51.54.0
    libavformat version: 52.13.0
    libavdevice version: 52.0.0
    libavfilter version: 0.0.0
    built on Apr 8 2008 16:15:38, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

    Versions built on Ocotber, 28, 2007:
    download ffmpeg without libmp3lame support

    FFmpeg version SVN-r10867, Copyright (c) 2000-2007 Fabrice Bellard, et al.
    configuration: –enable-gpl –enable-pp –enable-swscaler –enable-pthreads

    –enable-libogg –enable-libvorbis –disable-debug
    libavutil version: 49.5.0
    libavcodec version: 51.47.1
    libavformat version: 51.17.0
    built on Oct 28 2007 22:46:10, gcc: 3.4.6

    download ffmpeg with libmp3lame support

    FFmpeg version SVN-r10867, Copyright (c) 2000-2007 Fabrice Bellard, et al.
    configuration: –enable-gpl –enable-pp –enable-swscaler –enable-libmp3lame

    –enable-pthreads –enable-libogg –enable-libvorbis –disable-debug
    libavutil version: 49.5.0
    libavcodec version: 51.47.1
    libavformat version: 51.17.0
    built on Oct 28 2007 23:04:59, gcc: 3.4.6

    Shared hosting testing reports are welcome.

    Below you can find even older versions of ffmpeg, which were tested and found functional on GoDaddy shared hosting.
    Read the rest of this entry »

    Share

    Posted in *nix, CMS, Software, Web | 49 Comments »