Skip to main content
Participant
November 6, 2012
Question

Steps to Publish Live Audio for HTTP Streaming

  • November 6, 2012
  • 1 reply
  • 1412 views

I wanted to confirm some steps in order to stream Live Audio from FMS to a mobile device using HTTP Streaming and HTML 5 audio/video tags.  I have a system setup like below:

Lets say my application which recieves the live audio is called CLASSROOM.

Lets say my application instance is called "TEST"

So I have application code like:

In "onAppStart()"

this.broadcast_live_stream = Stream.get("f4f:livestream");

this.broadcast_live_stream.liveEvent = "TEST";

this.broadcast_live_stream.record("record");

To play the incoming audio:

application.broadcast_live_stream.play(streamName); // name of the stream sending audio to the server

Thus, I have a folder:

Flash Media Server 4.5\applications\CLASSROOM\streams\TEST\livestream

which contains a bootstrap, control, meta, f4f, and f4x files.

Since I specified the Event name as "TEST", I also created the folder:

Flash Media Server 4.5\applications\livepkgr\events\_definst_\TEST

Which contains event.xml:

<Event>

<EventID>TEST</EventID>
- <Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>400000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration>

</Recording>

</Event>

and manifest.xml:

<manifest xmlns="http://ns.adobe.com/f4m/1.0">

<media streamId="livestream" bitrate="100" />

</manifest>

Should I then be able to create a video tag and hear the live audio:

<video id='slide1' controls='controls'><source src='http://fms-dns/hls-live/livepkgr/_definst_/Test/livestream.m3u8'></video>

I am not sure what other steps are needed, or a good way to test.  I don't understand how the Live Media Encoder would be needed in this situation.

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    November 6, 2012

    You need to add the recording logic under onPublish. The URI used in the video tag will work for Audio only playback as well.

    You can refer livepkgr application which does the recording in f4f format. I used the livepkgr and tried to playback a audio only stream using the above mentioned video tag. It played back the audio.

    Participant
    November 6, 2012

    So I implemented the above change, using code from the livepkgr.

    My custom application is called Unity3, and the instance is Test, and I am trying to  publish to an event called "Test".

    I now have:

    applications\Unity3\streams\Test\livestream

    Which contains segment files, which update when I send audio in my application.

    I have:

    C:\Program Files\Adobe\Flash Media Server 4.5\applications\Unity3\events\Test\Test

    Which contains my event.xml (EventId Test), manifest.xml (StreamId livestream).  I also have a ".stream" file in this folder.  The contents of which are:

    <?xml version="1.0" encoding="UTF-8"?>

    <stream xmlns="http://ns.adobe.com/liveevent/1.0">

    <type>

    f4f

    </type>

    <name>

    livestream

    </name>

    <path>

    C:\Program Files\Adobe\Flash Media Server 4.5\applications\Unity3\streams\Test\livestream

    </path>

    </stream>

    So everything there seems to be good.  I try to use:

    <video id='live' controls='controls'><source src='http://[fms-dns]/hls-live/Unity3/Test/Test/livestream.m3u8'></video>

    or

    <audio id='live' controls='controls'><source src='http://[fms-dns]/hls-live/Unity3/Test/Test/livestream.m3u8'></audio>

    I don't hear audio, the controls don't seem to respond as though they recognize a source.  Are there certain browsers which can be confirmed work?  Any other mistakes stand out?

    Thanks.

    Participating Frequently
    November 7, 2012

    Can you please let me know what audio codec are you using to publish? Also can you please check if <FMS-Install>/Apache2.2/logs/error_log has any erorrs.