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 support for video rotation #50

Open
roelvdwater opened this issue May 7, 2023 · 6 comments
Open

Add support for video rotation #50

roelvdwater opened this issue May 7, 2023 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@roelvdwater
Copy link

Hi,

I have been using FlashCap for one of my personal projects recently and I'm really happy with it and the performance also seems to be really good from the first impressions. However, one option that I'm really missing is to rotate the video. For some reason my camera delivers the feed with a 90 degrees rotation and I cannot find a way to make this work. Locally (Windows) I have it working using Magick.NET, but on my Raspberry Pi, which is where the app is running on, this doesn't work. This made me wonder if this feature is something that should be built into this library.

I'd like to hear your opinion on this.

@kekyo
Copy link
Owner

kekyo commented May 10, 2023

Thanks for using FlashCap!

So you are saying that the camera you are using (in other applications) can rotate the angle of view? Perhaps that is because of the capture device properties that the camera has that can be manipulated. If this feature is available, I imagine it would be much more efficient than trying to rotate the angle of view after the fact, since the rotation would be hardware-based.

There is currently an attempt in FlashCap to make the capture device properties manipulatable (#42)
The immediate goal of this PR is to support only DirectShow devices, although I would like to support V4L2 in the future.

By the way, I have not confirmed this, but I think SkiaSharp can also be used to rotate the angle of view. However, SkiaSharp is software-based, even though it is fast, so it may be tough to process in real time.

@roelvdwater
Copy link
Author

Thank you for your reply. I have played around with the camera a little bit yesterday and found out that if you physically rotate the camera, it will also rotate the feed. This means that if you hold it upside down, the feed is upside down as well. In my personal case it fits better to use the camera in portrait mode, although I think that the camera is meant to be used horizontally, as that's how the view looks correct when using the maximum resolution of 1920x1080.

I have tried a number of different libraries, like Magick.NET, ImageSharp and SkiaSharp but none seem to be working on a Raspberry Pi (armv7), which is where I have my webcam connected to, so I was wondering if there is some way to build this into the library "natively".

@kekyo
Copy link
Owner

kekyo commented May 11, 2023

I have tried a number of different libraries, like Magick.NET, ImageSharp and SkiaSharp but none seem to be working on a Raspberry Pi (armv7)

That is very unfortunate (I thought it included armv7 binaries for RPi...) I consider it one of the issues I would like to tackle if I can find the time.

@kekyo kekyo added enhancement New feature or request help wanted Extra attention is needed labels May 11, 2023
@roelvdwater
Copy link
Author

roelvdwater commented May 16, 2023

Apparently Magick.NET only has support for the 64-bit version of Raspberry Pi OS. Luckily I had another Raspberry Pi that I was able to install the 64-bit version of Raspberry Pi OS on and I can tell you it is working with the Magick.NET-Q8-AnyCPU NuGet Package, but the performance is really poor, so I'm going to see what I can do to make the performance better. Once I find a way to achieve this, I'll share the relevant code.

@CanIraktan
Copy link

Apparently Magick.NET only has support for the 64-bit version of Raspberry Pi OS. Luckily I had another Raspberry Pi that I was able to install the 64-bit version of Raspberry Pi OS on and I can tell you it is working with the Magick.NET-Q8-AnyCPU NuGet Package, but the performance is really poor, so I'm going to see what I can do to make the performance better. Once I find a way to achieve this, I'll share the relevant code.

Hello, were you able to find a performant solution?

@roelvdwater
Copy link
Author

I haven't had time to work on it recently. I might pick this up somewhere in the future when I have some more time hopefully.

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

No branches or pull requests

3 participants