Results 1 to 8 of 8

Thread: Publishing raw RTP packets

  1. #1

    Default Publishing raw RTP packets

    Hi,
    I'm listening using my own RTP socket implementation and receiving and parsing the packets including the version, padding, extension, csrc count, marker, payload type, sequence number, time-stamp, ssrc and the data itself.
    The codec are H.264 and G.722.
    Basically I use similar code to publish the stream:

    publisher = Publisher.createInstance(vhost, appInstance.getApplication().getName(), appInstance.getName());
    publisher.setFileExtension("flv"); // I tried also mp4
    publisher.setStreamType("live-record");
    publisher.publish(currentStreamName, "live");

    byte[] rawBuf = rtpPacket.getData();
    if (rtpPacket.getPayloadType() == G722)
    publisher.addAudioData(rawBuf, 0, rawBuf.length, rtpPacket.getTimestamp());
    if (rtpPacket.getPayloadType() == H264)
    publisher.addAudioData(rawBuf, 0, rawBuf.length, rtpPacket.getTimestamp());
    I also recording the content.
    The stream and the recorded file are not playable.

    Can you please offer me a better solution or help me understand what I do wrong?

    Thanks,
    T.

  2. #2

    Default

    Hi,

    Wowza does not use RTP packets directly as you are trying to do. It first passes them through a depacketizer that reassembles them into AMFPackets.

    RTP video packets are normally fragments of complete video packets and the timecodes are based on video clock cycles (90K clock). RTP audio packets have their timecodes based on the sample rate. AMFPacket timecodes are based on wall clock values and are in milliseconds.

    If you push your RTP stream into a pair of ports that wowza is listening to (use an rtp mediaCaster on wowza to connect to the source stream), then Wowza will be able to create an inbound stream and depackatize your rtp stream into AMFPackets. You can then monitor the packet list of the stream and get the AMFPackets. Use stream.getPlayPackets() to get the currently available packets that you can insert into your publisher stream. You may need to provide an sdp file for Wowza to know how to read your source stream

    As each packet is inserted into the inbound stream, it is allocated a sequence number. You need to track this sequence number to make sure you are not reinserting the same packets into the publisher stream.

    Roger.

  3. #3

    Default

    Thank you.

    I don't need to monitor the packets, I just want to listen on RTP that its signaling is SIP and not RTSP.
    Would it be more simple to use Wowza RTPPort, RTPStream and RTPSession classes to listen on the port I need?
    Can I initialize RTPPort that will be already assigned to my appInstance?

    Thanks,
    T.

  4. #4

    Default

    Or,
    Would it be more simple to build the stream header using FLVUtils.writeHeader or RTPUtils.formatH264CodecConfigPacket and write it into the publisher?

    Thanks,
    T.

  5. #5

    Default

    Could you please direct me to code example or documentation explaining how to implement it using the mediaCaster?

    Thanks,
    T.

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

    Default

    This example demonstrates use of IMediaStream.getPlayPackets()

    Richard

  7. #7

    Default

    Thanks Richard, but I have no interest in monitoring the packets.
    My only interest is to stream the packets, by adding them the h.264 myself, by using a tool that the Wowza server can supply, or by using Wowza server RTP sockets in the first place instead of my socket.
    In fact, the only reason I implemented my own RTP socket is because I don't know how to initialize a listening RTP socket in Wowza using my custom port on RTPPort class.

    T.

  8. #8

    Default

    Hi,

    We are not really sure what it is that you are wanting to do and I think the best approach will be to open a ticket with support@wowza.com. Please explain in detail what you are wanting to do. Also, please link to this thread.

    Roger.

Similar Threads

  1. wowza rtp packets over udp or tcp?
    By z297470279z in forum Live Streaming and Encoder Discussion
    Replies: 5
    Last Post: 01-14-2013, 06:41 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
  •