A problem in playing a streamed H264 video over a network

Ibra iss_kh at yahoo.com
Tue Sep 27 02:59:00 PDT 2011


Thank you very much Tim, it is working perfectly now.

And you are right, the subject is misleading, and I now can understand why!!
sorry about this....

Ibra 




Tim-Philipp Müller-2 wrote:
> 
> On Mon, 2011-09-26 at 22:47 +0100, ibrahim suliman wrote:
> 
> Hi,
> 
>> gst-launch udpsrc caps = "video/x-h264, width=(int)176,
>> height=(int)144, framerate=(fraction)15/1,
>> codec_data=(buffer)014d401effe10018674d401e92540501ed8088000003000800000301e078b17501000468ee3c80,
>> stream-format=(string)avc" multicast-group=127.0.0.1 port=8991 !
>> h264parse ! ffdec_h264 ! ffmpegcolorspace ! autovideosink
>> 
>> It is working perfectly using the "gst-launch", but when I implement
>> it in a C application, it did not working for me and let me descibe
>> what I am thinking is the problem:
>> the "caps" property should be included for the "udpsrc" element in
>> order to get the H.264 video displayed. This "caps" property has
>> different parameters as follows:
>>  
>> filtercaps = gst_caps_new_simple ("video/x-h264",
>>   "width", G_TYPE_INT, 176,
>>   "height", G_TYPE_INT, 144,
>>   "framerate", GST_TYPE_FRACTION, 15, 1,          
>> "codec_data", ........!!!!!!!!!!,
>> 014d401effe10018674d401e92540501ed8088000003000800000301e078b17501000468ee3c80,
>> "stream-format", G_TYPE_STRING, "avc",
>> NULL); 
>>  
>> as you can see, the problem is that "codec_data" should be of type
>> (buffer) and I am not sure how to deal with this type of value. So,
>> please help in this....
> 
> So first of all your e-mail subject is slightly misleading. Your actual
> problem is about how to put a buffer into caps. You could do something
> like this:
> 
>  const guint8 codec_data[] = { 0x01, 0x4d, .... };
>  GstBuffer *buf;
>  guint size;
> 
>  size = sizeof (codec_data);
>  buf = gst_buffer_new_and_alloc (size);
>  memcpy (GST_BUFFER_DATA (buf), codec_data, size);
>  gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, buf, NULL);
>  gst_buffer_unref (buf);
> 
> I'm sure you can find more code examples if you grep the GStreamer
> plugin source code modules for "codec_data".
> 
> Cheers
>  -Tim
> 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 


--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/A-problem-in-playing-a-streamed-H264-video-over-a-network-tp3845523p3846658.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list