x264) I received a buf using GstBuffer.

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

x264) I received a buf using GstBuffer.

OhsureBoy

GstMapInfo map;
  gsize size;

  gst_buffer_map (buf, &map, GST_MAP_WRITE);
  size = gst_buffer_get_size (buf);

for(int i = 0; i < 15; i++) {
      g_print("%d  ", map.data[i]);
    }


====================
When I ran the above source code, the log came out like this

0  0  0  1  9  16  0  0  0  1  103  122  0  40  188  

0  0  0  1  9  48  0  0  1  65  154  36  108  65  15  

0  0  0  1  9  80  0  0  1  65  158  66  120  132  127

0  0  0  1  9  80  0  0  1  1  158  97  116  70  255  

0  0  0  1  9  80  0  0  1  1  158  99  106  70  255  

0  0  0  1  9  48  0  0  1  65  154  104  73  168  65  

0  0  0  1  9  80  0  0  1  65  158  134  69  17  44  

0  0  0  1  9  80  0  0  1  1  158  165  116  70  255  

0  0  0  1  9  80  0  0  1  1  158  167  106  70  255


===================================

As far as I know, doesn't the first 0 0 0 1 have to be 0 0 0 2 when the next
buffer comes in?
Or is there any place that says about this buffer?

Thanks for reading







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

Re: x264) I received a buf using GstBuffer.

Nicolas Dufresne-5
Le mardi 13 avril 2021 à 01:53 -0500, OhsureBoy a écrit :

> GstMapInfo map;
>   gsize size;
>
>   gst_buffer_map (buf, &map, GST_MAP_WRITE);
>   size = gst_buffer_get_size (buf);
>
> for(int i = 0; i < 15; i++) {
>       g_print("%d  ", map.data[i]);
>     }
>
>
> ====================
> When I ran the above source code, the log came out like this
>
> 0  0  0  1  9  16  0  0  0  1  103  122  0  40  188  
>
> 0  0  0  1  9  48  0  0  1  65  154  36  108  65  15  
>
> 0  0  0  1  9  80  0  0  1  65  158  66  120  132  127
>
> 0  0  0  1  9  80  0  0  1  1  158  97  116  70  255  
>
> 0  0  0  1  9  80  0  0  1  1  158  99  106  70  255  
>
> 0  0  0  1  9  48  0  0  1  65  154  104  73  168  65  
>
> 0  0  0  1  9  80  0  0  1  65  158  134  69  17  44  
>
> 0  0  0  1  9  80  0  0  1  1  158  165  116  70  255  
>
> 0  0  0  1  9  80  0  0  1  1  158  167  106  70  255
>
>
> ===================================
>
> As far as I know, doesn't the first 0 0 0 1 have to be 0 0 0 2 when the next
> buffer comes in?
> Or is there any place that says about this buffer?

0 0 0 1, is a four byte start code used in notably H264 and HEVC CODEC. By
default, the encoder will produce 1 buffer per frame, with the first NAL being
an AUD (9).

>
> Thanks for reading
>
>
>
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> 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