2

This is my problem, I'm developing a software that uses the camera and records video, everything is working but I cannot spot how to manage the settings, for example I've got a Samsung galaxy S that can record video at 1280x720, but when I set this resolution with:

CamcorderProfile profile;
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
profile.videoFrameWidth = 1280;
profile.videoFrameHeight = 720;
profile.videoFrameRate = 30;
recorder.setProfile(profile);

the logcat shows these messages:

01-17 14:22:28.706: WARN/AuthorDriver(2782): Intended video encoding frame width (1280) is too large and will be set to (128849019680)

01-17 14:22:28.706: WARN/AuthorDriver(2782): Intended video encoding frame height (720) is too large and will be set to (1078895784755680)

and the parameters are automatically scaled to 800x480

Fahad Ishaque
  • 1,916
  • 1
  • 17
  • 21
Adelchi
  • 63
  • 2
  • 6

1 Answers1

2

Not exactly sure why you are using CamcorderProfile, the android doc mentions that this is read only.

If you want to set the video recording size to 1280x720 then

  • Get the list of supported video size from the camera parameters (just to be sure chk the size you want to set is supported by the device)-

    public List<Camera.Size> getSupportedVideoSizes () 
    
  • Then call set video size on the media recorder -

    public void setVideoSize (int width, int height) 
    
bluefalcon
  • 4,225
  • 1
  • 32
  • 41
  • mb you will understand it after this question https://stackoverflow.com/questions/76846234/mediarecorder-java-io-ioexception-prepare-failed-for-4k-resolutions-on-some you are getting supported sizes for `camera`, it has nothing to do with capabilities of `mediarecorder`, you can't mix these things together. So to get supported resolutions for `mediarecorder` you need the following - https://stackoverflow.com/a/33219037/7767664 then if both camera and mediarecorder supports such resolution then you can use it – user924 Aug 08 '23 at 22:43