Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: application creation

  1. #1

    Default application creation

    Hi richard,

    I have a module in C to handle wowza application creation, configuration for live streaming and deletion after encoder finishes its job. This works perfectly fine in sync with my encoder. I have written a VHostListener module (JAVA) which will publish stream dynamically. My question is, wowza is not starting the application until first client request is received. Can you give the code to start the application as soon as 'myApp' folder gets created inside '<install_dir>/application'

    regards
    Jason

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Jason,

    You could adapt the method used in this ServerListener:
    http://www.wowza.com/forums/content....IServerNotify)

    Richard

  3. #3

    Default

    Hi Richard,

    Thank you for the reply. I want to be notified when an folder gets created inside '<install_dir>/application' directory? How can I do this?

    regards
    Jason

  4. #4

    Default

    Hi Richard,

    How this stream manager creates application as soon as folder gets created inside <wowza_dir>/application folder?

    regards
    Jason.

  5. #5
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Jason,

    You can use IApplicationInstanceNotify. Take a look at this post:

    http://www.wowza.com/forums/showthre...mediacasters#6

    Richard

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Sorry, that won't work for you. You need IApplicationNotify.

    Take a look at this example. It is writtne to drop in a ServerListener but can be adapted for application module:
    http://www.wowza.com/forums/showthread.php?22925#4

    Richard

  7. #7

    Default

    Richard,

    Help me to understand these call backs. If I add " vhost.addApplicationListener(new ApplicationNotifier()); " line in my java module. onApplicationCreate() will be called whenever an application gets created. am I right? But who will create this application?

    This is my listener module code:

    package com.rst.live.publish;

    import com.wowza.wms.amf.*;
    import com.wowza.wms.client.*;
    import com.wowza.wms.request.*;
    import com.wowza.wms.stream.publish.Publisher;
    import com.wowza.wms.stream.publish.PublishingProviderBase;
    import com.wowza.wms.vhost.*;
    import com.wowza.wms.application.*;
    import com.wowza.wms.logging.*;
    import com.wowza.wms.mediacaster.MediaCasterStreamManager;
    import com.wowza.wms.mediacaster.MediaCasterStreamMap;

    import com.wowza.wms.http.streammanager.HTTPStreamManager;

    public class AppMonitor implements IVHostNotify
    {
    class AppListener implements IApplicationNotify
    {

    public void onApplicationCreate(IApplication application)
    {
    WMSLoggerFactory.getLogger(AppListener.class).info("onApplicationCreate: "+application.getName());
    IApplicationInstance pixfix_instance = application.getAppInstance("_definst_");
    String livetream = "mp4:"+application.getName() +"_0";

    MediaCasterStreamMap mediaCasterMap = pixfix_instance.getMediaCasterStreams();

    MediaCasterStreamManager manager = new MediaCasterStreamManager(mediaCasterMap);

    manager.startStream(application.getName()+"_0.stream", "rtp");
    manager.startStream(application.getName()+"_1.stream", "rtp");
    manager.startStream(application.getName()+"_2.stream", "rtp");
    }

    public void onApplicationDestroy(IApplication application)
    {
    WMSLoggerFactory.getLogger(AppListener.class).info("onApplicationDestroy: "+application.getName());
    }

    }

    public void onVHostClientConnect(IVHost vhost, IClient inClient, RequestFunction function, AMFDataList params)
    {
    WMSLoggerFactory.getLogger(AppMonitor.class).info("onVHostClientConnect: "+vhost.getName());
    }

    public void onVHostCreate(IVHost vhost)
    {
    WMSLoggerFactory.getLogger(AppMonitor.class).info("onVHostCreate: "+vhost.getName());
    }

    public void onVHostShutdownStart(IVHost vhost)
    {
    WMSLoggerFactory.getLogger(AppMonitor.class).info("onVHostShutdownStart: "+vhost.getName());
    }

    public void onVHostShutdownComplete(IVHost vhost)
    {
    WMSLoggerFactory.getLogger(AppMonitor.class).info("onVHostShutdownComplete: "+vhost.getName());
    }

    public void onVHostInit(IVHost vhost)
    {
    WMSLoggerFactory.getLogger(AppMonitor.class).info("onVHostInit: "+vhost.getName());
    vhost.addApplicationListener(new AppListener());
    }

    }
    I have included this AppMonitor in Server.xml under <VHostListeners> tag and inside Application.xml under <Module> tag. And the problem here is, onApplicationCreate gets invoked only when I request for streaming from a client. Then the packatization starts happening. Whats the problem here.?


    regards
    Jason

  8. #8
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Again, you can adapt this method to start and lock an application without a client

    http://www.wowza.com/forums/content....IServerNotify)

    Please try to consolidate your forum posts.

    Richard

  9. #9

    Default

    Richard ,

    Help me to understand the following case.

    1. Wowza is running 24/7 on my machine. And already 5 applications are streaming different videos to multiple clients.
    2. Now I want to start one more ABR stream. For that I manually create necessary folders and configure the application for live streaming.


    So when will be this newly created application get loaded and starts the packetization?

    regards
    Jason.

  10. #10
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Jason,

    The new application will start packetizing when it gets a stream to packetize. The application will load if you touch it in anyway, e.g. the ServerListener example.

    Richard

Page 1 of 2 12 LastLast

Similar Threads

  1. dynamic application creation and publishing
    By jasonp in forum General Forum
    Replies: 1
    Last Post: 01-28-2013, 12:03 PM
  2. dynamic application creation and publishing
    By jasonp in forum General Forum
    Replies: 1
    Last Post: 01-25-2013, 08:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •