Results 1 to 3 of 3

Thread: Modifications made to module not executed by WMS

  1. #1
    Join Date
    Sep 2012
    Posts
    4

    Default Modifications made to module not executed by WMS

    Hello everyone,

    I'm very new to WMS, and I have to modify a module created by a company (I have all the sources).
    I have the following function :

    public void createSnapshotVOD(IClient client, RequestFunction function, AMFDataList params) {
    WMSLoggerFactory.getLogger(null).info("log message");
    String streamName = params.getString(PARAM1);
    int timecode = params.getInt(PARAM2);//in second
    int uid = params.getInt(PARAM3);

    getLogger().info("createSnapshotVOD " + streamName + " at " + String.valueOf(timecode) + " for " + String.valueOf(uid));

    JSONObject result = new JSONObject();

    //first, find the video by token
    BaseEntity video = Repository.getInstance().findVideoByToken(streamName);
    if (video == null) {
    //try to find by stream
    video = Repository.getInstance().findStreamByToken(streamName);
    if (video != null && video.getInt("field_stream_videoid_value") > 0) {
    int id = video.getInt("field_stream_videoid_value");
    video = Repository.getContentTypeStream();
    video.load(id);
    getLogger().info("ID : " + String.valueOf(id));
    }
    }

    if (video == null) {
    getLogger().info("Can't find video");
    result.put("result", 0);
    result.put("msg", "Video not exists");
    } else {
    getLogger().info("Video found");
    String testStreamName = video.getString("field_videostreamname_value");
    Pattern p = Pattern.compile("^\\d{1,3}_");
    Matcher m = p.matcher(testStreamName);

    getLogger().error(testStreamName);

    boolean isFound = m.find();

    String fileName = "";
    if (isFound == true) {
    fileName = testStreamName;
    } else {
    fileName = String.valueOf(video.getString("field_videouid_value")) + "_" + testStreamName;
    }


    IApplicationInstance appInstance = client.getAppInstance();
    String flvFilePath = appInstance.getStreamStoragePath() + "/" + fileName; // fileName;//streamname must be filename
    getLogger().info("Flv file path: " + flvFilePath);

    File flvFile = new File(flvFilePath);
    if (flvFile.exists()) {
    try {
    String newThumbnail = String.valueOf(uid) + "_" + String.valueOf(Repository.getCurrentTimestamp()) + ".png";
    getLogger().info("New thumbnail: " + newThumbnail);
    SystemUtils.generateThumbnail(flvFilePath, Config.webapp_thumbnail_dir + "/" + newThumbnail, timecode);

    //add to agenda
    Repository repo = Repository.getInstance();
    String token = repo.createRecordVideo("", uid, 0);
    BaseEntity nvideo = repo.findVideoByToken(token);
    nvideo.set("field_videostatus_value", 1);
    nvideo.set("field_thumbnail_value", newThumbnail);
    nvideo.saveOrUpdate();

    result.put("result", 1);
    } catch (Exception e) {
    result.put("result", 0);
    result.put("msg", e.toString());
    getLogger().error(e.toString());
    }
    } else {
    doLog("Le fichier n'existe pas.");
    result.put("result", 0);
    result.put("msg", "File not exist");
    }
    }

    sendResult(client, params, result.toJSONString());
    }

    which takes a snapshot of the currently played FLV file.
    This worked great, but we have chenged ne namig scheme of the files, and I have made the necessary changes.
    Though my jar is well built, any line added won't be executed by Wowza.

    For instance, I see the result of the line getLogger().info("createSnapshotVOD " + streamName + " at " + String.valueOf(timecode) + " for " + String.valueOf(uid)); in my logs, but if I add a line like this (let's sat getLogger().info("Hello World") it won't appear in my logs, event after recompiled, copied the file and restarted WMS.

    Do you know what is the problem ?

    I know that it's more a Java problem (probably) but I can't solve the problem for several days ...

    Thanks in advance,

    Jérémie

  2. #2

    Default

    It's got to be something simple like a path, or referencing the wrong module in your Application.xml.

  3. #3
    Join Date
    Sep 2012
    Posts
    4

    Default

    Very weird : I didn't touch the Application.xml which references my package, just added few lines in my .java, compiled, jared copied to lib/ and restaarted the server.
    For instance, the line getLogger().info("createSnapshotVOD " + streamName + " at " + String.valueOf(timecode) + " for " + String.valueOf(uid)); works; but if I add another getLogger().info("Test"); just below, it won't appear ...

Similar Threads

  1. Updating my module from WMS 3.6 to Wowza Streaming Engine
    By hanetv in forum Wowza Streaming Server Java API
    Replies: 3
    Last Post: 02-27-2014, 06:25 AM
  2. com.wowza.wms.module.IModuleOnHTTPMPEGDashSession doen't exists
    By Gpolox in forum Server-side Modules and Code Samples Discussion
    Replies: 5
    Last Post: 06-29-2013, 05:39 AM
  3. WMS custom module doesn't work when run as a Windows service
    By Sunsight in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 11-23-2011, 09:03 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
  •