-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add method to FFmpegFrameGrabber to retrieve attached pic #1879
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
Conversation
What about adding a flag to the Frame object instead?
|
Im not sure I understand. Adding a flag to the frame object would help identify a frame with the attached pic. But I would still need to save a reference to the correct stream in the FFmpegFrameGrabber's startUnsafe() method, because finding the right stream is the bigger issue. |
I see, what about having something like FrameGrabber.setVideoDisposition() to make the match? |
Okay. So the way it would work is that you call setVideoDisposition(), then it finds the stream that contains an attached pic and sets the video stream to that. And then you would call frameGrabber.grabImage() like usual. |
Yes, that sounds like something that could work well?
|
Please let me know if you have a better idea though. Thanks! |
Sorry. I've been busy with school. Does this do the trick? |
Something like that, yes, but add a property, just like for getVideoCodecName()/setVideoCodecName(), and use it in start(). |
What exactly should I do in the start() method? |
Use the value of videoDisposition to set the videoStream, just like you did in your loop. Put that loop so it gets executed on start(). |
Did like you asked, but isn't the disposition only relevant for the FFmpegFrameGrabber and not all the other framegrabber types? |
Sure, most of the properties there only apply to FFmpeg, but maybe in the future something else is going to become more popular and then that one will start using those properties.. Anyway, there is no disadvantage in providing an abstract class like this, only potential advantages, so let's just do it! These changes look good. Did you test them to make sure they do what you need them to do? |
I couldn't get the code to compile due to some missing imports and other errors, but I hope this works. Can you by any chance test this?
#1876