πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.multimedia
4 messages
4 total messages Started by Mike Browne Thu, 25 Apr 2002 22:17
Video Capture
#1002
Author: Mike Browne
Date: Thu, 25 Apr 2002 22:17
8 lines
1101 bytes
Can anyone point me to some  sample code that would show me how to capture a
frame from a video camera in jpg format. I have been using the
capFileSaveDIB but I would like to save in a jpg format instead of a BMP
format.

Thanks for any help

Mike
Re: Video Capture
#1003
Author: Corey Murtagh
Date: Fri, 26 Apr 2002 00:28
34 lines
1951 bytes
Hi Mike,

"Mike Browne" <mfbrowne@netcom.ca> wrote in message
news:3cc8807a$1_1@dnews...
> Can anyone point me to some  sample code that would show me how to capture
a
> frame from a video camera in jpg format. I have been using the
> capFileSaveDIB but I would like to save in a jpg format instead of a BMP
> format.
>
> Thanks for any help

Sorry, no sample code.  But...

You can get the video driver to send frames to a callback function using
capSetCallbackOnFrame.  The callback function is defined as:

LRESULT CALLBACK capVideoStreamCallback(
  HWND hWnd,
  LPVIDEOHDR lpVHdr
);

All the data you should need on the frame is in the VIDEOHDR struct,
including whether it's a keyframe, the locked memory area it's in, how big,
etc.  From memory (it's been a while) the frame data is in whatever capture
format your camera uses, so you might have to decode that back to bitmap
before you encode to jpeg.

Let us know how you get on anyway.

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur."
Re: Video Capture
#1004
Author: John Seefeld
Date: Sat, 27 Apr 2002 20:06
13 lines
1239 bytes
"Mike Browne" <mfbrowne@netcom.ca> wrote in message news:<3cc8807a$1_1@dnews>...
> Can anyone point me to some  sample code that would show me how to capture a
> frame from a video camera in jpg format. I have been using the
> capFileSaveDIB but I would like to save in a jpg format instead of a BMP
> format.
> 
> Thanks for any help
> 
> Mike

Look at TVideoGrabber (http://www.delphicity.com)

John.
Re: Video Capture
#1010
Author: mafi
Date: Fri, 03 May 2002 12:43
51 lines
2416 bytes
Hi !

You need to use the TPicture::RegisterFileFormat function to enable using
JPEG.
Then use a TJPEGImage instance in a TImage.
Copy your BMP picture in the TImage and save it as JPEG with the TJPEGImage
class.

It should work :)

"Corey Murtagh" <no_uce_emonk@slingshot.co.nz> a οΏ½crit dans le message news:
3cc89f18_1@dnews...
> Hi Mike,
>
> "Mike Browne" <mfbrowne@netcom.ca> wrote in message
> news:3cc8807a$1_1@dnews...
> > Can anyone point me to some  sample code that would show me how to
capture
> a
> > frame from a video camera in jpg format. I have been using the
> > capFileSaveDIB but I would like to save in a jpg format instead of a BMP
> > format.
> >
> > Thanks for any help
>
> Sorry, no sample code.  But...
>
> You can get the video driver to send frames to a callback function using
> capSetCallbackOnFrame.  The callback function is defined as:
>
> LRESULT CALLBACK capVideoStreamCallback(
>   HWND hWnd,
>   LPVIDEOHDR lpVHdr
> );
>
> All the data you should need on the frame is in the VIDEOHDR struct,
> including whether it's a keyframe, the locked memory area it's in, how
big,
> etc.  From memory (it's been a while) the frame data is in whatever
capture
> format your camera uses, so you might have to decode that back to bitmap
> before you encode to jpeg.
>
> Let us know how you get on anyway.
>
> --
> Corey Murtagh
> The Electric Monk
> "Quidquid latine dictum sit, altum viditur."
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads