-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to GStreamer 1.0 #84
Conversation
This makes the camera work on macOS.
This makes the GettingStartedCapture example at least work.
This is because GStreamer 1.12.3 does not (yet) support video device enumeration on macOS.
This introduces a new nativeFrameRate, which is the default frameRate (if not overwritten).
Suggested by Neil C Smith. Seems to work at least as good as it did before.
This miraculously makes the Reverse example work for me on macOS (the previous example file was a Theora video in a MKV container). Using the new example file I am moreover unable to make the Scratch example stop giving us frames, which it did previously (H.264 in a QuickTime MOV). Since H.264 in a MP4 container seems to be the most reasonable default these days anyhow, let's try at least for a while. Feel free to re-compress the example file to make it smaller though.
endOfStream was only handling the case of 0 < rate.
We can't construct the pipeline solely from a string on Linux, where we're getting an Element back from Device.createElement(). After trying many simpler solutions, this was the best that worked. It involved moving parts from initSink() up to initGStreamer() among others.
This takes a long time at least on Linux.
This is required to prevent a crash on macOS.
Just having a quick look at this - couple of comments I'd make.
2c 😄 |
@neilcsmith Care to send patches? Can test them on all platforms easily now |
Working code is the most important thing! So, if it's working now I'd merge and think about simplifying later. I'll look a bit more into this as I want to solve it properly for a few other things. The problem with I'm currently only setting the ENV variables on Windows using |
I'm happy to see it finally there! :) I tested all examples on my Linux laptop and they work fine. Would it make sense to mention somewhere that people can delete the libraries for other OSes to save some space? Btw: .zip = 270Mb, .7z = 160Mb |
@hamoid |
@gohai it looks like the old library lists resolutions. You can use the The |
@neilcsmith-net The play/pause/play didn’t make a difference when I tried
removing it. I can only assume it was added for some reason at some point,
so I am hesitant to removing it. Let’s first check if the single-frame
behavior is indeed different compared to the old lib…
…On Sun 26. Nov 2017 at 14:25, Neil C Smith ***@***.***> wrote:
@gohai <https://github.com/gohai> it looks like the old library lists
resolutions. You can use the Caps from each Device, loop through all the
embedded structures (use caps.size()) and query them for width & height.
Note that you'll get a structure for each supported format, so discard
duplicate resolutions. And probably good to check the structure has the
required fields too - (structure.hasIntField("width") etc.) Tested on
Ubuntu and it seems to work correctly.
The Frames example may also not like the play(), jump(), pause()
behaviour - you can seek in the paused state if you implement the pre-roll
handler as mentioned before.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#84 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEt2K2mUQkM5bb45ODzp3ljYlVdFM-6Hks5s6WbbgaJpZM4Qpvs1>
.
|
@gohai I know why it was added - to force a signal to be emitted to update the image - but the pre-roll listener is a better way to do this. By setting it to play and then pause you might end up a frame or two away from where you seek to. Another cause of this issue is that you're not setting the accurate seek flag. Couple this with an mp4 file and it's not ideal. I'd add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gohai this is very good work. I think you cover the most obvious improvements in the description of the PR. I would only add that this should become version 2 of the video library, don't you think?
Here are some hints for reducing the size of the library, taken from this FOSDEM presentation:
|
@gohai that second point is interesting, but surely more so at the export sketch level? Is having all 3 platforms for the native libs really needed? What about a wizard that auto-downloads and extracts the right library? Then possibly an export sketch function that only includes the required libs for all platforms as determined by running the sketch? There's some potential for some shared work there. Was about to say you could probably ditch 32-bit libs as well, but I see that Processing still provides a 32-bit Windows download?! Is that really necessary these days? Incidentally, the beta seems to have JNA 4.2? That's below the recommended min version. @codeanticode thanks for the recognition of the immense amount of time that went in upstream to making this work! 😜 |
Thank you so much for fixing this. Tested working on Manjaro Linux 64bit. I was really worried for a minute there! Doesn't work with Processing 2.1 though. Guess I need to work out how to compile this with Java 1.6 - some of my sketches still aren't updated to Processing 3. |
Thanks!! |
Here is a ZIP file for you to try:
https://github.com/gohai/processing-video/releases/tag/v1.0.2
There's still room for improvement here - an incomplete list:
The release is currently way bigger because this is including all available GStreamer plugins and related libraries - would be great to find a minimal subset (but e.g.
libav
seems to be needed to play H.264-encoded videos, and this alone is about 100 MB - unclear)I noted too late that the
Capture
class was justMovie
renamed and some additions bolted onto it. Unnecessary functions (e.g.seek()
) should be cleaned up, or the current code back-ported onto the originalCapture
class.Device enumeration is currently not available on macOS. That's a limitation with GStreamer.
Is
Capture.list()
supposed to return available resolutions also?Many system-wide GStreamer-installations on Linux won't be able to play H.264 because of its patent situation. Perhaps it'd be a good idea to rename the
Loop
example toBasic
- so that it is first alphabetically, and hopefully also the first users will try. For this example we could bundle a webm or Ogg Theora encoded file.It'd be great to have clear instructions for Linux which packages to install.