Query the negotiated framerate in the caps - how?

Graham Leggett minfrin at sharp.fm
Sat Aug 22 08:16:59 PDT 2015


On 22 Aug 2015, at 2:09 AM, Graham Leggett <minfrin at sharp.fm> wrote:

> Now for the next problem - it appears that even though the updated framerate is replacing the previous framerate in the tag, what ends up in the final JPEG is the first attempt at writing the tag only:
> 
> pi at raspberrypi4 ~/packages/gstreamer-1.5/gst-plugins-base $ identify -verbose /var/www/stream/frame.jpg | grep unknown
>    unknown: 0/1
> 
> What is expected in the EXIF is:
> 
>    unknown: 25/1
> 
> (“unknown” because imagemagick does not yet fully understand framerate from CinemaDNG)
> 
> The rest of the pipeline looks like this:
> 
> … ! videotag ! videorate ! video/x-raw,framerate=1/1 ! jpegenc ! jifmux ! queue ! multifilesink location=/var/www/stream/frame.jpg
> 
> Stepping through the EXIF writing code shows that write_exif_signed_rational_tag_from_taglist() is called on every JPEG write, as expected, but the value being written is the same pointer value every time, this never changes from the contents of the very first time the tag is written.
> 
> Is there something I am missing?

For the record I was missing two things.

The default behaviour of any element (like jifmux) that implements the GstTagSetter interface only takes into account the first tag written. All subsequent tag updates are ignored unless this API is used to override that:

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstTagSetter.html#gst-tag-setter-set-tag-merge-mode

I needed to update the jifmux element to support the above system call, it has been added here:

https://bugzilla.gnome.org/show_bug.cgi?id=753964

The second thing I was missing is that I was attempting to set the framerate in the sink_event() callback and the image number in the  transform_ip() callback, the framerate was “stuck” on the very first value that was written, but the image number incremented as expected.

Setting both the image_number and the framerate in the transform_ip() at the same time brought sanity back, and these two values correctly appeared in the JPEGs.

Regards,
Graham
—



More information about the gstreamer-devel mailing list