ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Capture Video Using Codec

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ageu Posted - May 12 2016 : 16:16:16
I haveImageEn version 4.1.0.
I have used the component to capture images from a PCI vídeo capture using directshow. Code: ImageEnView1.IO.SaveToStreamJpeg(imgStream).
Now I need to capture the vídeo and save the vídeo as AVI file using H264 codec.
When I set the codec using the setVideoCodec function the ImagEnViewer doesn't show live vídeo. The event ImageEnView1DShowNewFrame is not fired. But the vídeo are saved in the file.
When I do not set codec. the ImagEnViewer show live vídeo. The event ImageEnView1DShowNewFrame is fired.
I did a test with the DirectShow1 Demo Project and have the same problem.
I don't know what it happening.
Any help are wellcome.
Best Regards,
Ageu
4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 09 2016 : 19:52:05
Hi Alex

Our DirectShow developer has advised that it is not possible to simutaneously grab and compress via DirectShow, i.e. Frame grabbing is allowed only when NO compression is specified.

It is possible to use the RenderVideo property (which does not use DShowNewFrame) but the performance is not real-time (slow).

http://www.imageen.com/help/TIEDirectShow.RenderVideo.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
AlphaUniform Posted - Aug 08 2016 : 04:44:14
Hi Nigel,
yes. EnableSampleGrabber is set to true.
After switching to Videocapture with codec the OnDShowEvent is fired once.

Here is my code sequence:


//---------------------------------------------------------------------------
this->bVideoMode = !this->bVideoMode;
	if(this->bVideoMode)
	 {
		imgView->IO->DShowParams->Disconnect();
		btToggleVideoMode->ImageIndex = 7;
		//imgView->IO->DShowParams->RenderAudio = false;
		imgView->IO->DShowParams->SetVideoCodec(cbVideoCodecs->ItemIndex); <-- XVid
		//imgView->IO->DShowParams->VideoCodecQuality = 1;
		imgView->IO->DShowParams->FileOutput = "C:\\temp\\testavi1.avi";
		this->RunVideo();
	 }
	else
	 {
		imgView->IO->DShowParams->Disconnect();
		btToggleVideoMode->ImageIndex = 6;
		imgView->IO->DShowParams->SetVideoCodec(-1);
		imgView->IO->DShowParams->FileOutput = "";
		this->RunVideo();
	 }


//---------------------------------------------------------------------------
void __fastcall TfmDXCaptureMain::RunVideo(void)
{
	this->DisconnectVideo();
	this->ConnectVideo();
	TIEDSRunResult ret = imgView->IO->DShowParams->Run();
	if(ret == iedsSuccess)
	 {
//Show devicename in caption
	 }
	else if(ret == iedsBusy)
	 {
		//Busy Msg
	 }
	else
	 {
		//Error Msg
	 }
}
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
void __fastcall TfmDXCaptureMain::ConnectVideo(void)
{
	if(!imgView->IO->DShowParams->Connected)
	 {
		//preset videodevice
		imgView->IO->DShowParams->SetVideoInput(iSelectedDevice);
		imgView->IO->DShowParams->Connect();
		//get n set resolution
		this->FillResolution();
		//reconnect with resolution
		imgView->IO->DShowParams->Disconnect();
		imgView->IO->DShowParams->SetVideoInput(iSelectedDevice, 0, Video_format_struct[this->iStreamSizeIndex].BitmapWidth, Video_format_struct[this->iStreamSizeIndex].BitmapHeight, 
Video_format_struct[this->iStreamSizeIndex].Format, Video_format_struct[this->iStreamSizeIndex].BitRate);
		imgView->IO->DShowParams->EnableSampleGrabber = true;
		imgView->IO->DShowParams->Connect();
		imgView->IO->DShowParams->GetCurrentVideoFormat(this->iCurrentStreamWidth, this->iCurrentStreamHeight, this->asCurrentFormat);
	 }
}
//---------------------------------------------------------------------------


Thanks for your help.

Best regards
Alex
xequte Posted - Aug 07 2016 : 19:55:27
Hi Alex

I assume ImageEnView1.DShowParams.EnableSampleGrabber is true?

Do you get other events for TImageEnView.OnDShowEvent?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
AlphaUniform Posted - Aug 03 2016 : 08:57:14
Same problem here with Version 6.3.0.
Any chance to get CompressedVideo Capture with Livepreview?

Best regards,
Alex