Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: ModuleStreamControl.java

  1. #1

    Default ModuleStreamControl.java

    I have issue with scheduled streams playing both a live stream and mp4 at different times of the day. On fairly rare occasions the live stream may go down (network busy between ip camera and wowza). The stream reset functions im sure I added previously do not seem to be resetting the stream like I hoped they would.

    Therefore Im now thinking about using the module to do it manually myself by adding the live stream into an existing playlist (the one running) scheduled now.

    I have downloaded the wms-plugin-collection.zip file and found the java file (ModuleStreamControl.java) after digging way down the zip file. Where do I put it? And do I need to compile it or anything to make it work? If so then how?

    I know I have to add this to the application.xml file :

    <Module>
    <Name>streamcontroller</Name>
    <Description>ModuleStreamControl</Description>
    <Class>com.wowza.wms.plugin.collection.module.ModuleStreamControl</Class>
    </Module>

    Then lastly I need to know how I can call it from an admin web page (or run from command line) where one of our users can simply put in the name of the stream and it adds the camera stream to the playlist therefore restoring the stream.

    Look forward to hearing from you

  2. #2

    Default

    I have copied the ModuleStreamControl.java to my server and tried to run the javac command in similar way to the notes for JMX command line one and get this :

    [root@srv001 bin]# javac ModuleStreamControl.java
    ModuleStreamControl.java:6: error: package com.wowza.wms.amf does not exist
    import com.wowza.wms.amf.*;
    ^
    ModuleStreamControl.java:7: error: package com.wowza.wms.application does not exist
    import com.wowza.wms.application.IApplicationInstance;
    ^
    ModuleStreamControl.java:8: error: package com.wowza.wms.client does not exist
    import com.wowza.wms.client.*;
    ^
    ModuleStreamControl.java:9: error: package com.wowza.wms.module does not exist
    import com.wowza.wms.module.*;
    ^
    ModuleStreamControl.java:10: error: package com.wowza.wms.request does not exist
    import com.wowza.wms.request.*;
    ^
    ModuleStreamControl.java:11: error: package com.wowza.wms.stream does not exist
    import com.wowza.wms.stream.IMediaStream;
    ^
    ModuleStreamControl.java:12: error: package com.wowza.wms.stream.publish does not exist
    import com.wowza.wms.stream.publish.*;
    ^
    ModuleStreamControl.java:13: error: package com.wowza.wms.util does not exist
    import com.wowza.wms.util.StreamUtils;
    ^
    ModuleStreamControl.java:15: error: cannot find symbol
    public class ModuleStreamControl extends ModuleBase {
    ^
    symbol: class ModuleBase
    ModuleStreamControl.java:17: error: cannot find symbol
    public void getStreamNames(IClient client, RequestFunction function, AMFDataList params) {
    ^
    symbol: class IClient
    location: class ModuleStreamControl
    ModuleStreamControl.java:17: error: cannot find symbol
    public void getStreamNames(IClient client, RequestFunction function, AMFDataList params) {
    ^
    symbol: class RequestFunction
    location: class ModuleStreamControl
    ModuleStreamControl.java:17: error: cannot find symbol
    public void getStreamNames(IClient client, RequestFunction function, AMFDataList params) {
    ^
    symbol: class AMFDataList
    location: class ModuleStreamControl
    ModuleStreamControl.java:46: error: cannot find symbol
    public void openPlaylistOnStream(IClient client, RequestFunction function,
    ^
    symbol: class IClient
    location: class ModuleStreamControl
    ModuleStreamControl.java:46: error: cannot find symbol
    public void openPlaylistOnStream(IClient client, RequestFunction function,
    ^
    symbol: class RequestFunction
    location: class ModuleStreamControl
    ModuleStreamControl.java:47: error: cannot find symbol
    AMFDataList params) {
    ^
    symbol: class AMFDataList
    location: class ModuleStreamControl
    ModuleStreamControl.java:60: error: cannot find symbol
    public void addItemToPlaylist(IClient client, RequestFunction function,
    ^
    symbol: class IClient
    location: class ModuleStreamControl
    ModuleStreamControl.java:60: error: cannot find symbol
    public void addItemToPlaylist(IClient client, RequestFunction function,
    ^
    symbol: class RequestFunction
    location: class ModuleStreamControl
    ModuleStreamControl.java:61: error: cannot find symbol
    AMFDataList params) {
    ^
    symbol: class AMFDataList
    location: class ModuleStreamControl
    ModuleStreamControl.java:70: error: cannot find symbol
    public void removeItemFromPlaylist(IClient client, RequestFunction function,
    ^
    symbol: class IClient
    location: class ModuleStreamControl
    ModuleStreamControl.java:70: error: cannot find symbol
    public void removeItemFromPlaylist(IClient client, RequestFunction function,
    ^
    symbol: class RequestFunction
    location: class ModuleStreamControl
    ModuleStreamControl.java:71: error: cannot find symbol
    AMFDataList params) {
    ^
    symbol: class AMFDataList
    location: class ModuleStreamControl
    ModuleStreamControl.java:81: error: cannot find symbol
    public void playNextPlaylistItem(IClient client, RequestFunction function,
    ^
    symbol: class IClient
    location: class ModuleStreamControl
    ModuleStreamControl.java:81: error: cannot find symbol
    public void playNextPlaylistItem(IClient client, RequestFunction function,
    ^
    symbol: class RequestFunction
    location: class ModuleStreamControl
    ModuleStreamControl.java:82: error: cannot find symbol
    AMFDataList params) {
    ^
    symbol: class AMFDataList
    location: class ModuleStreamControl
    ModuleStreamControl.java:92: error: cannot find symbol
    public void addNewStream(IClient client, RequestFunction function,
    ^
    symbol: class IClient
    location: class ModuleStreamControl
    ModuleStreamControl.java:92: error: cannot find symbol
    public void addNewStream(IClient client, RequestFunction function,
    ^
    symbol: class RequestFunction
    location: class ModuleStreamControl
    ModuleStreamControl.java:93: error: cannot find symbol
    AMFDataList params) {
    ^
    symbol: class AMFDataList
    location: class ModuleStreamControl
    ModuleStreamControl.java:103: error: cannot find symbol
    public void addNewPlaylist(IClient client, RequestFunction function,
    ^
    symbol: class IClient
    location: class ModuleStreamControl
    ModuleStreamControl.java:103: error: cannot find symbol
    public void addNewPlaylist(IClient client, RequestFunction function,
    ^
    symbol: class RequestFunction
    location: class ModuleStreamControl
    ModuleStreamControl.java:104: error: cannot find symbol
    AMFDataList params) {
    ^
    symbol: class AMFDataList
    location: class ModuleStreamControl
    ModuleStreamControl.java:115: error: cannot find symbol
    public void stopStream(IClient client, RequestFunction function,
    ^
    symbol: class IClient
    location: class ModuleStreamControl
    ModuleStreamControl.java:115: error: cannot find symbol
    public void stopStream(IClient client, RequestFunction function,
    ^
    symbol: class RequestFunction
    location: class ModuleStreamControl
    ModuleStreamControl.java:116: error: cannot find symbol
    AMFDataList params) {
    ^
    symbol: class AMFDataList
    location: class ModuleStreamControl
    ModuleStreamControl.java:18: error: cannot find symbol
    getLogger().info("getFiles");
    ^
    symbol: method getLogger()
    location: class ModuleStreamControl
    ModuleStreamControl.java:20: error: cannot find symbol
    AMFDataObj publishedStreams = new AMFDataObj();
    ^
    symbol: class AMFDataObj
    location: class ModuleStreamControl
    ModuleStreamControl.java:20: error: cannot find symbol
    AMFDataObj publishedStreams = new AMFDataObj();
    ^
    symbol: class AMFDataObj
    location: class ModuleStreamControl
    ModuleStreamControl.java:21: error: cannot find symbol
    IApplicationInstance app = client.getAppInstance();
    ^
    symbol: class IApplicationInstance
    location: class ModuleStreamControl
    ModuleStreamControl.java:23: error: cannot find symbol
    List<Publisher> publishers = client.getAppInstance().getPublishers();
    ^
    symbol: class Publisher
    location: class ModuleStreamControl
    ModuleStreamControl.java:24: error: cannot find symbol
    Iterator<Publisher> iterp = publishers.iterator();
    ^
    symbol: class Publisher
    location: class ModuleStreamControl
    ModuleStreamControl.java:28: error: cannot find symbol
    Publisher publisher = iterp.next();
    ^
    symbol: class Publisher
    location: class ModuleStreamControl
    ModuleStreamControl.java:29: error: cannot find symbol
    getLogger().info("Stream Name: " + publisher.getStream().getName());
    ^
    symbol: method getLogger()
    location: class ModuleStreamControl
    ModuleStreamControl.java:40: error: cannot find symbol
    IMediaStream stream = app.getStreams().getStream(streamName);
    ^
    symbol: class IMediaStream
    location: class ModuleStreamControl
    ModuleStreamControl.java:49: error: cannot find symbol
    String streamName = getParamString(params, PARAM1);
    ^
    symbol: variable PARAM1
    location: class ModuleStreamControl
    ModuleStreamControl.java:51: error: cannot find symbol
    String playlistName = getParamString(params, PARAM2);
    ^
    symbol: variable PARAM2
    location: class ModuleStreamControl
    ModuleStreamControl.java:53: error: cannot find symbol
    Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:53: error: cannot find symbol
    Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:55: error: cannot find symbol
    Playlist playlist = (Playlist)client.getAppInstance().getProperties().getProperty(playlistName);
    ^
    symbol: class Playlist
    location: class ModuleStreamControl
    ModuleStreamControl.java:55: error: cannot find symbol
    Playlist playlist = (Playlist)client.getAppInstance().getProperties().getProperty(playlistName);
    ^
    symbol: class Playlist
    location: class ModuleStreamControl
    ModuleStreamControl.java:63: error: cannot find symbol
    AMFDataObj obj = getParamObj(params, PARAM1);
    ^
    symbol: class AMFDataObj
    location: class ModuleStreamControl
    ModuleStreamControl.java:63: error: cannot find symbol
    AMFDataObj obj = getParamObj(params, PARAM1);
    ^
    symbol: variable PARAM1
    location: class ModuleStreamControl
    ModuleStreamControl.java:65: error: cannot find symbol
    Playlist playlist = (Playlist)client.getAppInstance().getProperties().getProperty(obj.getString("playListName"));
    ^
    symbol: class Playlist
    location: class ModuleStreamControl
    ModuleStreamControl.java:65: error: cannot find symbol
    Playlist playlist = (Playlist)client.getAppInstance().getProperties().getProperty(obj.getString("playListName"));
    ^
    symbol: class Playlist
    location: class ModuleStreamControl
    ModuleStreamControl.java:73: error: cannot find symbol
    String streamName = getParamString(params, PARAM1);
    ^
    symbol: variable PARAM1
    location: class ModuleStreamControl
    ModuleStreamControl.java:75: error: cannot find symbol
    Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:75: error: cannot find symbol
    Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:84: error: cannot find symbol
    String streamName = getParamString(params, PARAM1);
    ^
    symbol: variable PARAM1
    location: class ModuleStreamControl
    ModuleStreamControl.java:86: error: cannot find symbol
    Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:86: error: cannot find symbol
    Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:95: error: cannot find symbol
    String streamName = getParamString(params, PARAM1);
    ^
    symbol: variable PARAM1
    location: class ModuleStreamControl
    ModuleStreamControl.java:97: error: cannot find symbol
    Stream stream = Stream.createInstance(client.getAppInstance(), streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:97: error: cannot find symbol
    Stream stream = Stream.createInstance(client.getAppInstance(), streamName);
    ^
    symbol: variable Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:106: error: cannot find symbol
    String playListName = getParamString(params, PARAM1);
    ^
    symbol: variable PARAM1
    location: class ModuleStreamControl
    ModuleStreamControl.java:108: error: cannot find symbol
    Playlist playlist = new Playlist(playListName);
    ^
    symbol: class Playlist
    location: class ModuleStreamControl
    ModuleStreamControl.java:108: error: cannot find symbol
    Playlist playlist = new Playlist(playListName);
    ^
    symbol: class Playlist
    location: class ModuleStreamControl
    ModuleStreamControl.java:117: error: cannot find symbol
    String streamName = getParamString(params, PARAM1);
    ^
    symbol: variable PARAM1
    location: class ModuleStreamControl
    ModuleStreamControl.java:119: error: cannot find symbol
    Stream stream = (Stream)client.getAppInstance().getProperties().remove(streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    ModuleStreamControl.java:119: error: cannot find symbol
    Stream stream = (Stream)client.getAppInstance().getProperties().remove(streamName);
    ^
    symbol: class Stream
    location: class ModuleStreamControl
    67 errors


    So I am guessing it needs to be somewhere specific in order to run it if you can let me know.

    (sorry I dont know how to put scroll bars in the output so it doesnt fill the screen)

  3. #3

    Default

    From this post : http://www.wowza.com/forums/showthre...t-module/page2 I have also got the wms-plugin-collection.jar file in my lib directory so does that mean it is compiled or how do I test it from a command line?

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

    Default

    Yes, just copy the .jar file from the download to Wowza /lib folder, then re-start Wowza. There is a Flash controller included as well.

    Richard

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

    Default

    Also, here is a scheduler you can load on demand:

    http://www.wowza.com/forums/content....cation-module)

    Richard

  6. #6

    Default

    I already have a streamschedule.smil file which works fine - well almost... bunch of issues like it doesnt reset if a live mediacaster stream has an issue therefore stopping the schedule till its next change, which is my only need to be trying to install this so i can try and do it manually.

    My only other idea is if the scheduler is unable to detect an error in a live ip camera stream then i update my streamschedule.smil file to play the webcam stream every 5mins in order to frig bringing it back into life. My schedule file is already big to cover 60 cameras for 10 days so ideally i dont want to add additional items in the playlist every 5mins to keep it running.

    What do you suggest?
    Last edited by krisisdnbdjmx; 09-25-2012 at 06:00 AM.

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

    Default

    You might be able to use IMediaCasterNotify2 to monitor yourself and re-set the schedule streams:
    http://www.wowza.com/forums/content....otify2-example

    The basic Stream class api you will need:
    http://www.wowza.com/forums/content....-class-streams

    However, I'm not sure what to suggest for keeping track of what exactly needs to be re-set if a particular stream goes down. It might be easier to re-load the schedule.

    Note that the link to the new scheduler approach uses the exact same schedule.smil that the server listener does.

    Richard

  8. #8

    Default

    Just to clear what options there currently are....

    http://www.wowza.com/forums/content....-class-streams << this should allow me to add items to a schedule stream playlist which has stuck (my situation with a mediacaster stream that has reset itself) therefore allows me to restart it or bring it back to life

    http://www.wowza.com/forums/content....tion-module%29 << this enables schedule streams to be created without reloading wowza, but only by using some manual flash method. does it monitor live streams to make sure they are running and reset if needed?

    http://www.wowza.com/forums/content.php?145 << creates schedule streams but requires wowza restart to happen but has no checks to monitor stream status and reset if neccessary

    Is that all related bits that can help me or is there anything else?

    My preferred solution would be for schedule streams to monitor and reset themselves on their own in same way as mediacaster streams

    Next best choice would be some way I can reset a scheduler stream manually from linux. In order to do that I need some way to spot a stream that has a problem in the first place

    Next option is the huge streamschedule.smil file to start each live camera every 5mins which is now getting to John Wayne cowboy status to solve this issue

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

    Default

    These scheduled streams do not monitor their source and reset. Reloading the schedule or using the controller as needed are all I can suggest.

    Richard

  10. #10

    Default

    so reloading the schedule would be by adding your new module : http://www.wowza.com/forums/content....tion-module%29 and manually calling the flash application?

    Or is that 2 seperate options??

    That sort of leads to another question if they are seperate options... what overhead on wowza / java is reloading the schedule every 5mins and would it work anyway as the stream names would be the same (from the .smil file)?

    Am I right in saying that there is no significant memory impact of a huge schedule file (the 5min option for each stream) as it is just loaded at startup and sits there? Would it actually work as I am thinking to effectively make the scheduler stream rescan the mediacaster stream and play it?

    I have used in the past the JMX command line method (http://www.wowza.com/forums/content.php?151) to stop and start mediacaster streams. Maybe this could be updated to work for scheduler streams as well?

Page 1 of 3 123 LastLast

Similar Threads

  1. Wowza failed after 10 days - java.lang.OutOfMemoryError: Java heap space
    By tribalhost in forum Performance Tuning Discussion
    Replies: 5
    Last Post: 04-10-2013, 06:30 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
  •