Results 1 to 2 of 2

Thread: how to get the stream name of VOD stream?

  1. #1
    Join Date
    Feb 2015
    Posts
    27

    Default how to get the stream name of VOD stream?

    Hi there,

    I'm currently trying to insert onTextData to VOD stream. I referenced some other articles and wrote the following codes. But
    when I called MediaStreamMap.getStream(stream name) it always returned NULL (marked in red). The mp4 file's name is sample.mp4.

    I also tried this code with live stream and it worked. I used ffmpeg to publish a stream named "myStream" to Wowza and then I called mediaStreamMap.getStream("myStream"). It returned a non-null stream object and I successfully inserted onTextData to the stream (I used DVB inspector and saw the metadata packets)

    So my question is: how to get the correct name of VOD stream? Shouldn't it be sample.mp4 or mp4:sample.mp4?

    public class AmfInjectorForVOD extends ModuleBase {

    public static Timer timer;
    public IApplicationInstance app;
    private int InjectInterval = 5000;
    public AMFDataObj timeObj;

    public void onAppStart(IApplicationInstance appInstance) {
    app = appInstance;
    timeObj = new AMFDataObj();
    timer = new Timer();
    timer.schedule(new injectStreams(), InjectInterval, InjectInterval);
    getLogger().info("this is AmfInjector for VOD\n");
    }

    public void onAppStop(IApplicationInstance appInstance) {
    timer.cancel();
    }

    class injectStreams extends TimerTask{
    public void run() {
    getLogger().info("all the streams listed: " + app.getStreams().getStreams() + '\n');
    MediaStreamMap mediaStreamMap = app.getStreams();
    IMediaStream vidStream = mediaStreamMap.getStream("sample.mp4");
    if (vidStream != null){
    injectEvent(vidStream);
    } else {
    getLogger().info("stream no found " + '\n');
    }
    }
    }

    public void injectEvent(IMediaStream stream) {
    AMFDataMixedArray data = new AMFDataMixedArray();
    data.put("text", new AMFDataItem("hello world VOD\n" + (new Date()).toString()));
    data.put("language", new AMFDataItem("eng"));
    data.put("trackid", new AMFDataItem(99));
    stream.sendDirect("onTextData", data);
    //((MediaStream)stream).processSendDirectMessages();
    getLogger().info("yshenCaption: " + "hello world\n");
    }
    }

    Thanks!
    Yorick

  2. #2
    Join Date
    Feb 2015
    Posts
    27

    Default

    Found the answer. http://www.wowza.com/forums/showthre...OD-RTMP-stream
    Currently Wowza doesn't support injecting onTextData to VOD stream. I also checked the MediaStreamMap object in my code. The "streams" field in this object is NULL.

Similar Threads

  1. Replies: 3
    Last Post: 02-18-2015, 07:05 AM
  2. [VOD Streaming] Create a time frame for VOD stream
    By anhdung in forum Live Streaming and Encoders
    Replies: 2
    Last Post: 05-27-2014, 04:33 AM
  3. Need help to make server continue stream VOD content while pause HLS stream
    By JohnnyTran in forum Video On Demand Streaming Discussion
    Replies: 1
    Last Post: 07-15-2013, 08:05 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
  •