Table of Contents
To make their jobs easier, all photo and video editing applications make use of media libraries. This article is about the WINSOFT Media Recorder component for Android. This Media Recorder component for Android makes use of the Android MediaRecorder API to record audio and video.
The Android MediaRecorder API supports capturing and encoding a wide range of popular audio and video formats. In this post, you’ll learn how to create a custom audio and video library on Android using Winsoft Media Recorder and IDE software.
This is a commercial library that has a trial version with all features for evaluation only and if you wish to distribute the Media Recorder component as a part of your project you should get a license.
Moreover, some of the demo applications were built with the TACamera component for Android by WINSOFT.
- Supports Windows 32 & Windows 64
- Available for Delphi & C++ Builder 6-10.4 FMX
The installation of this Media Recorder component is easy, you just need to download the installer and run the installer. RAD Studio should be closed while installing.
The UI is simple, we have the Settings button which requests permission and shows the camera settings. The Start button starts capturing, it can be a Stop button when it is capturing. Take Picture button takes a picture and we have a triggered function that ensures the photo taking is finished and saves the data to .jpeg file.
Here is the implementation for the Take Picture button and the PictureTaken procedure.
procedure TFormMain.ButtonTakePictureClick(Sender: TObject);
procedure TFormMain.ACameraPictureTaken(Sender: TObject;
'picture_' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.jpeg'), Data);
Within the TTimer component, we can set output file format and path.
procedure TFormMain.TimerTimer(Sender: TObject);
Timer.Enabled := False;
AMediaRecorder.OutputFile := TPath.Combine(TPath.GetPublicPath,
'video_' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.mp4');
AMediaRecorder.Active := True;
ButtonTakePicture.Enabled := True;
ButtonStartStop.Text := 'Stop';
As you can see after giving the path and format, it changes Active status to True and starts recording.
TAMediaRecorder component has many built-in features to use. For instance, you can set VideoEncodingBitRate, VideoFrameRate, Video Encoding types like H263, Mpeg4SP, and many more options to utilize.
Here is the list of all the features of the TAMediaRecorder component:
In the next post, we will see how we can record audio with the TAMediaRecorder component.
Head over and check out the full WINSOFT Media Recorder component!
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition