Skip to content

Fix opencv issue #22721 #3380

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

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

cudawarped
Copy link
Contributor

@cudawarped cudawarped commented Nov 22, 2022

Fix opencv/opencv#22721 (comment)

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@cudawarped cudawarped force-pushed the fix_video_writer_python_bindings branch from 61ccc36 to 9b87bed Compare November 22, 2022 08:15
@asmorkalov asmorkalov self-requested a review November 22, 2022 10:09
@asmorkalov asmorkalov self-assigned this Nov 22, 2022
@asmorkalov asmorkalov changed the title Fix opencv/#22721 Fix opencv issue #22721 Nov 22, 2022
@@ -61,12 +61,6 @@ GUID EncodingProfileGuid(const EncodeProfile encodingProfile);
GUID EncodingPresetGuid(const EncodePreset nvPreset);
bool Equal(const GUID& g1, const GUID& g2);

EncoderParams::EncoderParams() : nvPreset(ENC_PRESET_P3), tuningInfo(ENC_TUNING_INFO_HIGH_QUALITY), encodingProfile(ENC_CODEC_PROFILE_AUTOSELECT),
Copy link
Member

@alalek alalek Nov 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are should be implementation in the #else branch:

#else // !defined HAVE_NVCUVENC

... CV_Error(...NotImplemented...) implementation stubs for public API ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createVideoWriter has this else branch. With the changes parameters structure could be created correctly without linker issue, but createVideoWriter raises the issue. I propose to merge the PR as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to the header to mirror the way cudacodec::FormatInfo() is implemented.

Both structs can exist without the Nvidia Video Coded SDK being installed whether they should or not is a different matter. Do you want me to move the implementation of both into the .cpp and prevent their use when HAVE_NVCUVENC and/or HAVE_NVCUVID are not defined?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to have config structures always available how it's done in PR.

@asmorkalov asmorkalov merged commit 871d14a into opencv:4.x Nov 23, 2022
@alalek alalek mentioned this pull request Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined symbol cudacodec EncoderParams for OpenCV 4.6.0 with python 3.10.6
3 participants