Is there a way we can extend the default video recording time on glass. The current recording time is only 10 seconds and we have to extend it manually by pressing the camera key for one second or by tapping and choosing Extend Video option. So i was wondering whether there is a flag that we can set when requesting the camera to start recording which will cause the camera to record an extended video.
I was also wondering how can we set the maximum time limit of video recording and what is the default time limit of video recording in glass ?
I am using the code below for starting the glass camera for video recording
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intent, CAPTURE_VIDEO_REQUEST_CODE);
Also if there isn't a possible way can anyone guide me on the alternatives. Is there any open source camera available which works for glass or should i have to write my own camera [any links that would help me get started] ?
Hope you get him idea from it:
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra("android.intent.extra.durationLimit", 60);
startActivityForResult(intent, CAPTURE_VIDEO_REQUEST_CODE);
This above code video duration is one minute,if u want to extend the video time then do it like that,and now the video duration is 2 minutes:
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra("android.intent.extra.durationLimit", 120);
startActivityForResult(intent, CAPTURE_VIDEO_REQUEST_CODE);
You can access the camera directly and record the video yourself. See the official Android documentation for more information: http://developer.android.com/guide/topics/media/camera.html#capture-video
Related
I want to capture the video through my application and also need extra information of captured video like Start time , end time , Quality of the video.
Currently I am using existing camera application to capture the video in my application , with sample code
static final int REQUEST_VIDEO_CAPTURE = 1;
private void dispatchTakeVideoIntent() {
Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
if (takeVideoIntent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(takeVideoIntent, REQUEST_VIDEO_CAPTURE);
}
}
From above sample code , I am able to capture video and store on device but I am not getting any way to get that extra information?
Is it possible to get that extra info using existing camera application?
If yes then how else is there any other way to do this?
Is it possible to get that extra info using existing camera application?
No.
If yes then how else is there any other way to do this?
You are welcome to use the time that you call startActivityForResult() as the start time, the time you are called with onActivityResult() as the end time, and the quality that you request via EXTRA__VIDEO_QUALITY as the quality.
Or, write your own video recorder, using the camera APIs and MediaRecorder.
I'm trying to limit the length of a video captured on Google Glass via the follow code:
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 10);
intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, 10485760); // 10mb in bytes
startActivityForResult(intent, Constants.TAKE_VIDEO_REQUEST);
It appears Glass ignores these extras though. The user still has the option to tap extend and the file size never stops the video either.
Are these extras used in Glass or is this a bug?
EDIT: Filed a feature request: https://code.google.com/p/google-glass-api/issues/detail?id=469
Those Intent Extras are not actually used by the ACTION_VIDEO_CAPTURE action. Please file a feature request on our issues tracker to track this.
Alain,
this is happening to me as well.
I submitted Issue 651 for that.
i'm developing android application which used camera feature. it can capture video fragment. But i found some problem with fragments < 1sec and didn't find any information about minimal video duration. Who knows something about it? What's minimal duration for video?
for record video limited video you can use following code, in this case video will recorded of 15 seconds
int VIDEORECORD=1;
int DURATION=15 /* time given IN seconds */
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); cameraIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT,DURATION); startActivityForResult(cameraIntent, VIDEORECORD);
I use an example of recording video using intent based on
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intent, REQUEST_VIDEO_CAPTURED);
For time limit I have used: intent.putExtra("android.intent.extra.durationLimit", 5);
This records 5 seconds and then stop automatically.
I have used example from URL:
http://android-er.blogspot.cz/2011/04/start-video-recording-using.html
This example is for me interesting because works on all my devices and is easy to implement.
Is it possible to set the path to save recorded video ?
Let's say simple I need video to save to a specified file "myrecordedvideo.mp4" to a specified folder and need video to have exactly 5 seconds. Is it possible to make it easy way with this Intent ?
To set the time limit and set the path to save the video
Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
takeVideoIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 30);
takeVideoIntent.putExtra(MediaStore.EXTRA_OUTPUT, Environment.getExternalStorageDirectory().getPath()+"videocapture_example.mp4");
startActivityForResult(takeVideoIntent, ACTION_TAKE_VIDEO);
I have searched a lot but i did not get any solution. I want to open default camera of my android device so that i can capture image as well as video. I have tired it using:
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, ACTION_IMAGE_CAPTURE);
or
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intent, ACTION_VIDEO_CAPTURE);
But using this camera open only in one mode either in Image or in Video capture mode. I want to open default camera. Please don't suggest using Surface View holder.
Thanks a lot in Advacnce
Please don't suggest using Surface View holder.
You can't do it.Both in one time.Either you open image or video.You should put alert for choose one Video or image.
You will have to get native interaction for that purpose. Search for Qualcomm's Augmented Reality Sample apps. In that they have opened the Camera natively and not through Android's Camera api.