Status Update
Comments
wu...@google.com <wu...@google.com>
le...@google.com <le...@google.com> #2
Hi,
Thanks for the report and the sample project link. It helps to reproduce the bug!
But I am not able to reproduce the bug by the sample project and the repro steps with various devices including Samsung Galaxy Note 9
.
Some questions,
-
Want to confirm is it
1.2.3
?you also specified
1.3.0-beta01
on the description and the project settings is1.3.0-beta01
. (Btw, I test them both) -
What is the model name of your Samsung Galaxy Note 9? I had test
SM-N960F
andSM-N960U1
. (You can get it by Settings -> About Phone -> Model Number) -
Could you try on other camerax versions? such as
1.2.2
and1.3.0-beta1
? -
Does the bug occur on any other "camerax-version/device" combinations?
le...@google.com <le...@google.com> #3
A similar bug
le...@google.com <le...@google.com> #4
Hi,
One thing to add, is it possible to provide more log? (from launching the test app until the error occurs)
Thank you.
[Deleted User] <[Deleted User]> #5
camerax_version = "1.2.3
D Received video keyframe. Starting muxer...
2023-08-03 18:09:44.263 30618-31380 AndroidRuntime com.fishdonkey.android E FATAL EXCEPTION: CameraX-camerax_io_0
Process: com.fishdonkey.android, PID: 30618
java.lang.AssertionError: One-time media muxer creation has already occurred for recording RecordingRecord{getOutputOptions=MediaStoreOutputOptions{fileSizeLimit=0, location=null, contentResolver=android.app.ContextImpl$ApplicationContentResolver@315f2a, collectionUri=content://media/external/video/media, contentValues=_display_name=2023-08-03-18-09-42-741 mime_type=video/mp4 relative_path=Pictures/Tournament_Photos}, getCallbackExecutor=android.os.HandlerExecutor@480811b, getEventListener=com.fishdonkey.android.activity.camera.CameraKitKotlinActivity$$ExternalSyntheticLambda3@7ef62b8, hasAudioEnabled=true, getRecordingId=1}
at androidx.camera.video.Recorder$RecordingRecord.performOneTimeMediaMuxerCreation(Recorder.java:2785)
at androidx.camera.video.Recorder.setupAndStartMediaMuxer(Recorder.java:1396)
at androidx.camera.video.Recorder$2.onEncodedData(Recorder.java:1570)
at androidx.camera.video.internal.encoder.EncoderImpl$MediaCodecCallback.lambda$sendEncodedData$3(EncoderImpl.java:1163)
at androidx.camera.video.internal.encoder.EncoderImpl$MediaCodecCallback$$ExternalSyntheticLambda10.run(Unknown Source:4)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:111)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
[Deleted User] <[Deleted User]> #6
Log details
7:35.777 14517-15013 BpBinder com.fishdonkey.android W Slow Binder: BpBinder transact took 646 ms, interface=android.app.IActivityManager, code=20 oneway=false
2023-08-03 18:37:35.843 14517-15013 SequentialExecutor com.fishdonkey.android E Exception while executing runnable androidx.camera.core.impl.utils.executor.SequentialExecutor$1@397909d
java.lang.IllegalArgumentException: Primary directory Pictures not allowed for content://media/external/video/media; allowed directories are [DCIM, Movies]
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:170)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:481)
at android.content.ContentResolver.insert(ContentResolver.java:1841)
at androidx.camera.video.Recorder$RecordingRecord.lambda$initializeRecording$1(Recorder.java:2872)
at androidx.camera.video.Recorder$RecordingRecord$$ExternalSyntheticLambda0.get(Unknown Source:4)
at androidx.camera.video.Recorder$RecordingRecord.performOneTimeMediaMuxerCreation(Recorder.java:3095)
at androidx.camera.video.Recorder.setupAndStartMediaMuxer(Recorder.java:1467)
at androidx.camera.video.Recorder$6.onEncodedData(Recorder.java:1812)
at androidx.camera.video.internal.encoder.EncoderImpl$MediaCodecCallback.lambda$sendEncodedData$3(EncoderImpl.java:1227)
at androidx.camera.video.internal.encoder.EncoderImpl$MediaCodecCallback$$ExternalSyntheticLambda10.run(Unknown Source:4)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:111)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
le...@google.com <le...@google.com> #7
Hi,
Thanks for the log.
By the following log,
java.lang.IllegalArgumentException: Primary directory Pictures not allowed for content://media/external/video/media; allowed directories are [DCIM, Movies]
I am wondering if you changed this line in the sample project? since I can reproduce it by below change (on both 1.2.3
and 1.3.0-beta01
)
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
// put(MediaStore.Video.Media.RELATIVE_PATH, "Movies/CameraX-Video")
put(MediaStore.Video.Media.RELATIVE_PATH, "Pictures/CameraX-Video") // Primary directory `Pictures` not allowed ...
}
[Deleted User] <[Deleted User]> #8
le...@google.com <le...@google.com> #9
May I know if the problem resolved?
If so, I will close this bug.
Thank you.
[Deleted User] <[Deleted User]> #10
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit cb92e2173e7dffc1798d4fed6e182777d0e3d0c7
Author: leo huang <leohuang@google.com>
Date: Fri Aug 04 14:57:44 2023
Catch exceptions from Recorder's MediaMuxerSupplier
Catch exceptions and report to recording callback to avoid "java.lang.AssertionError: One-time media muxer creation has already occurred for recording".
Bug: 294126265
Test: Manually testing
Change-Id: I9e61fe43a7e627a594108f57738512c8558504b6
M camera/camera-video/src/main/java/androidx/camera/video/Recorder.java
le...@google.com <le...@google.com>
le...@google.com <le...@google.com> #12
Hi, any update?
[Deleted User] <[Deleted User]> #13
Camerax issue has been resolved.
le...@google.com <le...@google.com> #15
Note
The change in
ha...@gmail.com <ha...@gmail.com> #16
le...@google.com <le...@google.com> #17
Hi,
The problem has been solved. Please see
Description
Used camerax version 1.2.3 not working video recording in API level 28,29
camerax_version 1.3.0-beta01
ANDROID OS BUILD NUMBER : sdk_gphone64_arm64-userdebug 10 QSR1.210802.001 7603624 dev-keys
DEVICE NAME: Samsung Galaxy Note9.
Githhub Project :
STEPS TO REPRODUCE:
1]Project run camera view showing
2]Start Capture button click auto video capture stop, and start capture button showing
Error Log :- Video capture ends with error: 8
if (!recordEvent.hasError()) { } # if condition false
EXPECTED RESULTS:
1]Project run camera view showing
2]Start Capture button click
3]stop capture button click video stop
4]if (!recordEvent.hasError()) { } # if condition true
5]get video recoding url
Error Log
Every time I click the 'record video' button the camera view crashes and goes back to the 'Enter a **' screen. Sometimes Samsung OS tries to re-open the camera automatically, but then crashes again.
See the attached recording. The crash was also registered in Crashlytics, here is the stack trace:
Fatal Exception: java.lang.AssertionError: One-time media muxer creation has already occurred for recording RecordingRecord{getOutputOptions=MediaStoreOutputOptions{fileSizeLimit=0, location=null, contentResolver=android.app.ContextImpl$ApplicationContentResolver@fa70332, collectionUri=content://media/external/video/media, contentValues=_display_name=2023-07-31-15-48-47-932 mime_type=video/mp4 relative_path=Pictures/Tournament_Photos}, getCallbackExecutor=android.os.HandlerExecutor@7c1c883, getEventListener=com.****.android.activity.camera.****$$ExternalSyntheticLambda2@ec7a00, hasAudioEnabled=true, getRecordingId=1} at androidx.camera.video.Recorder$RecordingRecord.performOneTimeMediaMuxerCreation(Recorder.java:2785) at androidx.camera.video.Recorder.setupAndStartMediaMuxer(Recorder.java:1396) at androidx.camera.video.Recorder$2.onEncodedData(Recorder.java:1570) at androidx.camera.video.internal.encoder.EncoderImpl$MediaCodecCallback.lambda$sendEncodedData$3(EncoderImpl.java:1163) at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231) at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919)