Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Failed to record with the maximum resolution on some devices #114

Closed
JohnsonCYS opened this issue Jul 8, 2022 · 9 comments
Closed
Labels
b: third party This is a third party package issue. i: out of support The issue is out of basic support and not a feature request. p: Android This issue only happens on Android platform. r: camera Related to the camera package.

Comments

@JohnsonCYS
Copy link

JohnsonCYS commented Jul 8, 2022

Describe the bug

使用版本wechat_camera_picker: ^3.4.0

在Xiaomi MI 5X(Android 8.1.0)和Redmi Note4X(Android 7.0)设备上无法正常录制视频,报错:

 Playback error
      com.google.android.exoplayer2.ExoPlaybackException: Source error
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:641)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:611)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:176)
        at android.os.HandlerThread.run(HandlerThread.java:65)
     Caused by: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (FragmentedMp4Extractor, Mp4Extractor, FlvExtractor, FlacExtractor, WavExtractor, AmrExtractor, PsExtractor, OggExtractor, TsExtractor, MatroskaExtractor, AdtsExtractor, Ac3Extractor, Ac4Extractor, Mp3Extractor, JpegExtractor) could read the stream.
        at com.google.android.exoplayer2.source.BundledExtractorsAdapter.init(BundledExtractorsAdapter.java:92)
        at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1020)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)

[CameraPicker - LOG] Error when initializing video controller: PlatformException(VideoError, Video player had error com.google.android.exoplayer2.ExoPlaybackException: Source error, null, null)
I/flutter (32691): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (32691): │ #0   LoggerUtil.e (package:open_im_demo/utils/logger.dart:31:13)
I/flutter (32691): │ #1   main.<anonymous closure> (package:open_im_demo/main.dart:22:18)
I/flutter (32691): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (32691): │ ⛔ StackTrace :  #0      handleErrorWithHandler (package:wechat_camera_picker/src/internals/methods.dart:28:3)
I/flutter (32691): │ ⛔ #1      _CameraPickerViewerState.initializeVideoPlayerController (package:wechat_camera_picker/src/widgets/camera_picker_viewer.dart:173:7)
I/flutter (32691): │ ⛔ <asynchronous suspension>
I/flutter (32691): │ ⛔ 
I/flutter (32691): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

目前,在另一台oppo手机上是可以正常录制视频,怀疑是小米手机或者小米低端机的兼容型问题

@JohnsonCYS JohnsonCYS added the await investigate The issue is waiting for further investigation. label Jul 8, 2022
@AlexV525
Copy link
Member

AlexV525 commented Jul 8, 2022

测试官方camera后确认是否有同样问题。

@AlexV525 AlexV525 added r: camera Related to the camera package. await response Issue require customer's further response. i: lack of information Further information is requested and removed await investigate The issue is waiting for further investigation. labels Jul 8, 2022
@JohnsonCYS
Copy link
Author

JohnsonCYS commented Jul 17, 2022

测试github一个使用camera 的demo(https://github.com/sbis04/flutter_camera_demo) ,在Xiaomi MI 5X(Android 8.1.0)设备上是可以正常录制视频,应该可以排查官方camera的问题。

@AlexV525
Copy link
Member

确认是否和 #104 为同一个问题。

@JohnsonCYS
Copy link
Author

这边应该是排查到问题了,默认CameraPickerConfig里面设置的采样率是ResolutionPreset.max,在小米设备上用camera录制的视频文件本身就会有问题。如果我指定在小米设备上采样率是ResolutionPreset.medium,那么可以正常使用了。

@AlexV525
Copy link
Member

可以使用 demo 运行 flutter run -v 将从运行到出现错误的完整日志保存为 txt 后赋于此处,我再将问题进行反馈。

@JohnsonCYS
Copy link
Author

JohnsonCYS commented Jul 17, 2022

基于flutter_wechat_camera_picker项目demo抓取的两份日志,flutter_log.txt是执行flutter run -v命令抓取的,android_studio_log.txt是在android studio控制台抓取的
flutter_log.txt

android_studio_log.txt

里面有个报错是说设置分辨率出错了:/CameraDevice-0-LE(15346): Surface with size (w=3840, h=2160) and format 0x22 is not valid, size not in valid set: [1440x1080, 1280x960, 1280x720, 1280x640, 864x480, 640x640, 800x480, 720x480, 768x432, 640x480, 480x640, 576x432, 640x360, 480x360, 480x320, 384x288, 352x288, 320x240, 240x320, 240x160, 176x144, 144x176, 160x120]

@bridfish
Copy link

我是用小米X5手机进行拍摄也出现了同样的问题。

@joker-fu
Copy link

joker-fu commented Sep 9, 2022

通小米5X无法拍摄

W/MediaAnalyticsItem(28867): Unable to record: (codec:0:-1:-11:0:10:android.media.mediacodec.codec=OMX.qcom.video.decoder.avc:android.media.mediacodec.mode=video:android.media.mediacodec.secure=0:android.media.mediacodec.width=320:android.media.mediacodec.height=240:android.media.mediacodec.rotation-degrees=90:android.media.mediacodec.maxwidth=320:android.media.mediacodec.maxheight=240:android.media.mediacodec.mime=video/avc:android.media.mediacodec.bytesin=39673:) [forcenew=0]
W/MediaAnalyticsItem(28867): Unable to record: (codec:0:-1:-11:0:5:android.media.mediacodec.codec=OMX.google.aac.decoder:android.media.mediacodec.mode=audio:android.media.mediacodec.secure=0:android.media.mediacodec.mime=audio/mp4a-latm:android.media.mediacodec.bytesin=6402:) [forcenew=0]

@AlexV525 AlexV525 changed the title [BUG] 在小米的两台设备上都无法录制视频 [BUG] Failed to record with the maximum resolution on some devices Sep 27, 2022
@hrxiang
Copy link

hrxiang commented Oct 26, 2022

这边应该是排查到问题了,默认CameraPickerConfig里面设置的采样率是ResolutionPreset.max,在小米设备上用camera录制的视频文件本身就会有问题。如果我指定在小米设备上采样率是ResolutionPreset.medium,那么可以正常使用了。

你好,请问你是根据什么条件判断使用medium还是max。手机品牌吗?

@AlexV525 AlexV525 added b: third party This is a third party package issue. p: Android This issue only happens on Android platform. i: out of support The issue is out of basic support and not a feature request. and removed i: lack of information Further information is requested await response Issue require customer's further response. labels Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b: third party This is a third party package issue. i: out of support The issue is out of basic support and not a feature request. p: Android This issue only happens on Android platform. r: camera Related to the camera package.
Projects
None yet
Development

No branches or pull requests

5 participants