gstreamer-java / gst1-java-core

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

gst.main() does not wait until file is fully written #199

Closed ioah86 closed 4 years ago

ioah86 commented 4 years ago

Hey folks,

I noticed an issue. I am using gstreamer to transcode a video using this Java API. I am waiting until my transcoding is done using the Gst.main function, and once this is done, my thread is continuing to upload that video via REST to some webservice. That upload has failed for sometimes for me for inexplicable reasons, until I noticed what went wrong: I communicated the file size of the generated file before uploading, and it changed as I was uploading. Hence, gstreamer is still finishing the file write when Gst.main() is exiting and letting me continue with my Thread. This is an edge case scenario of course, but it should either be fixed or documented that a file flush may not be done in time.

Using version 1.1.0 from the Maven Repository.

neilcsmith-net commented 4 years ago

This is not something we will, or can, fix. Gst.main() is just a convenience to keep a thread alive until Gst.quit() is called. It's up to you to use signals from the underlying native library to figure out when your task has been properly completed.

For usage questions, please use the mailing list rather than the issue tracker, thanks!