AdvancedHMI Software
General Category => Feature Request => Topic started by: joko markono on December 27, 2019, 03:20:21 AM
-
Hope to have this tool: https://www.advancedhmi.com/forum/index.php?topic=976.msg5123#msg5123 (https://www.advancedhmi.com/forum/index.php?topic=976.msg5123#msg5123)
can be upgraded with save function (e.g. avi, mpeg, etc)
Thanks.
-
You could try using the attached modified LiveVideo control, with 3 new properties: RecordVideoToFile, RecordVideoFileName and RecordVideoCompressor.
It only does AVI files which will have different size depending on what video compressor you select.
-
Thanks Godra. may i know how to start recording using button control?
example: RecordVideoToFile = True
-
Keep it's RecordVideoToFile property as False, add a button to your form and try to use this code:
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If Me.LiveVideo1.RecordVideoToFile Then
Me.Button4.BackColor = Color.Red
Me.Button4.Text = "Stop Recording"
Else
Me.Button4.UseVisualStyleBackColor = True
Me.Button4.Text = "Start Recording"
End If
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Me.LiveVideo1.RecordVideoToFile = Not Me.LiveVideo1.RecordVideoToFile
If Me.LiveVideo1.RecordVideoToFile Then
Me.Button4.BackColor = Color.Red
Me.Button4.Text = "Stop Recording"
Else
Me.Button4.UseVisualStyleBackColor = True
Me.Button4.Text = "Start Recording"
End If
End Sub
If the button turns Red after you start the app that should indicate that the property is already set as True.
-
Thanks Godra, i have tested it.
Here is the file size that i roughly calculated:
for 3600 sec (1 hour) recording, the file size will be around 700 to 730Mb which is not too big.
By the way, i have an issue with multiple video sources. For example, now i have a built in webcam on my laptop and a secondary USB video source.
I have tried to add two LiveVideo controls. and it only show the webcam source on the second LiveVideo control.
How can i pre define which source i want to view?
-
There is a property VideoDeviceIndex so try changing it on a control that doesn't show video.
-
Seems like the next index after 0 has an error. Please see photo.
-
The other message states that "Highest possible index is 1", which means that it is detecting 2 cameras.
I have no idea what is causing that error.
-
actually this time i run the program on a desktop PC. Only one camera source is available.
-
The program doesn't invent things, it is detecting 2 devices which are classified as VideoInputDevices.
You can put a breakpoint, just like in the attached picture, run the program and when it stops at this line then hover the mouse over "ds" to see what devices it is detecting.
Consider replacing all three "ds.Count" with "ds.Length" as the picture shows (or just download the control again).
-
I did as what you advice. Now i'm connecting to a laptop with built in webcam and a usb capture device.
Please see the attachment on what i got so far.
-
besides the error i'm facing now, i wonder why the index does not tally with the number of input device?
-
Device ds(1) appears to be identical to ds(0) but it doesn't have the Name and seems to be causing those errors.
It is quite possible a duplicate entry in the registry.
I don't have any suggestion for you as how to resolve it.
-
If this is a bug, hopefully Archie can resolve it on the next version.
It's not critical for me to have this control, but it is nice to have it on my HMI.
-
I don't think that it's a bug.
You can try skipping that index and just use 0 and 2 indexes.
-
i mean on the issue of it is not showing the video from all sources.
-
The control was updated and replaced to include a possibility of using different video compressors (x264, MJPEG, IYUV, etc) which need to be installed on the PC prior to using the control.
-
You could try using the attached modified LiveVideo control, with 3 new properties: RecordVideoToFile, RecordVideoFileName and RecordVideoCompressor.
It only does AVI files which will have different size depending on what video compressor you select.
So Godra, should we download from the above quote? Correct me if i'm wrong.
-
That's correct.
It's the only post with the control attached so I just keep updating and replacing the file there.
-
For those who want to use x264vfw codec, setting it as in the attached picture appears to produce video file size of approximately 11MB per 1 minute of video.
This was true for Video Properties as shown in the 2nd attached picture.
-
Thats really helpful
-
Hi Godra,
I just had chance to try the updated control. Unfortunately it cannot work. There is a warning on the control:
An unrecoverable error has occurred.
Object reference not set to an instance of an object.
-
It could be that you are trying to use the video compressor that's not installed on your PC or something else.
Try using breakpoints similar to what you did previously.
-
you are right. it's the video compressor issue.
thanks for your help.
-
just one more issue. the start recording instruction does not really work.
when i start the app, it starts recording automatically. i have set the RecordVideoToFile as False.
-
Just double check everything again.
The video file is created upon starting the app but doesn't contain any video until recording is enabled.
-
I cannot get this control working and in fact now my Solution is throwing errors.
I know this post is old.
I deleted the control and the dll resource and have no errors and will try again.
OK - reread the instructions and succeeded. I used the encoder from here btw: https://sourceforge.net/projects/x264vfw/