473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

delaying video capture preview

hello,

Anyone has an idea how can I delay the preview from my camera about 4
minutes? I want to delay capturing stream and then show it on screen.

I used Stream Buffer Engine but I can't lock the profile (LockProfile
function gives me an application error.

Help me please.

This is a piece of code.

All HRESULTs are ok but I cut it to clear the situation.

[cut]

hr = GetInterfaces();
// Attach the filter graph to the capture graph
hr = g_pCapture->SetFiltergraph(g_pGraph);

hr = FindCaptureDevice(&pSrcFilter);

// Add Capture filter to our graph.
hr = g_pGraph->AddFilter(pSrcFilter, L"Video Capture");

// Create the StreamBufferConfig object.
CComPtr<IStreamBufferConfigure> pConfig;
hr = pConfig.CoCreateInstance(CLSID_StreamBufferConfig) ;

// Create a new registry key to hold our settings.
HKEY hkey = 0;
long lRes = RegCreateKey(HKEY_LOCAL_MACHINE,
TEXT("SOFTWARE\\MyStreamBufferKey"), &hkey);

// Set the registry key.
CComPtr<IStreamBufferInitialize> pInit;
hr = pConfig.QueryInterface(&pInit);
hr = pInit->SetHKEY(hkey);
pInit.Release();

// Set the backing file directory.
hr = pConfig->SetDirectory(L"f:\\backing");

// Add the Stream Buffer Sink filter to the graph.
CComPtr<IStreamBufferSink> pSink;
hr = pSink.CoCreateInstance(CLSID_StreamBufferSink);

hr = pSink.QueryInterface(&pInit);
hr = pInit->SetHKEY(hkey);

pInit.Release();

CComQIPtr<IBaseFilter> pSinkFilter(pSink);
hr = g_pGraph->AddFilter(pSinkFilter, L"SBESink");

// Render the stream
hr = g_pCapture->RenderStream( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video,
pSrcFilter,
NULL, // Compressor filter
pSinkFilter);
hr = pSinkFilter->QueryInterface(IID_IStreamBufferSink,(LPVOID *)
&g_pSBSink);

hr = g_pSBSink->LockProfile(NULL);

[/cut]

the last function in this piece of code is the problem.
I don't know what I do wrong.

thx for help
Jul 22 '05 #1
2 2880
Marcin <go*********@gazeta.pl> spoke thus:
Anyone has an idea how can I delay the preview from my camera about 4
minutes? I want to delay capturing stream and then show it on screen.


(No.)

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #2
Christopher Benson-Manica <at***@nospam.cyberspace.org> spoke thus:
Anyone has an idea how can I delay the preview from my camera about 4
minutes? I want to delay capturing stream and then show it on screen.
(No.) Your post is off-topic for comp.lang.c. Please visit

c++
Whoops. It's still off-topic though:

http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/

(Should have had my coffee first...)

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ravi | last post by:
Hi, Im trying to develop a Visual C# .NET app. that uses DirectShow filters to capture video from camera source. However, after going through a series of articles, I've seen that DirectShow is not...
3
by: Juan Crespo | last post by:
Dear Sirs: My name is Juan Crespo and I write you from Spain, I work as application developer in Industrial Automation in Spain. We have as customer a company that wants to reuse old computers...
2
by: Arash | last post by:
Dear all, I've got a video capture device. Device manager shows "nVidia WDM Video Capture (universal)" driver in "Sound, video and game controllers" category. Also, Windows Movie Maker, and...
0
by: Tsunami | last post by:
Hi to all: I have a big problem and I write to ask for help. Sorry if this message does not arrive to the apropriate group. I have selected them paying attention but I am not sure to do it well....
8
by: Nehmo | last post by:
When a page has a JavaScript "link" to a video, like http://www.msnbc.msn.com/id/10478942/ . How do you get the URL of the actual video? Isn't it in the source somewhere? -- )|:__ Nehmo __:|(
0
by: tHw | last post by:
Hello. I would like to preview video, capture still images and record video simultaneously with my AGP capture card. I have to do it in dotNET. Is there a dedicated solution to do that in dotNET?...
3
by: rajibnsu | last post by:
While searching for capturing video with a webcam I god the following code.It gives two errors.Says:The type or namespace name 'WebcamEventArgs' does not exit in the namespace 'WebCam_Capture' (are...
6
by: k.vanderstarren | last post by:
Hi Everyone, Do any of you gurus out there have any suggestions regarding capturing audio/video from a video capture card in C#. Although I've written other programs, I've never worked with...
3
by: ghostrider | last post by:
Does anyone know how to recognise the image capture signal from a medical scope such as a video colonoscope? I've got video streaming from the scope to the computer but want my app to recognise...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.