• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How to publish HLS Streams for existing Application

Explorer ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

Dear Adobe Community,

I am currently working on a dynamic webstream application where multiple person can start their own streams. They are connecting to our custom AMS Application (lets say "camchat").

Now I want to publish mobile ready streams as well for each stream. I got this to work while Streaming over the FMLE directly to the "livepkgr" Application but not to my own "camchat".

What I am not sure about is, in what way do I have to make my custom application ("camchat") publish HLS ready streams as well?

Is that possible or do I always have to use the default "livepkgr" application? If so, what is necessary to combine my application to provide streams over the livepkgr application.

I hope you got my point.

Thanks in advance,

Patrick

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , May 19, 2015 May 19, 2015

So finally I got it to work by myself but I want to spread the "solution" because as I mentioned there are not many topics regarding this special needs. So maybe it will help anybody else:

1.  My main.asc was actually correct:

  1. application.onPublish = function (client, streamObj)
  2. {
  3.     //var s = Stream.get("f4f:" + streamObj.name)
  4.     var s = Stream.get(streamObj.name)
  5.     if(client.id == 221){
  6.         application.mobilenc = new NetConnection();
  7.         application.mobilenc.connect( "rtmp://xxxxxxxxx/liv
...

Votes

Translate

Translate
Community Expert ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

Hi, pleqtron.

I've done this by editing httpd.conf to add a mapping to the particular application storage:

<Location /hls-custom>

    HLSHttpStreamingEnabled true

    HLSMediaFileDuration 8000

    HttpStreamingContentPath "//windows.share.name/path"

    HLSFmsDirPath ".."

    Options -Indexes FollowSymLinks

</Location>

In my case, it is tapping into old files we serve over both RTMP and now, HLS if need be. Points to the streams directory in the app, basically.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

Hi Joseph,

tanks for your quick response!

Okay, so that would be a configuration for a storage location. But does the AMS then automatically create HLS Parts to provide to iOS Users? Or do I have to do anything on my application side as well.

Currently I am not doing anything than connecting to the application (No recording of the stream or whatever).

As far as I can see on the server, some chunk files were created as soon as I connect to my and the livepkgr Application as well. But not seeing any data if I enter the URL (which is valid and gives me a positive response).

This is my main.asc (camchat Application):

  1. application.onPublish = function (client, streamObj)
  2. {
  3.     //var s = Stream.get("f4f:" + streamObj.name)
  4.     var s = Stream.get(streamObj.name)
  5.     if(client.id == 221){
  6.         application.mobilenc = new NetConnection();
  7.         application.mobilenc.connect( "rtmp://xxxxxxxxx/livepkgr/" );
  8.         application.mobilenc.onStatus = function(info) {
  9.           trace(info.code+"   livepkgr");
  10.           if(info.code == "NetConnection.Connect.Success"){
  11.               application.mobilens = new NetStream(application.mobilenc);
  12.               application.mobilens.setBufferTime(3);
  13.               application.mobilens.attach(streamObj);
  14.               application.mobilens.publish("livestream2?adbe-live-event=myliveevent","live");
  15.           }
  16.         }
  17.     }
  18. }

So if a User connects to a Webcam Session, and the Stream is published, I do a second connect to the livepkgr Application. As I said, I can see traces on the livepkgr Application side. Same as when connecting directly over Flash Media Live Encoder to this application.

Here is the trace when Connecting over the camchat -> main.asc (see above code snippet):

  1. Stream name is: livestream2 and live event is: myliveevent
  2. f4f:livestream2 - NetStream.Record.Stop
  3. f4f:livestream2 - NetStream.Play.Stop
  4. f4f:livestream2 - NetStream.Unpublish.Success
  5. f4f:livestream2 - NetStream.Data.Start
  6. f4f:livestream2 - NetStream.Play.Reset
  7. f4f:livestream2 - NetStream.Publish.Start
  8. f4f:livestream2 - NetStream.Record.Start


Trace when connecting directly over FMLE (withour camchat Application):

  1. onPublish : livestream1
  2. Stream name is: livestream1 and live event is: myliveevent
  3. f4f:livestream1 - NetStream.Publish.Start
  4. f4f:livestream1 - NetStream.Play.Reset
  5. f4f:livestream1 - NetStream.Data.Start
  6. f4f:livestream1 - NetStream.Record.Start


I am quite confused because I can not find any documentation for that special need.


Thanks in advance!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

Oh, I thought you were just streaming VOD over HLS. If doing a webcam chat app or something you will need to stick with RTMP. If doing a live non-interactive video stream - you just use livepkg app on the AMS side.

What URL are you using to access the live HLS stream?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

I use this URL: http://xxxxx/hls-live/livepkgr/_definst_/myliveevent/livestream[1-2].m3u8

As I said: When connecting directly with the Media Live Encoder, it works (here I always use livestream1).

adobe1.png

adobe2.png

I´ve tested the publishing about 10 Minutes - it´s fine!

But when I connect over the main.asc (see code above) of my custom application, I do not get the livestream, just the Player (so Url is fine).

adobe3.png

On Server side both connections seems to be okay (for my point of view):

adobe4.png

Best,

Patrick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

Here is how we configure things for live events:

in Adobe Media Live Encoder:

URL: rtmp://server.url/livepkgr

Stream: {uniquename}?adbe-live-event=liveevent

In playback:

http://server.url/hls-live/livepkgr/_definst_/liveevent/livestream.m3u8

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

In our case we are not using custom events - too complicated for our workflow. That may be the piece that is not configured 100% in your case - possibly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

Yeah thats fine! But let me explain my needs again, I think we are talking about different things. My goal: Use my existing AMS Application (with custom main.asc etc) to provide Webstreams as we currently do, but additionally make them for mobile devices available, which means, we have to go to HLS support. I am not sure if we have to setup all of our Webcam-Applikation directly on the livepkgr Applikation because of its feature to provide such HLS files. It would be best for us, if we just connect to livepkgr additionally to provide these streams (not only to livepkgr!). So the URL´s for the HLS are definitly fine, because when testing with a single direct connection to the livepkgr Application it works. I just do not get it to work when connecting over my custom main.asc of the Camchat Application itself. Your URL just differ because of the other eventname i guess. So finally my problem is not the correct url - it´s more about how to make my custom application provide HLS streams (by itself, or over the second connection to the livepkgr Application)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 19, 2015 May 19, 2015

Copy link to clipboard

Copied

LATEST

So finally I got it to work by myself but I want to spread the "solution" because as I mentioned there are not many topics regarding this special needs. So maybe it will help anybody else:

1.  My main.asc was actually correct:

  1. application.onPublish = function (client, streamObj)
  2. {
  3.     //var s = Stream.get("f4f:" + streamObj.name)
  4.     var s = Stream.get(streamObj.name)
  5.     if(client.id == 221){
  6.         application.mobilenc = new NetConnection();
  7.         application.mobilenc.connect( "rtmp://xxxxxxxxx/livepkgr/" );
  8.         application.mobilenc.onStatus = function(info) {
  9.           trace(info.code+"   livepkgr");
  10.           if(info.code == "NetConnection.Connect.Success"){
  11.               application.mobilens = new NetStream(application.mobilenc);
  12.               application.mobilens.setBufferTime(3);
  13.               application.mobilens.attach(streamObj);
  14.               application.mobilens.publish("livestream2?adbe-live-event=myliveevent","live");
  15.           }
  16.         }
  17.     }
  18. }

2. On Serverside I had to remove my previous generated Liveevent folders. However after deleting these contents, the stream worked as expected.

3. I think the problem was, that my custom application does not take care about canceling the livepkgr liveevent as it should be. So I will go ahead and do some clean ups and take care about the correct unpublishing.

4. Also I have to implement a way to provide unique stream names - maybe this will help out aswell instead of using the same eventname all the time while testing. Never the less, thanks to Joseph for your help!

Best, patrick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines