Playing mp3 on server

Discussion in 'PHP' started by julius-krebs, Jul 15, 2009.

  1. #1
    Environment
    - Sever: Apache2
    - Language: Php 5
    - OS: Linux 9.04

    Goal
    Playing Mp3 files directly on the sever system, not in browser.

    Hints
    Already tried several players like "vlc", "gstream", "totem", but nothing did work, although the same commands work great in terminal.
    Below you see the output of a gstream call.

    $ sudo gst-launch-0.10 playbin uri=file:'///tmp/beispiel.mp3'
    ERROR: from element /GstPulseSink:audiosink-actual-sink-pulse: Failed to connect: Connection refused
    Additional debug info:
    pulsesink.c(708): gst_pulsesink_open (): /GstPulseSink:audiosink-actual-sink-pulse

    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    ERROR: pipeline doesn't want to preroll.
    Setting pipeline to NULL ...
    FREEING pipeline ...

    (gst-launch-0.10:3369): GStreamer-CRITICAL **:
    Trying to dispose element playbin0, but it is not in the NULL state.
    You need to explicitly set elements to the NULL state before
    dropping the final reference, to allow them to clean up.
     
    julius-krebs, Jul 15, 2009 IP
  2. Sudoku-Master

    Sudoku-Master Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hmm... why you will play the mp3 on the server? Who will hear it in the datacenter?
     
    Sudoku-Master, Jul 16, 2009 IP
  3. julius-krebs

    julius-krebs Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's a light and sound system for theaters on a laptop which works as a web browser and apache server as well.
    At first the mp3 files were played on a flash player in the webbrowser but I exposed that there is a unacceptable delay o starting a play. That's why I am searching for an alternative.
    I did find out that the system players on ubuntu plays without delay and can be controlled by shell commands but I am am also amenable for other solutions.
     
    julius-krebs, Jul 16, 2009 IP
  4. julius-krebs

    julius-krebs Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Do you really don't have an idea to play mp3 files without delay in browser or directly on server?
     
    julius-krebs, Jul 17, 2009 IP
  5. neegeris

    neegeris Banned

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you dont want delay, you need fast,stable internet connection for your server so music players wount need buffer your stream, or you can edit swf player, and turn of buffer, so it will play what will recive, if your server internet will turn off for sec or two, song will stop, but if you will use buffer, what means there will be delay what will give continuously playing even your server internet will turn off for few seconds!
     
    neegeris, Jul 17, 2009 IP
  6. julius-krebs

    julius-krebs Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Do you know a flash whose buffer can disabled without editing the code?
    Server and browser runs on the same system hence the connection doesn't matter.
     
    julius-krebs, Jul 17, 2009 IP
  7. neegeris

    neegeris Banned

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I dont know , but its easy to edit flash files..
     
    neegeris, Jul 17, 2009 IP
  8. julius-krebs

    julius-krebs Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    @ neegeris: Unfortunately not for me.

    The totem media player brings the same error if I start it with via a c++ application. Thats stands to the reason that the problem comes from missing user rights of the "www-data" user of the webserver.

    The error message:
    Cannot open display: Run 'totem --help' to see a full list of available command line options.
     
    julius-krebs, Jul 18, 2009 IP