gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
188 stars 72 forks source link

Buffer has no PTS. #203

Closed honcharenko-roman closed 3 years ago

honcharenko-roman commented 3 years ago

While using gst-java wrapper and omxh264enc on Raspberry pi, encoding failing with "Buffer has no PTS" issue. It's a well-known issue, it has been worked around. In Python I can do:

GstBase.BaseParse.set_infer_ts(h264parse_element, True) GstBase.BaseParse.set_pts_interpolation(h264parse_element, True)

Is it possible to do basically the same thing in Java? I didn't found BaseSrc class extended from Element as it documented by GStreamer.

image

image

I'm using org.freedesktop.gstreamer library version 0.9.4, tried last one - 1.2, but the result is the same. Java 8

neilcsmith-net commented 3 years ago

GstBaseParse isn't mapped at present. I'm not sure if there's another workaround? These settings aren't exposed as properties as far as I can tell, so generic GObject::set is out. There is also the ability to set PTS directly on the Buffer.

Obviously, a PR to map GstBaseParse would be ideal :smile: but you could also map the functions you need directly using JNA, and extract the raw pointer from the element using the Natives class.

Don't use 0.9.4 by the way. Lots of changes and fixes between there and 1.2, including the above mentioned Natives class.

honcharenko-roman commented 3 years ago

Thanks a lot for a fast response! I will continue digging and investigating in directions you pointed.

honcharenko-roman commented 3 years ago

For those who are looking for a solution (not quite sure about gstapp but works well): image

And use: image

Probably later will do a PR with GstBaseParse implementation.