Delphi XE series of control can not save video, after the help of netizens, yesterday finally realized the video function (but there is a problem is the video display without screen), the program is mainly used Jmediarecorder, The use of Mediarecorder can refer to the Web-based Java instructions, the following code is capable of normal recording:
Unit unit8;interfaceuses system.sysutils, System.types, System.uitypes, system.classes, System.variants, Androidapi.helpers, FMX. Types, FMX. Controls, FMX. Forms, FMX. Graphics, FMX. DIALOGS,FMX. Media.android,androidapi.jni.media, FMX. Controls.presentation, FMX. Stdctrls,system.ioutils,androidapi.jni.graphicscontentviewtext, Androidapi.JNI.Provider, ANDROIDAPI.JNI.APP, Androidapi.JNI.Net, Androidapi.jnibridge, FMX. Media, Androidapi.JNI.JavaTypes, Androidapi.jni.os;type TFORM8 = Class (Tform) Button3:tbutton; Button4:tbutton; Procedure Button3click (Sender:tobject); Procedure Button4click (Sender:tobject); Private {private declarations} texture:jsurfacetexture; Surface:jsurface; Recorder:jmediarecorder; Public {public declarations} End;var form8:tform8;implementation{$R *.fmx}procedure Tform8.button3click (sender:to Bject); VAR filename:string;begin Texture: = TJSurfaceTexture.JavaClass.init (1); Surface: = TJSurface.JavaClass.init (Texture); Recorder: = Tjmediarecorder.create (); Recorder.setpreviewdisplay (surface); Recorder.setaudiosource (TJMediaRecorder_AudioSource.JavaClass.MIC); Recorder.setvideosource (TJMediaRecorder_VideoSource.JavaClass.CAMERA); Recorder.setoutputformat (TJMediaRecorder_OutputFormat.JavaClass.MPEG_4); Recorder.setaudioencoder (TJMediaRecorder_AudioEncoder.JavaClass.DEFAULT); Recorder.setvideoencoder (TJMediaRecorder_VideoEncoder.JavaClass.H264); Recorder.setmaxduration (1800000); Minutes Recorder.setvideosize (320, 240); Recorder.setvideoframerate (15); filename:=tpath.getsharedcamerapath+ '/abc0002.mp4 '; Recorder.setoutputfile (stringtojstring (FILENAME)); Recorder.prepare (); Recorder.start (); end;procedure Tform8.button4click (sender:tobject); Begin Recorder.stop;end;end.
Http://www.cnblogs.com/qiufeng2014/p/4809144.html
Delphi Android Video (call Java function)