According to this page https://developer.android.com/guide/topics/media/c ... I can send "to the camera" some instructions, such as:

MediaStore.EXTRA_OUTPUT - This is where you need to save the video. This setting is optional but strongly recommended. If you’re not intending to specify the intent’s Intent.getData () field. MediaStore.EXTRA_VIDEO_QUALITY - This is the smallest file size. MediaStore.EXTRA_DURATION_LIMIT - in seconds, of video being captured. MediaStore.EXTRA_SIZE_LIMIT - in video, be it captured.

I tried to use 1 of the parameters ( MediaStore.EXTRA_VIDEO_QUALITY ):

 Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0); startActivityForResult(intent, REQUEST_VIDEO_CAPTURE); 

and this is sooo weird parameter. First, it not only changes the resolution to the minimum, but also changes the resulting ratio to 4: 3. Secondly, the resulting 15 second image weighs ~ 300-500 kb, while its completely analogous brother without this parameter is 30 MB. This is an obvious bust.

I do not need 30 MB of video (because it has yet to be sent over the network, most likely more often via a mobile connection), but 0.3 MB is an obvious brute force. Parameter 0.5 is perceived by the camera as 0 (and this possibility is not described.

PS Yes, the video is already limited in time - 15 seconds.

    1 answer 1

    Judging by the documentation, only 2 values ​​can be transferred, either 0 or 1. Everything else is not perceived. Watch here

    EXTRA_VIDEO_QUALITY

    Added in API level 3 String EXTRA_VIDEO_QUALITY This is an integer property. Currently value 0 means low quality. May be added.

    Constant Value: "android.intent.extra.videoQuality"

    Therefore, it turns out that this is only possible in a software way to decode a video, which is not a very good idea from my own experience. It usually takes a long time and "eats" a lot of battery. So in essence, there is only a choice between:

    1. use user battery for video covert
    2. use battery to transfer video
    3. content with the size of the video in "low quality"
    • why is it not the best idea (convert)? - user3239600
    • Firstly, the limitation of the Android version (4.3 basic things), secondly -> too much battery consumption - xAqweRx
    • @upward in what sense? - xAqweRx