Very powerful Android video recording library, you can choose video size and video quality, only allow horizontal screen recording.
Video can be recorded using the camera app that comes with Android, just send mediastore.action_video_capture intent, but there are some drawbacks:
The video quality parameters for the built-in application intent are only allowed for 0 and 1, respectively, to represent the lowest mass and the highest quality, this parameter is a EXTRA parameter: mediastore.extra_video_quality
The built-in app intent does not return the URI of the video after it has been specified with a file name
Built-in apps intent don't care whether a user-recorded video is a horizontal or vertical screen.
Features of Landscapevideocamera
Landscapevideocamera provides a complete and reusable custom camera with the following features:
(1) Force the user to record horizontal screen (when the vertical screen is not recorded)
(2) allows you to specify the file name of the recorded video and, of course, automatically generate file names.
(3) Allow changes to the following settings:
Resolution
Code rate
Maximum space occupied by video files
Video recording Time
Use
Add the Landscapevideocamera library to your project
Add videocaptureactivity to manifest:
1 < Activity 2 Android:name = "Com.jmolsmobile.landscapevideocapture.VideoCaptureActivity" 3 android:screenorientation= "sensor">4</ Activity>
In manifest, add the following permissions:
1 < android:name= "Android.permission.RECORD_AUDIO"/>2< android:name= "Android.permission.CAMERA"/>3< android:name = "Android.permission.WRITE_EXTERNAL_STORAGE"/>
Set the recording parameters, create the Captureconfiguration object, select the appropriate construction method as required, and have the following construction methods:
1Capture configuration =Captureconfiguration (captureresolution resolution, capturequality quality);2Capture configuration = captureconfiguration (captureresolution resolution, capturequality quality,intMaxdurationsecs,intmaxfilesizemb);3Capture configuration = captureconfiguration (intVideowidth,intVideoheight,intbitrate);4Capture configuration = captureconfiguration (intVideowidth,intVideoheight,intBitrate,intMaxdurationsecs,intMAXFILESIZEMB);
If Captureconfiguration is not set, the default settings are used.
Call Videocaptureactivity,captureconfiguration with Startactivityforresult as the parcelable type parameter extra_capture_ The configuration is passed, and the file name is passed as a string type parameter extra_output_filename.
1 Final New Intent (Getactivity (), videocaptureactivity. Class); 2 Intent.putextra (videocaptureactivity.extra_capture_configuration, config); 3 Intent.putextra (Videocaptureactivity.extra_output_filename, FILENAME); 4 Startactivityforresult (Intent, Result_code);
Check ResultCode (RESULT_OK, result_cancelled or Videocaptureactivity.result_error), if successful then intent extra from Extra_output_ FileName is given in filename.
Project address:http://jcodecraeer.com/a/opensource/2014/1213/2156.html
"Go" open source video recording library Landscapevideocamera