Results 1 to 5 of 5

Thread: isLiveStreamTranscode() calls for the streams already being transcoded

  1. #1
    Join Date
    Nov 2011
    Posts
    1

    Default isLiveStreamTranscode() calls for the streams already being transcoded

    Hi there,

    Can anybody tell for sure if the output streams from the Transcoder need to be filtered out from repeated using as a source of transcoding with ILiveStreamTranscoderControl.isLiveStreamTranscode()?

    We use standard transcoder profiles (transcode.xml). And we've got a situation when the number of streams is multiplying and we are getting streams like -
    sampleStream_160p, sampleStream_360p (which is ok)
    and then
    sampleStream_160p_360p, ... , sampleStream_160p_160p_360p_160p_160p_160p_160p , ...

    I.e. it seems that trascoder starts transcoding its own streams again and again.

    According to the sample in the following article -
    http://www.wowza.com/forums/content....erver-side-API
    - we can just return true to transcode all streams. However that leads to the situation described above.

    Sure we can filter them out by stream name using regex, but the example seems very confusing then. Can anybody tell what is the normal way of handling it?


    Our custom module

    package t.wowza;
    
    import com.wowza.wms.application.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.stream.*;
    import com.wowza.wms.stream.livetranscoder.ILiveStreamTranscoderControl;
    
    public class TTranscoderControl 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
                getLogger().error("isLiveStreamTranscode streamName:" + stream.getName());
                
                return true;
            }
        }
        
        public void onAppStart(IApplicationInstance appInstance)
        {
            appInstance.setLiveStreamTranscoderControl(new TranscoderControl());
        }
    
    }

    Application.xml

    <Root>
        <Application>
    ...
            <Modules>
    ...
                <Module>
                    <Name>TTranscoderControl</Name>
                    <Description>TTranscoderControl</Description>
                    <Class>t.wowza.TTranscoderControl</Class>
                </Module> 
            </Modules>
    ...
        </Application>
    </Root>

    Error Log

    ERROR    server    comment    2011-11-09    00:18:43    -    -    -    -    -    20.365    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_160p
    ERROR    server    comment    2011-11-09    00:18:43    -    -    -    -    -    20.366    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_360p
    ERROR    server    comment    2011-11-09    00:18:43    -    -    -    -    -    20.577    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_360p_160p
    ERROR    server    comment    2011-11-09    00:18:43    -    -    -    -    -    20.577    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_360p_360p
    ERROR    server    comment    2011-11-09    00:18:43    -    -    -    -    -    20.595    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_160p_360p
    ERROR    server    comment    2011-11-09    00:18:43    -    -    -    -    -    20.61    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_160p_160p
    ERROR    server    comment    2011-11-09    00:18:44    -    -    -    -    -    21.578    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_360p_360p_360p
    ERROR    server    comment    2011-11-09    00:18:44    -    -    -    -    -    21.579    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_360p_360p_160p
    ERROR    server    comment    2011-11-09    00:18:44    -    -    -    -    -    21.585    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_360p_160p_360p
    ERROR    server    comment    2011-11-09    00:18:44    -    -    -    -    -    21.586    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_360p_160p_160p
    ERROR    server    comment    2011-11-09    00:18:44    -    -    -    -    -    21.587    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_160p_160p_360p
    ERROR    server    comment    2011-11-09    00:18:44    -    -    -    -    -    21.588    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_160p_160p_160p
    ERROR    server    comment    2011-11-09    00:18:44    -    -    -    -    -    21.593    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_160p_360p_360p
    ERROR    server    comment    2011-11-09    00:18:44    -    -    -    -    -    21.599    -    -    -    -    -    -    -    -    isLiveStreamTranscode streamName:sampleStream_160p_360p_160p
    Access Log

    2011-11-09    00:18:53    EST    publish    stream    INFO    200    sampleStream_160p_160p_360p_160p_160p_160p_160p    -    -    -    -    0.001    -    -    -    -    -    -    -    -    -    -    152    0    0    0    sampleStream_160p_160p_360p_160p_160p_160p_160p    -    -    -    -    -    /sampleStream_160p_160p_360p_160p_160p_160p_160p    /sampleStream_160p_160p_360p_160p_160p_160p_160p    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    SanJosePacketHandler.startStream[live/_definst_/sampleStream_160p_360p_360p_160p_360p_360p]    -    -    -    30.965    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    TranscodingSession.updateBehindFilter[live/_definst_:sampleStream_360p]: Video behind filter state change. New state: SKIP2FRAME    -    -    -    30.965    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    CupertinoPacketHandler.startStream[live/_definst_/sampleStream_160p_360p_360p_160p_360p_360p]    -    -    -    30.966    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    LiveStreamPacketizerCupertino.handlePacket[live/_definst_/sampleStream_160p_360p_360p_160p_360p_360p]: Audio codec:AAC isCompatible:true    -    -    -    30.966    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    LiveStreamPacketizerCupertino.handlePacket[live/_definst_/sampleStream_160p_360p_360p_160p_360p_360p][mp4a.40.2]: AAC Audio info: {AACFrame: size: 0, rate: 16000, channels: 1, samples: 1024, errorBitsAbsent: true, profileObjectType: "LC"}    -    -    -    30.966    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    LiveStreamPacketizerSmoothStreaming.startStream[live/_definst_/sampleStream_160p_360p_360p_160p_360p_360p]    -    -    -    30.966    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    LiveStreamPacketizerSmoothStreaming.addFragment[live/_definst_/sampleStream_360p_160p_360p_360p]: Add chunk: type:audio id:1 count:32 duration:2048    -    -    -    30.968    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    LiveStreamPacketizerSmoothStreaming.addFragment[live/_definst_/sampleStream_360p_160p_360p_160p]: Add chunk: type:audio id:1 count:32 duration:2048    -    -    -    30.968    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    encoder-audio-start    transcoder    INFO    200    sampleStream_360p_160p_160p_360p_160p_160p    {name:"360p", bitrate:96000, codec:AAC, objectType:0, sampleRate:16000, channels:1}    -    -    -    30.969    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    JNI:TranscoderSession.isCUDAAvailable[live/_definst_/sampleStream_160p_160p_360p_360p_160p_160p]: NVidia CUDA hardware acceleration is NOT available on Linux    -    -    -    30.97    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    2011-11-09    00:18:53    EST    comment    server    INFO    200    -    JNI:TranscoderSession.isQuickSyncAvailable[live/_definst_/sampleStream_160p_160p_360p_360p_160p_160p]: Intel Quick Sync hardware acceleration is NOT available on Linux    -    -    -    30.971    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
    Kind Regards,
    Pavel

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

    Default

    Pavel,

    If you remove this module from the Application.xml, then restart Wowza, then retest, is transcoding normal?

    If it is not normal even without this module, have you modified the template? If so, try with default transrate.xml template.

    Richard

  3. #3

    Default

    Hi,

    Use the following code

    PHP Code:
    package t.wowza;

    import com.wowza.wms.application.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.stream.*;
    import com.wowza.wms.stream.livetranscoder.ILiveStreamTranscoderControl;

    public class 
    TTranscoderControl extends ModuleBase 
            
    {
            public 
    boolean isLiveStreamTranscode(String transcoderIMediaStream stream)
                    {
                    
    // here is there you return true or false if you want stream transcoded
                    
    if ( stream.isTranscodeResult() )
                            {
                            return 
    false;
                            }
                    return 
    true;
                    }
            

        public 
    void onAppStart(IApplicationInstance appInstance)
        {
            
    appInstance.setLiveStreamTranscoderControl(new TranscoderControl());
        }


    This should only transcode incoming streams which are not already transcoded.

    Shamrock

  4. #4

    Default isTranscodeResult() not working with above example

    Quote Originally Posted by shamrock View Post
    Hi,

    Use the following code

    PHP Code:
    package t.wowza;

    import com.wowza.wms.application.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.stream.*;
    import com.wowza.wms.stream.livetranscoder.ILiveStreamTranscoderControl;

    public class 
    TTranscoderControl extends ModuleBase 
            
    {
            public 
    boolean isLiveStreamTranscode(String transcoderIMediaStream stream)
                    {
                    
    // here is there you return true or false if you want stream transcoded
                    
    if ( stream.isTranscodeResult() )
                            {
                            return 
    false;
                            }
                    return 
    true;
                    }
            

        public 
    void onAppStart(IApplicationInstance appInstance)
        {
            
    appInstance.setLiveStreamTranscoderControl(new TranscoderControl());
        }


    This should only transcode incoming streams which are not already transcoded.

    Shamrock

    class TranscoderControl implements ILiveStreamTranscoderControl
    	{
    		public boolean isLiveStreamTranscode(String transcoder, IMediaStream stream)
    		{
    			if ( stream.isTranscodeResult() == true )
    				{
    				getLogger().info("Stream is already transcoded, not running");
    				return false;
    				}
    			
    
    			getLogger().info("Asking the transcoder default to run");
    		return true;
    		}
    	}
    I used the above example but still having the looping issues mentioned. And I implement it using
    appInstance.setLiveStreamTranscoderControl(new TranscoderControl());
    in the onAppStart() method.

    Any reason why isTranscodeResult() would not be working? This is on 3.0.4

  5. #5

    Default IMediaStreamActionNotify3 Exception might cause loop

    Quote Originally Posted by hsamayoa View Post
    class TranscoderControl implements ILiveStreamTranscoderControl
    	{
    		public boolean isLiveStreamTranscode(String transcoder, IMediaStream stream)
    		{
    			if ( stream.isTranscodeResult() == true )
    				{
    				getLogger().info("Stream is already transcoded, not running");
    				return false;
    				}
    			
    
    			getLogger().info("Asking the transcoder default to run");
    		return true;
    		}
    	}
    I used the above example but still having the looping issues mentioned. And I implement it using
    appInstance.setLiveStreamTranscoderControl(new TranscoderControl());
    in the onAppStart() method.

    Any reason why isTranscodeResult() would not be working? This is on 3.0.4

    I had an exception in my IMediaStreamActionNotify class which in turned caused isTranscodeResult() to return a false. Just an FYI for anybody else having this issue.

Similar Threads

  1. How unpublish transcoded streams programmably?
    By headshrinker in forum Wowza Transcoder
    Replies: 1
    Last Post: 10-08-2014, 06:53 AM
  2. out of sync transcoded and source streams
    By yaroslavv in forum Live Streaming and Encoders
    Replies: 5
    Last Post: 04-15-2014, 04:47 AM
  3. Do Transcoded Streams Have a Different Client
    By newtriks in forum Wowza Streaming Server Java API
    Replies: 1
    Last Post: 03-19-2014, 03:19 AM
  4. slow motion transcoded streams
    By yee.woon2@gmail.com in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 07-25-2013, 05:07 AM
  5. Record live transcoded streams
    By german in forum AddOn: Transcoder
    Replies: 1
    Last Post: 11-21-2011, 12:34 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
  •