PDA

View Full Version : Capturing video with overlayed text



Unregistered
January 11, 2003, 14:11:19
I have installed version 1.4 and am trying to make an application that saves video files with text overlayed into the video stream ( a simple clock for example).
So I've added the save avi functionality into the graphic overlay example that comes with version 1.4. (added frmwriteAVI)
However when I start capturing video the image goes black, apart from the frame counter triangle in the bottom left hand corner of the image. Tha saved video is black apart from the triangle and frame counter.

What am I doing wrong?


This message was originally posted by Rod in the old IC Imaging Control Support Forum.

Unregistered
January 13, 2003, 11:49:37
Hello,

If you can see the triangle and the clock in the AVI file, you probably changed the dropout color without filling the overlay bitmap with it. If a dropout color other than the default dropout color is pecified, you should fill the overlay with the dropout color, otherwise the video is invisible. Specifying a dropout color should look like this:



If ICImagingControl1.DeviceValid = True Then
Set ob = ICImagingControl1.OverlayBitmap
' Enable the overlay bitmap for drawing.
ob.Enable = True
ICImagingControl1.LiveStart
' Set magenta as dropout color.
ob.DropOutColor = RGB(255, 0, 255)
' Fill the overlay bitmap with the dropout color.
ob.Fill ob.DropOutColor
End If


Best regards
Johannes
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

Unregistered
January 13, 2003, 22:43:33
Johannes,
The full video image and overlay can be seen OK until I start to save the avi file. Then the video screen goes black and after a short time the frame counter triangle becomes visible. So it seems to be related to the avi capturing.
Also when I stop the capturing the entire video goes black again, including the frame counter triangle.

I can't see how starting the video capture can cause the video to go black.

Rod


This message was originally posted by Rod in the old IC Imaging Control Support Forum.

Unregistered
January 14, 2003, 16:55:10
Rod,

Because the sinktype changes from a frame grabber sink in the main programm to an AVI sink in the "frmWriteAVI" form, the overlay bitmap will be created new. As a reason of this, the overlay bitmap will be cleared and all pixels will be set to 0.
This means, that you have to fill the overlay bitmap again with the dropout color, after you have called "AviStartCapture". The "cmdStartCapture_Click" sub should be enhanced as follows.:




ImagingControl.AviStartCapture txtFilename, cboVideoCodec.Text
ImagingControl.LiveCapturePause = True
ImagingControl.OverlayBitmap.Fill (RGB(255, 0, 255)) ' Dropout color
If chkPause.Value = 0 Then
ImagingControl.LiveCapturePause = False
End If

The "ImagingControl.LiveCapturePause" is set to true, to avoid that the drawing the on the overlay bitmap at the begínning can be seen in the captured AVI file.

The clock of the "Creating an Overlay" example cannot be seen, because the timer event handler of "frmGraphicOverlay" is not called, while "frmWriteAvi" runs modal.

Therefore, you need to make the drawings you did in "frmGraphicOverlay" again in "frmWriteAvi" or you integrate the functionallity of "frmWriteAvi" directly in "frmGraphicOverlay".

Best regards
Stefan
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

Unregistered
January 15, 2003, 22:38:43
Thanks, this works OK.
However I have come up against another problem with the overlay function.
Using a Hauppage WintvGO capture card the overlay will not work if I select RGB24 or RGB 555 colour depth. The other available video formats seem to work OK.

Do I need to change something in the setup of the control?(I am using the code supplied in your example files and coding in VB6)


Rod


This message was originally posted by Rod in the old IC Imaging Control Support Forum.

Unregistered
January 16, 2003, 12:31:14
Rod,

what of the Overlay will not work with RGB 24 and RGB 555? Can you see the live video without the Overlay or is there only a black image?

Best regards
Stefan
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

Unregistered
January 16, 2003, 22:34:12
Stephan

With RGB 24 and RGB 555 I get the live image OK but no overlays. If I select another codec it works fine and I see the live image with the overlay on top.

Rod


This message was originally posted by Rod in the old IC Imaging Control Support Forum.

Unregistered
January 17, 2003, 18:14:49
Rod,

please let me know, with which codec the Overlaybitmap cannot be seen.
Thank you.

Best regards
Stefan
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

Unregistered
January 19, 2003, 00:02:04
Stephan,

RGB24 and RGB 555 video formats do not allow me to see the overlaybitmap on the live image. Other video formats seem OK.
Rod


This message was originally posted by rod in the old IC Imaging Control Support Forum.