Skip to content

Split videoio module to independent package and support FFMPEG for all platforms #254

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

Closed
rainyl opened this issue Sep 28, 2024 · 2 comments · Fixed by #262
Closed

Split videoio module to independent package and support FFMPEG for all platforms #254

rainyl opened this issue Sep 28, 2024 · 2 comments · Fixed by #262
Labels
enhancement New feature or request

Comments

@rainyl
Copy link
Owner

rainyl commented Sep 28, 2024

Personally, I think supporting FFMPEG for all platforms is necessary, since there are many issues about VideoWriter and VideoCapture.

Several principles:

  • uniform FFMPEG version (FFMPEG 6.1 is selected for now)
  • better for same modules (opencv requires avutil, avcodec, avformat, swscale)
  • minimal package size

Status & problems

I have worked on this for about 5 days and finish it successfully, but it is not elegant (so I published v1.2.5, originally I want this feature to be included in v1.2.5 😮‍💨).

  • with custom compiled FFMPEG, opencv will link it via absolute path, leading to a difficult redistribution (solved by linking via target and a new ffmpeg-config.cmake)
  • with current compile script, the entire library will depends on ffmpeg, for those who doesn't need FFMPEG, it will be unnecessary.

Solutions

  1. split the entire package to several plugins (or federated plugins), e.g., opencv_core, opencv_imgproc, etc.
    • Pros:
      • allow users to avoid introducing unnecessary modules and reduce the package size.
      • can publish binaries to pub.dev and no need to download (maybe)
      • easy to maintain and avoid compile/publish the entire package
    • Cons:
      • much works to do and I have no much time, so may need a long time to finish
      • need to figure out the dependencies of different modules
      • other problems I haven't thought of.
  2. split the videoIO module, e.g., opencv_videoio, which depends on opencv_dart
    • Pros:
      • relatively easy to work on.
    • Cons:
      • not elegant
      • basically same as before, need to download binaries.
  3. keep the current package and provide an option to download binaries with ffmpeg included
    • Pros:
      • the best compatibility
    • Cons:
      • more binaries to be compiled and published

Personally I prefer option 1 now, what do you think? @abdelaziz-mahdy

@rainyl rainyl added the enhancement New feature or request label Sep 28, 2024
@abdelaziz-mahdy
Copy link
Contributor

I understand the benefits of splitting the modules, but that will cause confusion for people since open cv is one module in Python 😅

So bundling ffmpeg being optional will be awesome, also you can make a minimal ffmpeg version by removing codecs that are not used like media_kit does and fvp, which will make the bundle size small

Also due to you not having time I guess the fastest workaround for now is the way to go,and when you have time for the others it can look into the others.

@rainyl
Copy link
Owner Author

rainyl commented Sep 28, 2024

Yes you are right. Thanks ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants