get compressed video frame size (x264 or omxh264enc)

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

get compressed video frame size (x264 or omxh264enc)

Jake Zhang
Greetings,

I am looking for a way to get the compressed 264 or 265 video frame size to track the actual output bitrate of my encoders. video-info has frame size but that is in raw image domain. I also tried adding pad probe on encoder src pad but the size I got is still frame size before compression. Does any have idea how to get the compressed video frame size?


Thanks in advance 

Jake

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

Re: get compressed video frame size (x264 or omxh264enc)

Arjen Veenhuizen
You can add a BUFFER pad_probe on the encoder's src pad and query the GStBuffer size using get_size() in its callback.
Reply | Threaded
Open this post in threaded view
|

Re: get compressed video frame size (x264 or omxh264enc)

Jake Zhang
I believe I have tried that and the gst_buffer_get_size() will return the raw video frame size even you polling it on encoder source pad. 

On Wed, Aug 24, 2016 at 1:00 AM, Arjen Veenhuizen <[hidden email]> wrote:
You can add a BUFFER pad_probe on the encoder's src pad and query the
GStBuffer size using get_size() in its callback.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/get-compressed-video-frame-size-x264-or-omxh264enc-tp4679216p4679219.html
Sent from the GStreamer-devel mailing list archive at 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
Reply | Threaded
Open this post in threaded view
|

Re: get compressed video frame size (x264 or omxh264enc)

Tim Müller
On Wed, 2016-08-24 at 06:22 -0400, Jake Zhang wrote:

I believe I have tried that and the gst_buffer_get_size() will return the raw video frame size even you polling it on encoder source pad. 

That sounds like a bug in your encoders then.

e.g. see

gst-launch-1.0 videotestsrc ! identity silent=false ! x264enc ! fakesink silent=false -v

shows size in bytes for each buffer going into the encoder (identity) and coming out of it (fakesink).

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com

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

Re: get compressed video frame size (x264 or omxh264enc)

Jake Zhang
Thanks Tim and Arjen. I made a silly mistake by adding the probe function on sinkpad instead of srcpad. After fixing that I got the correct compressed video frame size. 




On Wed, Aug 24, 2016 at 6:38 AM, Tim Müller <[hidden email]> wrote:
On Wed, 2016-08-24 at 06:22 -0400, Jake Zhang wrote:

I believe I have tried that and the gst_buffer_get_size() will return the raw video frame size even you polling it on encoder source pad. 

That sounds like a bug in your encoders then.

e.g. see

gst-launch-1.0 videotestsrc ! identity silent=false ! x264enc ! fakesink silent=false -v

shows size in bytes for each buffer going into the encoder (identity) and coming out of it (fakesink).

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.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