How to record low quality video in mp4 format in android? -


i recording low quality video camera , uploading server. issue video recorded comes in 3gp format. if give extra_output flag mp4 extension path, still records in 3gp.

actually, on ios device, 3gp video not playing , don't want convert mp4 using ffmpeg because has overhead , take time convert.

this code using :-

            contentvalues values = new contentvalues();             string filename = system.currenttimemillis() + ".mp4";             values.put(mediastore.video.media.title, filename);             values.put(mediastore.video.media.mime_type, "video/mp4");             try {                 uri videourifromcamera = getcontentresolver().insert(                         mediastore.video.media.external_content_uri, values);                 intent intent = new intent(mediastore.action_video_capture);                 intent.putextra(mediastore.extra_video_quality, 0);                 intent.putextra(mediastore.extra_output, videourifromcamera);                 if (videosize != -1)                     intent.putextra(mediastore.extra_size_limit, videosize);                 if (videoduration != -1)                     intent.putextra(mediastore.extra_duration_limit, videoduration);                  startactivityforresult(intent, action_request_video_from_camera);             } catch (exception e) {                 e.printstacktrace();                 toast.maketext(videopickactivity.this, "sd-card not available", toast.length_long).show();             } 

is there way or flag can record low quality videos in mp4 format or other format using default camera intent ?

no.

first, there no documented on action_video_capture stating particular video container format (e.g., mp4). best approach attempting ask pass uri file, file extension .mp4, hope.

second, there thousands of camera apps advertise support action_video_capture, including hundreds of camera apps preinstalled. none have honor of extras. none have pay attention file extensions make choice of video container format.

if want degree of control on video recording, record video yourself, such using mediarecorder.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -