In Android MediaStore.EXTRA_DURATION_LIMIT not working in 6.0 and uper version device
Asked Answered
C

1

6

I'm using LG Nexus(6.0). When I have use the camera to capture video using below code.

   Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
   fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);
    // set video quality
    intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
    intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 30);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); 

I have given its duration limit using below code.

    intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 30);

The camera seems to ignore the duration limit. On any 6.0 device, it does not work. Is there an another way to limit the capture video duration on 6.0 + devices?

Caesaria answered 28/6, 2017 at 12:35 Comment(2)
I also verified this issue exists only for Google Camera App whose Version is greater than "2.5.052(2005148-30)". Currently, on Play store, Google Camera App version is "3.2.045(2821762-30)" by using this version you can easily reproduce this issue. Previously Google Camera EXTRA_DURATION_LIMIT was working on the V2.5.052.Caesaria
any solutions ?Pyrimidine
S
6

The camera seems to ignore the duration limit. On any 6.0 device it does not work.

There are ~2 billion Android devices, spread across thousands of device models from hundreds of manufacturers. Those devices will have hundreds of different pre-installed camera apps, plus possibly camera apps installed by users. Any of them can be what responds to an ACTION_VIDEO_CAPTURE request, and any of them can have bugs. This issue is not tied to an Android OS version.

Is there a other way to limit the capture video duration on 6.0 + devices?

Not with ACTION_VIDEO_CAPTURE. You are delegating the work to a third-party app, and that app can do whatever it wants.

If you want full control, use MediaRecorder, either directly in your own code or via some third-party library.

Sivas answered 28/6, 2017 at 14:5 Comment(2)
I also verified this issue exists only for Google Camera App whose Version is greater than "2.5.052(2005148-30)". Currently, on Play store, Google Camera App version is "3.2.045(2821762-30)" by using this version you can easily reproduce this issue. Previously Google Camera EXTRA_DURATION_LIMIT was working on the V2.5.052.Caesaria
It looks like no camera app is supporting it anymore unfortunatelyVernalize

© 2022 - 2024 — McMap. All rights reserved.