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

Thread: Wowza MP4 Append and file mover addon

  1. #1
    Join Date
    Jan 2012
    Posts
    10

    Default Wowza MP4 Append and file mover addon

    Hello,

    I am working on an application on and ec2 instance of wowza 3. I have a live stream which can be paused/resumed while its running. I then need those to be compiled into one mp4 video and copied to a folder on an s3 bucket.

    Currently im having the following issues:

    1. When i use flv as the format, the append mode works fine and appends the video. When i switch to mp4 (by using the mp4: prefix on the stream name) it no longer appends, but now it versions the files.

    2. I tried using the file mover module, but it copies the files too soon, once the video is paused it copies the file over, and as far as i could tell doesnt support any appending once the file is moved.

    I guess what i would need is a way to append mp4s and get the appended file when it is complete moved over to to the s3 bucket.


    Thanks in advance,
    Ken

  2. #2
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Ken,

    The built-in file mover is not going to work in this case. You will need more control, take a look at IMediaWriterActionNotify

    http://www.wowza.com/forums/content....write-listener

    What version of Wowza and the LiveStreamRecord package are you using?

    Richard

  3. #3
    Join Date
    Jan 2012
    Posts
    10

    Default

    Thanks, i'll look into that class.

    I'm using version 3 of wowza and live stream recorder.

    Thanks,
    - Ken

  4. #4
    Join Date
    Jan 2012
    Posts
    10

    Default

    So what i was thinking was i could make a custom rpc which i could call when they video is finished recording (not just paused) that could move the file to s3.

    My only other problem is that when using mp4: the files are not appending. If i remove the mp4: they append, but they are flv files i need mp4s.

    Is mp4 appending not supported?


    Thanks,
    Ken

  5. #5
    Join Date
    Jan 2012
    Posts
    10

    Default

    Scratch that it seems to be working now (appending the video at least). I'll continue to play around with the wowza IDE, thanks!

    - Ken

  6. #6
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Ken,

    What method are you using to control append?

    Try adding these Property settings to the /conf/[app-name]/Application.xml /Streams /Properties list

    <Property>
    	<Name>versionFile</Name>
    	<Value>false</Value>
    	<Type>Boolean</Type>
    </Property>
    <Property>
    	<Name>appendFile</Name>
    	<Value>true</Value>
    	<Type>Boolean</Type>
    </Property>
    Then mount s3 bucket with s3fs
    http://www.wowza.com/forums/content....ed-file-system

    Then to move, two options:

    * Built-in, configurable:
    http://www.wowza.com/forums/content....opy-Recordings

    * API:
    http://www.wowza.com/forums/content....write-listener

    Richard

  7. #7
    Join Date
    Jan 2012
    Posts
    10

    Default

    Ok i think i have my custom module working pretty well, just one more little problem.

    From the webpage which is streaming the video (recieving it from the live feed) When the broadcaster pauses the feed (essentially closes the connection) the video player crashes and says that it is unable to connect.

    My question is, is there a way through either php or javascript to check if a stream is available or not?


    Thanks,
    Ken

  8. #8
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    In a Wowza Module you can use IApplicationInstance.getPublishStreamNames(), something like:

    MediaStreamMap streams = appInstance.getStreams();
    List<String> streamNames = streams.getPublishStreamNames();
    
    Iterator<String> iter = streamNames.iterator();
    while(iter.hasNext())
    {
    	String streamName = iter.next();
    
    
    	List<IMediaStream> listeners = appInstance.getPlayStreamsByName(streamName);
    	if (listeners == null)
    		continue;
    
    	//System.out.println("streamName: "+listeners.size()+":"+streamName);
    
    	IMediaStream stream = streams.getStream(streamName);
    	if (stream == null)
    		continue;
    }
    Richard

  9. #9
    Join Date
    Jan 2012
    Posts
    10

    Default

    Ok thats perfect.

    I know this probably isn't your specialty but any idea how i might get that information in javascript or php? That would be ideal, I just haven't been able to find any examples for how to call these functions in my module from the actual site ( aside from using flash, which im looking to avoid ).

  10. #10
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Try it like this.

    server-side:
    public void isStreamLive(IClient client, RequestFunction function,
    		AMFDataList params) {
    	
    	Boolean streamExists = false; 
    	String streamName = getParamString(params, PARAM1);
    	MediaStreamMap streams = client.getAppInstance().getStreams();
    	IMediaStream stream = streams.getStream(streamName);
    	
    	if (stream != null)
    		streamExists = true;
    	
    	sendResult(client, params, streamExists);
    }
    Flash client-side:
    var clientObj:Object = new Object();
    clientObj.isStreamLive(streamExists:Boolean):void
    {
    trace(streamExists);
    });
    
    netconnection.client = clientObj;
    netconnection.connect("rtmp://[wowza-address]:1935/[app-name]");
    // elsewhere
    netconnection.call("isStreamLive",null,"myStream");
    Richard

Page 1 of 2 12 LastLast

Similar Threads

  1. Addon streams in append mode
    By Bruno-Eyedo in forum Wowza Transcoder
    Replies: 6
    Last Post: 09-19-2014, 09:45 AM
  2. How to append the file in content folder
    By vinodkumarc in forum General Forum
    Replies: 6
    Last Post: 03-27-2014, 05:17 AM
  3. Convert video file recorded by Wowza using append mode to another format
    By VSheyanov in forum Live Streaming and Encoder Discussion
    Replies: 2
    Last Post: 01-15-2012, 05:56 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
  •