Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Castillejos

Hello everyone,

I'm trying to start a stream on Wowza programmaticaly by feeding the stream myself with packets comming from GStreamer.
it enables you to publish a stream on Wowza with Java Code by feeding the stream with byte[] (packets).
What I'm trying to do is to read a mkv file on disk with gstreamer and send packets to Wowza using this API.
My Problem is that Wowza seems to doesn't recognize what's inside the packet I'm sending, see logs : 

Audio codec:PCM_BE isCompatible:false
Video codec:UNKNOWN[0] isCompatible:false

For information my video and audio packets are in h264 and aac codecs. it is 2 format that Wowza knows to read.
I Think, maybe the packets coming from GStreamer can't be sent to Wowza directly without some king of transformation or adaptation.
On the Publisher API page, there is the format of the packets for aac and h264 that is described. I don't know if GStreamer is already sending me the video and audio packets
respecting this format or if I have to do something myself with gstreamer packets before giving it to Wowza.

For more detail, this is the GStreamer Pipeline I'm using :



  
I'm trying to repacketize data coming from Gstreamer (AppSink buffers) before sending it to Wowza.
Threre is a description of Wowza Packets requirements on this page: http://www.wowza.com/resources/serverapi/4.5.0/com/wowza/wms/stream/publish/Publisher.html.
And I need for Video Packets to know the type of frame (Key, P or B) to set it in the Wowza header.
I've found that when the buffer flag has its GST_BUFFER_FLAG_DELTA_UNIT bit to 1, it is not a key frame. But I don't know if it's a P or B Frame.
Is There a way to know it ?

Nicolas Castillejos





_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Ignas Brašiškis
You can start here: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-libs/html/gst-plugins-bad-libs-h264parser.html
You need access parser class and get slice types with macros like GST_H264_IS_P_SLICE and similar functions. I am not sure how it works thought,
Did you tried to stream AAC only. It seems like your problem not gstreamer, but inability to config wowza
(
Audio codec:PCM_BE isCompatible:false
Video codec:UNKNOWN[0] isCompatible:false) tells something,
 where neither I, neither most of here can help you.

On Tue, Feb 21, 2017 at 4:14 PM, Nicolas Castillejos <[hidden email]> wrote:

Hello everyone,

I'm trying to start a stream on Wowza programmaticaly by feeding the stream myself with packets comming from GStreamer.
it enables you to publish a stream on Wowza with Java Code by feeding the stream with byte[] (packets).
What I'm trying to do is to read a mkv file on disk with gstreamer and send packets to Wowza using this API.
My Problem is that Wowza seems to doesn't recognize what's inside the packet I'm sending, see logs : 

Audio codec:PCM_BE isCompatible:false
Video codec:UNKNOWN[0] isCompatible:false

For information my video and audio packets are in h264 and aac codecs. it is 2 format that Wowza knows to read.
I Think, maybe the packets coming from GStreamer can't be sent to Wowza directly without some king of transformation or adaptation.
On the Publisher API page, there is the format of the packets for aac and h264 that is described. I don't know if GStreamer is already sending me the video and audio packets
respecting this format or if I have to do something myself with gstreamer packets before giving it to Wowza.

For more detail, this is the GStreamer Pipeline I'm using :



  
I'm trying to repacketize data coming from Gstreamer (AppSink buffers) before sending it to Wowza.
Threre is a description of Wowza Packets requirements on this page: http://www.wowza.com/resources/serverapi/4.5.0/com/wowza/wms/stream/publish/Publisher.html.
And I need for Video Packets to know the type of frame (Key, P or B) to set it in the Wowza header.
I've found that when the buffer flag has its GST_BUFFER_FLAG_DELTA_UNIT bit to 1, it is not a key frame. But I don't know if it's a P or B Frame.
Is There a way to know it ?

Nicolas Castillejos





_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Dufresne-5
In reply to this post by Nicolas Castillejos
Le mardi 21 février 2017 à 15:14 +0100, Nicolas Castillejos a écrit :
> I'm trying to repacketize data coming from Gstreamer (AppSink buffers) before sending it to Wowza.
> Threre is a description of Wowza Packets requirements on this page: http://www.wowza.com/resources/serverapi/4.5.0/com/wowza/wms/stream/publish/Publisher.html.

AMF is a well known format. It's called Adobe Media Format and is the
packetization used to produce FLV. All this looks like some different
way of doing RTMP, any reason not to use RTMP instead ?

> And I need for Video Packets to know the type of frame (Key, P or B) to set it in the Wowza header.
> I've found that when the buffer flag has its GST_BUFFER_FLAG_DELTA_UNIT bit to 1, it is not a key frame. But I don't know if it's a P or B Frame.
> Is There a way to know it ?

You would have to parse the bitstream and this is format dependant.
Though, if it's not a delta, it's a keyframe. AMF packetization does
not require this information though.

Nicolas


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Castillejos
In reply to this post by Ignas Brašiškis
this GST_H264_IS_P_SLICE function seems interesting but I don't know how to call it, the problem is that I'm in Java, I'm using the gstreamer-java binding for GStreamer 0.10.
Does somebody have already called a method like this in JAVA.
Do you think I have to add some additional implementations on the java binding to access it ?

Nicolas Castillejos
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Castillejos
In reply to this post by Nicolas Dufresne-5
Hi Nicolas,

1) Yes it's AMF Format, Wowza allow developpers to feed a stream internally (from java code of a Wowza Custom Module) , using this format. I could do rtmp to feed the stream, I know how to do it with rtmpsink but I don't do it for security reasons/constraints. I don't want my video stream to be available on network in clear. I want to Keep it internal to code.

2) I don't know why but Wowza is asking for frame type and dts-pts difference, I think it is for this reason my stream is not readable after launching it. I don't see any other reasons.

Nicolas Castillejos
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Dufresne-5
Le mercredi 22 février 2017 à 01:02 -0800, Nicolas Castillejos a
écrit :

> Hi Nicolas,
>
> 1) Yes it's AMF Format, Wowza allow developpers to feed a stream
> internally
> (from java code of a Wowza Custom Module) , using this format. I
> could do
> rtmp to feed the stream, I know how to do it with rtmpsink but I
> don't do it
> for security reasons/constraints. I don't want my video stream to be
> available on network in clear. I want to Keep it internal to code.
You should be able to use TLS with RTMP.

>
> 2) I don't know why but Wowza is asking for frame type and dts-pts
> difference, I think it is for this reason my stream is not readable
> after
> launching it. I don't see any other reasons.

You'll have to re-implement some of the logic from flvmux plus
implement some bitstream parsing to retrieve the information. Take note
that GStreamer includes parser library to help with that.

good luck,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Castillejos
the TLS should be the best & fastest solution but I didn't found any GStreamer Sink that can sends over tls.
Do you know a rtmp sink, or rtsp sink or HLS sink or udp sink that can sends stream over TLS  ?
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Dufresne-5
Le mercredi 22 février 2017 à 05:27 -0800, Nicolas Castillejos a
écrit :
> the TLS should be the best & fastest solution but I didn't found any
> GStreamer Sink that can sends over tls.
> Do you know a rtmp sink, or rtsp sink or HLS sink or udp sink that
> can sends
> stream over TLS  ?

When using rtmpsink, set the location property to "rtmps://..."

regards,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Castillejos
Thank you Nicolas,

I Will try this.
Reply | Threaded
Open this post in threaded view
|

Re: Need Help to send GStreamer H264/AAC packets to Wowza Streaming Engine

Nicolas Castillejos
In reply to this post by Nicolas Dufresne-5
Thank you again, it is working fine !

Nicolas Castillejos