If you developing video-camera applications, then it will be good to know the API to use for video capturing:
http://developer.android.com/training/camera/videobasics.html
(the above link only show how the video recording can be done via Intent submission, not how the actual recording is done)
https://www.linux.com/learn/tutorials/729988-android-app-development-how-to-capture-video
and if you want to write the "screenrecord" adb application yourself:
https://android.googlesource.com/platform/frameworks/av/+/android-cts-4.4_r1/cmds/screenrecord/screenrecord.cpp
And the key recording action is done here:
static status_t recordScreen(const char* fileName) {
status_t err;
<...>
// Configure, but do not start, muxer.
sp<MediaMuxer> muxer = new MediaMuxer(fileName,
MediaMuxer::OUTPUT_FORMAT_MPEG_4);
if (gRotate) {
muxer->setOrientationHint(90);
}
// Main encoder loop.
err = runEncoder(encoder, muxer);
if (err != NO_ERROR) {
encoder->release();
encoder.clear();
return err;
}
For Samsung phone there is additional settings ('cam_mode' hack):
CamcorderProfile.QUALITY_HIGH resolution produces green flickering video
More useful links:
How can I capture a video recording on Android?