Comments (7)
Hello. Are you saying that you want to get default value of tilt, zoom, exposure, brightness, contrast, and so on?
from usbcamera.
Hi,
First, thank you for your answer.
No,
I know how to get default value of tilt, zoom.
I don't know how i get current value, and how i set or call preset in/from camera memory. Over UVC usb
If i connect camera to RS232 i send command VISCA
81 01 04 00 02 FF - On
81 01 04 00 03 FF - Off
81 01 04 3D 02 FF - CAM WDR On
81 01 04 3D 03 FF - CAM WDR Off
81 01 04 33 02 FF - BlackLight On
81 01 04 33 03 FF - BlackLight Off
Call preset 1/2
81 01 06 01 VV WW 01 03 FF
81 01 06 01 VV WW 02 03 FF
I am work in IT department high school. We have 100 hybrid class ( camera and mic )
I need create small program for control ptz camera.
from usbcamera.
Are you meaning the word 'preset' is a set of tilt, zoom, exposure, brightness..., that is saved on camera memory, and you want to switch these properties at once? My library use DirectShow, and I do not know such method in DirectShow.
To get current value, you have to change source code a little. could you try this?
line 254: current
public Property(int min, int max, int step, int @default, int flags, Action<DirectShow.CameraControlFlags, int> set)
{
this.Min = min;
this.Max = max;
this.Step = step;
this.Default = @default;
this.Flags = (DirectShow.CameraControlFlags)flags;
this.CanAuto = (Flags & DirectShow.CameraControlFlags.Auto) == DirectShow.CameraControlFlags.Auto;
this.SetValue = set;
this.Available = true;
}
is change to
public Func<int> GetValue { get; private set; }
public Property(int min, int max, int step, int @default, int flags, Action<DirectShow.CameraControlFlags, int> set, Func<int> get)
{
this.Min = min;
this.Max = max;
this.Step = step;
this.Default = @default;
this.Flags = (DirectShow.CameraControlFlags)flags;
this.CanAuto = (Flags & DirectShow.CameraControlFlags.Auto) == DirectShow.CameraControlFlags.Auto;
this.SetValue = set;
this.GetValue = get;
this.Available = true;
}
line 201: current
prop = new Property(min, max, step, def, flags, (flag, value) => cam_ctrl.Set(item, value, (int)flag));
is change to
Func<int> get = () =>
{
int value = 0;
cam_ctrl.Get(item, ref value, ref flags);
return value;
};
prop = new Property(min, max, step, def, flags, (flag, value) => cam_ctrl.Set(item, value, (int)flag), get);
line 208: current
prop = new Property(min, max, step, def, flags, (flag, value) => vid_ctrl.Set(item, value, (int)flag));
is change to
Func<int> get = () =>
{
int value = 0;
vid_ctrl.Get(item, ref value, ref flags);
return value;
};
prop = new Property(min, max, step, def, flags, (flag, value) => vid_ctrl.Set(item, value, (int)flag), get);
now, you can use
var value = prop.GetValue();
Please let me know If it works fine. If it is OK, I will commit my repository.
from usbcamera.
Hi,
Ok, thank you. Will check and let you know.
Best regards,
Aleksey Danilov
from usbcamera.
Thank, work!!!
I not really professional programmer. I am system IT
How i can optimize this code?
`
public void GetTiltValue()
{
UsbCamera.VideoFormat[] formats = UsbCamera.GetVideoFormat(comboListCameraBox.SelectedIndex);
var CameraCreateConnect = new UsbCamera(comboListCameraBox.SelectedIndex, formats[0]);
UsbCamera.PropertyItems.Property propTilt;
propTilt = CameraCreateConnect.Properties[DirectShow.CameraControlProperty.Tilt];
var value = propTilt.GetValue();
richTextBox1.Text = Convert.ToString(value);
}
`
from usbcamera.
Hello, thank you for your response.
As to your code, I could not comment because too less information. Typically, you had better create UsbCamera instance once in Form constructor or Load event.
from usbcamera.
secile very thank.
from usbcamera.
Related Issues (20)
- Setting gain and exposure time HOT 1
- Expand camera image HOT 15
- Insufficient system resources HOT 1
- Camera preview locked HOT 14
- It is better do not enter critical section in callback function. HOT 1
- Memory leak HOT 3
- On Capture Callback HOT 5
- much more latency than amcap HOT 1
- WPF 每次 BufferToBitmap 的时候都创建新的 WriteableBitmap 岂不是完全没发挥 WriteableBitmap 的性能 HOT 11
- Release taking long time sometimes HOT 1
- How can I get the datas of every frame? HOT 9
- missing events HOT 4
- How can I switch camera? HOT 2
- provide nuget package HOT 4
- Implement IDisposable / IObservable pattern HOT 1
- 需要增加对于部分非标的虚拟摄像头的过滤(It is necessary to increase the filtering of some non-standard virtual cameras) HOT 7
- Problem with showing preview HOT 4
- How to black out the camera system wide? HOT 7
- Can you make the class public? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from usbcamera.