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 interrupt callback with default timeout of 30s. #6053

Merged
merged 1 commit into from Feb 4, 2016
Merged

Add interrupt callback with default timeout of 30s. #6053

merged 1 commit into from Feb 4, 2016

Conversation

peters
Copy link
Contributor

@peters peters commented Feb 3, 2016

In order to speed up the review process I've set up a x64 debug/release project over at https://github.com/peters/opencv.ffmpeg with the latest official ffmpeg 2.8.5 binaries included.

Fixes #5730.

/cc @alalek @vpisarev

@alalek
Copy link
Member

alalek commented Feb 4, 2016

Thanks! Look good to me.
Interrupt callback has been added since: "2011-11-13 - lavf 53.21.0 / 53.15.0" , so conditional compilation may required for some legacy versions of ffmpeg.
I checked Ubuntu 12.04 LTS, there is ffmpeg format 53.21.1, so it is fine. I hope ROS builds will pass also.

Could you please squash commits into one (git rebase -i HEAD~4)

Fix docs build failure by re-indenting with spaces instead of tabs.

Trailing whitespace fixes. http://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/5152/steps/whitespace/logs/stdio

mingw build fix.
@peters
Copy link
Contributor Author

peters commented Feb 4, 2016

Thanks! Look good to me.

Awesome 👍

Could you please squash commits into one (git rebase -i HEAD~4)

Done

I hope ROS builds will pass also

Is those builds internal because I can't find them in the waterfall overview.

@peters
Copy link
Contributor Author

peters commented Feb 4, 2016

What is the reason hardware accelleration is disabled for the windows build? There is some documentation over at https://trac.ffmpeg.org/wiki/HWAccelIntro. But I don't want to spend more time on this if there is nothing to gain from it :)

@alalek
Copy link
Member

alalek commented Feb 4, 2016

👍

@alalek
Copy link
Member

alalek commented Feb 4, 2016

What is the reason hardware accelleration is disabled for the windows build?

I believe to reduce size of binaries and additional dependencies for mingw builds

@peters
Copy link
Contributor Author

peters commented Feb 4, 2016

Aha, then I have much to gain from pursuing this further. I'll do some research and possibly create a repository on github allowing hardware accelleration on Windows for those who need it :)

@peters
Copy link
Contributor Author

peters commented Feb 4, 2016

The build is failing, but it appears unrelated to my changes.

@opencv-pushbot opencv-pushbot merged commit da48061 into opencv:master Feb 4, 2016
opencv-pushbot pushed a commit that referenced this pull request Feb 4, 2016
@peters
Copy link
Contributor Author

peters commented Feb 4, 2016

@alalek Thanks for reviewing this so fast. I'm going to donate the 500$ bounty to opencv foundation just for that 👍 🏆

@sturkmen72
Copy link
Contributor

what should i do to take effect of this fix. i recompiled the library but nothing has changed. should i download opencv_ffmpeg.dll ? or i missed something when rebuild the library.

@alalek
Copy link
Member

alalek commented Feb 7, 2016

OpenCV build for Windows uses prebuilt binaries with ffmpeg wrapper. And they are not updated and not integrated into OpenCV yet.

I prepared the latest version of ffmpeg wrapper binaries, but they are not tested (also ffmpeg release is not updated). They are build via this script (Linux with Docker is required)

Also you can use this OpenCV patch, which automatically downloads ffmpeg binaries.

Or you can try to replace ffmpeg.dll's from there, but this may require to disable CMake downloader

@sturkmen72
Copy link
Contributor

@alalek thank you so much

@BitLoose
Copy link

@alalek I'm using VS2015 on Windows, would like to modify and compile the functions such as icvSetCaptureProperty_FFMPEG_p etc., but can't find the source code. Is it available?

@alalek
Copy link
Member

alalek commented Feb 11, 2016

It is just an imported symbols from ffmpeg windows wrapper.
Implementation is here, but it is not easy to build ffmpeg wrapper (refer to https://github.com/Itseez/opencv_3rdparty/tree/ffmpeg/master/ffmpeg). Also you may try to use approach from this PR description.

@BitLoose
Copy link

That's a shame, if it was more accesible people would be more able to add to the code.
What's the best way in your opinion to add the audio stream playback?

@peters
Copy link
Contributor Author

peters commented Feb 12, 2016

@BitLoose It's actually really easy to make changes to the wrapper on Windows. Just grab my project over at https://github.com/peters/opencv.ffmpeg and hit F5.

@PatriciaReyes
Copy link

@alalek how can I update opencv_ffmpeg.dll for linux?

@alalek
Copy link
Member

alalek commented Apr 21, 2016

@PatriciaReyes There is no separate opencv_ffmpeg.dll on Linux. To enable ffmpeg support in OpenCV you need to install ffmpeg development packages (-dev/-devel, depends on Linux distribution) and rerun OpenCV CMake

@PatriciaReyes
Copy link

@alalek Thanks, i'm going to check that to make sure i'm doing it fine... I have this big issue, do you think you could help me with it? [http://stackoverflow.com/questions/36750685/c-suddenly-blocks-on-reading-a-frame-from-ip-camera-using-videocapture/36756653?noredirect=1#comment61124042_36756653]

@marcassin22
Copy link

@peters I've managed to make your project work but I can't find how to use it with my other projects. Should I just copy the dll's or I need to recompile OpenCV with them?

@michaildrozdov
Copy link

@peters Even after all these years it saved my day.:)

@cbasavaraj
Copy link

Hi, does the solution here work even for capturing gstreamer pipelines? For example,
cv2.VideoCapture("fake ! gstreamer ! pipeline", cv2.CAP_GSTEAMER)
Thanks

@lidorshimoni
Copy link

Hi, does the solution here work even for capturing gstreamer pipelines? For example,
cv2.VideoCapture("fake ! gstreamer ! pipeline", cv2.CAP_GSTEAMER)
Thanks

did you manage to implement the timeout with gstreamer pipeline?

@cbasavaraj
Copy link

Hi @lidorshimoni, I found this workaround, and adapted it for my purpose. Happy holidays!

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.

Indefinite hang when connecting to a rtsp stream
10 participants