Skip to content
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

add a realtimeStreaming example #1659

Merged
merged 16 commits into from
Jun 11, 2021
Merged

Conversation

wangxi761
Copy link
Contributor

#1633

first , add a realtimeStreaming example than can Simulate the "-re" parameter in ffmpeg

@saudet
Copy link
Member

saudet commented Jun 4, 2021

Thanks! Could you instead put that directly in FFmpegFrameGrabber.grab() with a new flag like boolean atFrameRate though?

@wangxi761
Copy link
Contributor Author

@saudet
sure,Originally planned。
but It takes me some time to finish it , so I will give an example first

@saudet
Copy link
Member

saudet commented Jun 4, 2021

Thanks! If you're having problems building JavaCV or something, let me know and I'll help you out.

@wangxi761
Copy link
Contributor Author

    public synchronized Frame grabFrame(boolean doAudio, boolean doVideo, boolean doProcessing, boolean keyFrames, boolean doData) 

this methond may be a bad design ,As a low-level execution method, it uses the public declare。if we add a param to this ,
Other people's call may be broken.
do you think so? i would make it private in other method and Keep its reference
@saudet

@saudet
Copy link
Member

saudet commented Jun 4, 2021 via email

@wangxi761
Copy link
Contributor Author

build project with some dependency error
image

@wangxi761
Copy link
Contributor Author

another question , i want to write some unit test in /platform/test
but how can i read file in ci process @saudet

@saudet
Copy link
Member

saudet commented Jun 4, 2021

build project with some dependency error

You can ignore that class, it's deprecated.

another question , i want to write some unit test in /platform/test
but how can i read file in ci process @saudet

What do you mean? It's just a normal machine, we can read files normally.

@wangxi761
Copy link
Contributor Author

while all test is ok , in my local machine . I don't know if the file for the build machine exists . like such code in FrameGrabberTest.java

        File tempFile = new File(Loader.getTempDir(), "test.mkv");

Does it run unit tests when it is built? If not, I will ignore it

@wangxi761
Copy link
Contributor Author

well ,function has been implemented,we can use it by two way

FFmpegFrameGrabber.grabFrame(true,true,true,false,true,true))

or

FFmpegFrameGrabber.setOption("re","true");

@saudet
Copy link
Member

saudet commented Jun 4, 2021

while all test is ok , in my local machine . I don't know if the file for the build machine exists . like such code in FrameGrabberTest.java

        File tempFile = new File(Loader.getTempDir(), "test.mkv");

Does it run unit tests when it is built? If not, I will ignore it

The file will exist if you create it. I still don't understand what you're worried about. Just try it and if it doesn't work, then we can look at the error message.

FFmpegFrameGrabber.setOption("re","true");

Please don't do that, create a new property like isAtFrameRate() and setAtFrameRate() for that please, and then remove the atFrameRate flag from grab().

remove "re" check from startUnsafe()
add a atFrameRate field
@wangxi761
Copy link
Contributor Author

@saudet
It's done and the local test has passed

@saudet
Copy link
Member

saudet commented Jun 4, 2021

Since this doesn't depend on FFmpeg and we can use it with others like OpenCVFrameGrabber, how about we move this to the parent class FrameGrabber?

@wangxi761
Copy link
Contributor Author

According to the current FrameGrabber design, it is not easy. Different subclasses like OpenCVFrameGrabber/FFmpegFrameGrabber directly implement the grab() method.
If the grab() method of the parent class is transformed into a template method pattern, we can implement it in the parent class, but I don't know much about other implementations, do they need such a function?

@saudet
Copy link
Member

saudet commented Jun 5, 2021 via email

@wangxi761
Copy link
Contributor Author

Do all subclasses need this parameter? if not

@saudet
Copy link
Member

saudet commented Jun 8, 2021

I would do this without a new property, just one new method.

@wangxi761
Copy link
Contributor Author

well , add a method to FrameGrabber and a unit test FrameGrabberRealTimeTest

@saudet
Copy link
Member

saudet commented Jun 11, 2021

Looks good, thanks! But the test is failing...

@wangxi761
Copy link
Contributor Author

because i remove the video path and rtmp server path when i commit ,They only exist in my local

@saudet saudet merged commit b296014 into bytedeco:master Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants