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

Thread: getQueryStr() of transcoded stream

  1. #1

    Question getQueryStr() of transcoded stream

    Hello,

    I noticed that the transcoded stream does not contain the querystring of the original stream.
    Is there any way to make sure it gets it, or grab the original stream querystring params for all its transcoded streams as well ?

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

    Default

    I'm not sure. What do you do with the querystring in the source? Why does it need to be added to the transcoded streams, what will you do with it there?

    Richard

  3. #3

    Default

    Basically the way we use it now is to pass the SAN/NAS mount information and a GUID to decide which customer that stream belongs to.
    Right now I am able to use that mount path passed to change the output directory of the recorded file and hit an API saying, stream such and such from customer with guid passed is currently being encoded and other status information. Counting total number of streams per customer etc.
    That needs to be present from the original stream in the transcoded one as well so we can do the same stuff with the transcoded streams also.
    ex: source: mp4:livestream?path=/mnt/something/&guid=abc123 ... we may add more parameters later on to decide how many transcoded streams the customer is paying for and which ones etc.
    Another thing we would add when we add more CDN for push publish is the CDN information as well. Such data is needed for the transcoded streams also which is why I ask.

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

    Default

    I don't think there is a way to do that at present.

    Where do you parse and log that data? Do you override publish or use IMediaStreamActionNotify.onPublish()?

    Richard

  5. #5

    Default

    IMediaStreamActionNotify.onPublish()

    public class LoadBalancedLiveRecord extends ModuleLiveStreamRecord {
    
          class StreamListener  implements IMediaStreamActionNotify3 {
    
    		public  void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {
    
                                  params = WowzaUtils.getParams(stream.getQueryStr());
    Last edited by arpan_synapse; 07-26-2012 at 10:29 AM.

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

    Default

    Test this:

    package test;
    
    import com.wowza.wms.stream.*;
    import com.wowza.wms.stream.livetranscoder.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.application.*;
    
    public class ModuleTranscoderControlByStream extends ModuleBase
    {
    	class TranscoderControl implements ILiveStreamTranscoderControl
    	{
    		public boolean isLiveStreamTranscode(String transcoder, IMediaStream stream)
    		{
    			// here is there you return true or false if you want stream transcoded
    			if ( stream.isTranscodeResult() ) 
    			{ 
    				return false; 
    			} else {
    				IMediaStream streamSrc = stream.getClient().getAppInstance().getStreams().getStream(stream.getClient(), stream.getSrc());
    				stream.setQueryStr(streamSrc.getQueryStr());
    				return true;
    			}			
    			
    		}
    	}
    	
    	public void onAppStart(IApplicationInstance appInstance)
    	{
    		appInstance.setLiveStreamTranscoderControl(new TranscoderControl());
    	}
    }

  7. #7

    Default

    Hi Richard

    That did not work and its throwing a nullpointer in the record function. Stack Trace below:


    ERROR server comment - invoke(publish): java.lang.NullPointerException: com.wowza.wms.plugin.livestreamrecord.ModuleLiveStreamRecord.recordStream(ModuleLiveStreamRecord.jav a:28)
    java.lang.NullPointerException
    at com.wowza.wms.plugin.livestreamrecord.ModuleLiveStreamRecord.recordStream(ModuleLiveStreamRecord.jav a:28)
    at ws.synapse.mediaconsole.wms.plugins.LoadBalancedLiveRecord$StreamListener.onPublish(LoadBalancedLive Record.java:237)
    at com.wowza.wms.stream.MediaStream.notifyActionPublish(Unknown Source)
    at com.wowza.wms.module.ModuleCore.publish(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.wowza.wms.module.ModuleFunction.invoke(Unknown Source)
    at com.wowza.wms.module.ModuleFunctions.invoke(Unknown Source)
    at com.wowza.wms.request.RequestProcessFunctions.processFunctions(Unknown Source)
    at com.wowza.wms.client.ClientWorker.processNextReq(Unknown Source)
    at com.wowza.wms.request.RTMPRequestAdapter.service(Unknown Source)
    at com.wowza.wms.server.ServerHandler.a(Unknown Source)
    at com.wowza.wms.server.ServerHandler.a(Unknown Source)
    at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
    at com.wowza.wms.server.ServerHandlerThreadedSession.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

    stream.getClient() throws a null pointer
    Anything else you can think of ?

    Since the transcoded streamnames are like streamname_240p etc. is there a way to get the original stream by stripping the _240p part and then get the original stream by the stream name and get its queryparams?
    Last edited by arpan_synapse; 07-27-2012 at 07:00 AM.

  8. #8

    Default

    I believe you can still play the non-transcoded stream in the normal way, using the published stream name.

  9. #9

    Default

    Hi randall

    Yes the playing works but I need to get access to the original stream during the transcoded stream call to grab the query params so I can decide which location to record to file to. What would be the line to get a stream by streamName within the onpublish of the transcoded stream?
    Last edited by arpan_synapse; 07-27-2012 at 07:43 AM.

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

    Default

    What is the source, is it a MediaCaster stream?

    Richard

Page 1 of 2 12 LastLast

Similar Threads

  1. Record transcoded stream
    By dennisderooy in forum AddOn: Transcoder
    Replies: 10
    Last Post: 06-26-2012, 02:17 PM

Posting Permissions

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