Delphi XE6 trial Android video capture

Source: Internet
Author: User

FMX Support video capture, specifically see Fmx.media, provides a very class of support for audio, video processing.

According to the help document, the test was done with Note3, and the result was too inefficient to be used.

The specific query Help video capturing section, I just follow this code to copy over to do the test.

Little progress:

For such a low-efficiency discussion with a friend should be the result of FMX's own processing, so if we can call the Android built-in camera for recording and then get the video file, the problem is solved. In this way, Delphi XE6 supports the camera function, which is achieved by this principle, very suitable! To this end, XE6 belt to do a standard Action, called ttakephotofromcameraaction, very fast support for the development of photography, if you provide a ttakevideofromcameraaction how good! It's a pity, not yet.

In order to call the built-in camera, my friend reminds me that it is called Android intent, how to call, not yet, that there is no one based on Android development such a control? I really found a set of controls: DPF component suite for Android, but unfortunately, there is no video feature available.

FMX Code with test:

UnitUnit2;Interfaceusessystem.sysutils, System.types, System.uitypes, system.classes, System.variants, FMX. Types, FMX. Controls, FMX. Forms, FMX. Graphics, FMX. Dialogs, FMX. Layouts, Fmx.stdctrls, FMX. Objects, FMX. LISTBOX,FMX. Media;typeTForm2=class(tform) layout1:tlayout;    Startbutton:tbutton;    Combobox1:tcombobox;    Image1:timage; procedureformcreate (Sender:tobject); procedureStartbuttonclick (Sender:tobject); procedureCombobox1change (Sender:tobject); procedureFormdestroy (Sender:tobject); Private    {Private Declarations}   PublicVideocamera:tvideocapturedevice; procedureSamplebuffersync; procedureSamplebufferready (Sender:tobject;Constatime:tmediatime); End;varForm2:tform2;Implementation{$R *.FMX}{TForm2}procedureTform2.combobox1change (sender:tobject);beginVideocamera:=Tvideocapturedevice//(TCaptureDeviceManager.Current.GetDevicesByName (ComboBox1.Selected.Text));(tcapturedevicemanager.current.devices[1]); if(Videocamera <>Nil) Then  beginstartbutton.enabled:=true; End;End;proceduretform2.formcreate (sender:tobject);vardevicelist:tcapturedevicelist; I:integer;begindevicelist:=TCaptureDeviceManager.Current.GetDevicesByMediaType (Tmediatype.video);  forI: =0  toDevicelist.count-1  Do  beginComboBox1.Items.Add (Devicelist[i]. Name);//there is no name on the note3.  End;End;procedureTform2.formdestroy (sender:tobject);begin  ifVideocamera <>Nil  Thenvideocamera.stopcapture;End;procedureTform2.samplebufferready (Sender:tobject;Constatime:tmediatime);begintthread.synchronize (Tthread.currentthread, Samplebuffersync); //Resize the image so, the video is buffered and its original size//Image1.width:=image1.bitmap.width;//Image1.height:=image1.bitmap.height;End;procedureTform2.samplebuffersync;beginVideocamera.samplebuffertobitmap (Image1.bitmap, true);End;procedureTform2.startbuttonclick (sender:tobject);begin  if(Videocamera <>Nil) Then  begin    if(videocamera.state = tcapturedevicestate.stopped) Then    beginVideocamera.onsamplebufferready:=Samplebufferready;      Videocamera.startcapture; Startbutton.text:='Stop'; End    Else    beginvideocamera.stopcapture; Startbutton.text:='Start'; End; End  Else  beginCaption:='Video capture devices not available.'; End;End;End.

Http://blog.sina.com.cn/s/blog_44fa172f0101rg7p.html

Delphi XE6 trial Android video capture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.