K. Barresi
K. Barresi

Reputation: 1315

Change format of ACTION_VIDEO_CAPTURE

Is there a way to either select the video format output of the video recorded by setting an Intent extra? Or can I do it in a post-recording processing function? What I'm trying to do is take the video that I just recorded and send it in an MMS message using an ACTION_SEND intent, but it won't take the .mp4 format that the camera is storing it as.

How would I go about doing this?

Edit: This is what my recording code is:

Intent videoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
videoIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 60);
videoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
startActivityForResult(videoIntent, VIDEO_ACTIVITY);

Upvotes: 1

Views: 3425

Answers (1)

Juan Cortés
Juan Cortés

Reputation: 21122

You can pass any of the following extra's to the intent ACTION_VIDEO_CAPTURE although I'm quite sure this is not what your looking for exactly, but lets dig into it a little bit more.

EXTRA_OUTPUT
EXTRA_VIDEO_QUALITY
EXTRA_SIZE_LIMIT
EXTRA_DURATION_LIMIT

While I don't think there is a protocol limitation on the file size for mms' maybe there is a limit in Android (just speculating herebetween 300kb & 500kb although some devices allow you to increase it in message settings) so try sending a video with a lower quality and perhaps a size limit to check if that solves your problem.

The reason I'm saying this is because I remember something similar a while ago, and the error message was something like (quoting my memory):

Sorry, you can not add this video to your message

Which turned out to be the size limitation I mentioned, not encoding or file type.

Update

Looking at the docs I found out a mention to mms on the MediaStore's stuff, particularly on the EXTRA_VIDEO_QUALITY one, here it is:

The name of the Intent-extra used to control the quality of a recorded video. This is an integer property. Currently value 0 means low quality, suitable for MMS messages, and value 1 means high quality. In the future other quality levels may be added.

Upvotes: 2

Related Questions