Skip to main content
Participant
March 10, 2009
Question

FMS FLV audio to mp3

  • March 10, 2009
  • 3 replies
  • 4951 views
THE PROBLEM:

I am using the NetStream class with FMS to record the audio stream from the client's microphone to the FMS server.

So far so good, the stream gets saved to the server as a .flv file. A php script grabs this file via ftp and copies it to the user's file store.

What we need now is to either record the stream directly as .mp3 OR convert the recorded .flv to a .mp3 file - and this is where it gets interesting.

POSSIBLE SOLUTION 1 (preferred solution), Recording stream directly as .mp3:
Please refer to Actionscipt Reference for Flash CS4:
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/
ns.publish("mp3:mymp3stream");
Under class 'NetStream', method 'publish you will see the above.

The documentation suggests that it should be possible to directly record the audio stream as a .mp3 file. NOTE: this is with the new version, Flash CS4.

I have tried this with both an Influxis account and with FMS 3.5 dev on my local machine. Both return this error:

Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Publish.BadName

When I publish and record just as .flv it all works fine on both servers.

So the question here is: Is this a mistake in the documentation, is this a bug in the software (Flash), a problem with FMS or is this a rights issue that has not been resolved?


POSSIBLE SOLUTION 2, Convert the .flv to .mp3 after recording:
I can convert the .flv to .mp3 on the windows version of FMS running on my local machine using the command line ffmpeg.exe.

Ffmpeg does not appear to work converting .flv to .mp3 on a Debian version of Linux, and this is where we need to get it working.

Previously there was an opensource project called 'nelly2pcm', which has recently been withdrawn due to legal reasons. Nellymoser is the codec used by FMS to record the stream. In Flash CS4 there is also the option of using the SPEEX codec (however this too does not work with ffmpeg).

I expect the problems with these 2 potential solutions may be related. I have read certain posts suggesting there is dubious legality to some of the conversion utilities available to convert FMS recorded .flvs to .mp3.

Any suggestions or confirmations of the status of these issues would be much appreciated.

There are quite a few posts suggesting that using ffmpeg on a linux machine should work, but I am concerned that if there are legal problems with this we may be wasting our time.
    This topic has been closed for replies.

    3 replies

    Daniel34Author
    Participant
    March 12, 2009
    Thanks for the clarification.
    I have managed to publish as mp4 on FMS 3.5.1.
    I have been trying to use ffmpeg on Debain linux server to convert the mp4 to mp3, . Do you have any suggestions of other utilities that may be able to convert to mp3? Open source or licenced.

    I am using this syntax:
    ffmpeg -i hello.mp4 hello.wav
    which returns the following error:
    Unsupported codec for output stream #0.0

    I really need to get the sounds back into my game at runtime to load them into a 'Sound' class object, so the user can manipulate them on a timeline.

    Daniel

    March 11, 2009
    SE_0208 is correct, FMS can't record MP3 files. It can record only FLV and F4V files. You can publish an MP3 file and stream it live, but you can't record in MP3 format. I'll clarify the docs, apologies.

    Jody
    Participant
    June 19, 2009

    Hi, the clarification definitely makes our life easier. However, I am wondering if FMS is ever going to support saving in mp3 codec. I really need this because we are trying to stream the live audio to FL3 mobile app, and it occurs to me that FL3 only support mp3 codec. This make things extremely difficult. I have spend lots of time digging this. So is there a workaround, or lookout for the feature addup? I am also wondering how does Flash Media live encoder accommodates this situation, since I found the .flv file made by FME can be played by FL3 on the simulator. Thanks in advantance.

    Participating Frequently
    March 11, 2009
    Hi Daniel,

    I suppose its just a documentation error. There is no way you can record directly in mp3 format neither there is indirect way of doing it. I think documentation just needs to be corrected. There is only two ways you can publish, one is flv publish i.e. ns.publish("mymp3stream");and one is mp4 publish i.e. ns.publish("mp4:mymp3stream"); unluckily for you there is no such thing ns.publish("mp3:mymp3stream"); - its simply not supported.

    If you publishing and recording using Flash Player, you will publishing with nellymoser or speex. I know nellymoser is closed format and I doubt whether there is any tool to decode it. Speex is open standard and i think you can probably write you own tool if you have time.

    There is another way of recording which might serve little easier for you. You can use FMLE to publish using "mp3" as codec and record it using server-side record at FMS end. Now you can either use default flv format or choose to record in mp4 format. Now both flv and f4v format specifications are open standard and are avalilable at http://www.adobe.com/devnet/flv/pdf/video_file_format_spec_v10.pdf. Using this you can build your own tool to extract audio data from it or probably you can use existing tools which might serve the purpose. If i get time i will try using one of tools you specify and see whether it works.

    Hope information provided above helps.