Results 1 to 4 of 4

Thread: IMediaStreamH264SEINotify and onVideoH264Packet - event not happening all the time

  1. #1

    Default IMediaStreamH264SEINotify and onVideoH264Packet - event not happening all the time

    It seems as though my IMediaStreamH264SEINotify#onVideoH264Packet method is not executing for every video H264 packet that comes through. Let me explain:

    I have an H.264 stream coming into my Wowza instance. It has embedded userdata. This userdata has a "custom sequence number" embedded in it. I would expect the sequence number to always appear (even though I realize they may be out of order due to the multi-threaded nature of the server). On some servers that I have, all of the sequence numbers appear. On other servers - with the same application configuration, but different hardware specs and different number of source streams - not all of the numbers appear. I have verified that the source stream has all of the sequence numbers.

    For instance, on the correct servers, the sequence number may be: 1, 2, 6, 3, 4, 5, 10, 7, 8, 9, 14, 11, 12, 13, ...
    On the incorrect servers, the sequence numbers seem to be: 1, 3, 5, 9, 11, 17, 19, 23, 27, 29, .... The gaps are always 2, 4, or 6. They are always odd sequence numbers.


    Now for the code.

    I implemented a module that has an event handler for H264 SEI messages:

     public void onStreamCreate(IMediaStream stream) {
            getLogger().info("onStreamCreate["+stream+"]: clientId:" + stream.getClientId());
    	IMediaStreamH264SEINotify seiListener = new SEIListener();
    
    	WMSProperties props = stream.getProperties();
    	synchronized (props)
    	{
    		props.put("SEIListener", seiListener);
    	}		
    	stream.addVideoH264SEIListener(seiListener);
    }
    Inside of the handler:

    public void onVideoH264Packet(IMediaStream stream, AMFPacket packet, H264SEIMessages seiMessages) {
    	int messageCount = seiMessage.getMessageCount();
    
    	if (messageCount > 0)
            { 
                  for (int i = 0; i < messageCount; i++)
                  {
                       H264SEIMessage message = seiMessages.getMessage(i);
                       <code to verify payload type is the type we want>
                       
                       short sequenceNumber = codeToGetSequenceNumber(message);
                       getLogger().error(sequenceNumber);  // Logging to error because it is easier to parse error log; for testing only
                  }
            }
    }
    Like I said, it works in some environments, not in others. Is there anything in regards to the handling of SEI Messages that would throttle how often the event would fire?

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

    Default

    What is the source of the stream? Are you pulling from UDP or RTP?

    To help debug, enable packet loss logging, following this article:
    http://www.wowza.com/forums/content....P-and-MPEG-TS)

    Are B-Frames turned on? If so, try turning them off.

    Richard

  3. #3

    Default

    The source is RTP. Is there something else I can try in regards to RTP?

    I've already got the logging turned on. There may be loss every few minutes or something, but nothing that corresponds to the gaps in the stream.

    I had B-frames on, but after I turned them off, it made no difference. On the dev server that I was testing with, I have B-frames turned on and all the "sequence numbers" are caught by the handler. If it helps, my (encoder's) IdrInterval is 30. B-frames are set to 0.

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

    Default

    Okay, now follow these instructions to make a recording and send to support@wowza.com :

    http://www.wowza.com/forums/showthre...gging-purposes

    Include a link to this thread for reference when you send.

    Richard

Similar Threads

  1. IMediaStreamH264SEINotify - Is it available for VOD?
    By syncmatt in forum General Forum
    Replies: 2
    Last Post: 03-30-2013, 06:53 AM
  2. IMediaStreamH264SEINotify - Does it exist?
    By syncmatt in forum General Forum
    Replies: 6
    Last Post: 08-13-2012, 08:54 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
  •