Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent 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

    9 Responses to “Using libmp3lame-enabled ffmpeg on shared hosting”

    1. tyler Says:

      anyone can guide me on how to install lame on a shared host?
      i do not have root or ssh access.

      i managed to get the older compiled of ffmpeg without lame to work on godaddy

      now trying to get it working with lame
      thank you

    2. nixan Says:

      i too have the same problem,.
      libmp3lame.so file is not get loaded.
      i am also working in a shared hosting envirnment.
      i copied ffmpeg with libmp3lame support and i am getting the error libmp3lame.so is not available.
      is there any way to get audio for ffmpeg with libmp3lame support

    3. nixan Says:

      can u please provide a link that shows a precompiled ffmpeg with lame support urgent please.

    4. Bogdan Says:

      Nixan,
      both the link and one of the solutions are in the post text.

    5. Simon Says:

      i can get ffmpeg to work, but there’s abosolutely no sound on any movies! Tyler, or anyone else, if you made the libmp3lame.so workaround work, please post links to the files you used, which were working!

    6. Bogdan Says:

      I updated the post with the binary of libmp3lame.so which I have on the system, where I compiled those ffmpeg’s I offer for download.

    7. Simon Says:

      Thanks so much for posting this! I spent something like 20 hours during the last 4 days to get ffmpeg working smoothly on my shared server. And this place seems to be the only place on the internet, which addressed the problem I was dealing with.

      So basically what I did:

      * Download the compiled ffmpeg with libmp3lame on this blog (called ffmpeg.with.lame, ffmpeg.with.lame)
      * Rename the file to “ffmpeg” (no extension) and upload to a directory on your server, in my example /home/myusername/

      * Download the libmp3lame.so.0.0.0 on this blog (libmp3lameso00.rar) and unrar.

      * Rename the unarchived file to libmp3lame.so.0 and upload to the same directory as you placed ffmpeg in

      * Create a php file with the following code (remember to change the paths to where you uploaded):
      exec(“export LD_LIBRARY_PATH=/home/myusername/”);
      echo passthru(“/home/myusername/ffmpeg -formats”)

      Now you should see a list of formats that ffmpeg supports, and if you find “EA libmp3lame” somewhere in the output, it means you can now Encode Audio in libmp3lame! But it didn’t work for me: In my case, the LD_LIBRARY_PATH is a protected variable in PHP (you can check for this by searching for the “safe_mode_protected_env_vars” value in phpinfo). The workaround here can be to write your commands to a file from php, chmod the file to 0775, 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. Weird, huh, but it works at least on my server. Now, good luck!

    8. Bogdan Says:

      Simon,

      thanks for sharing this information! (I edited slightly your comment to fix the direct download links)

      If you do not mind, I’ll write “Instructions on installing libmp3lame-enabled ffmpeg on shared linux hosting” (mostly citing you), which will link back to your comment as original source.

      Also, I’ll provide properly named and already unarchived binaries to simplify the instructions.

      Thanks again!

    9. Instructions on installing libmp3lame-enabled ffmpeg on shared linux hosting » Autarchy of the Private Cave Says:

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

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>