wseemann / FFmpegMediaMetadataRetriever

FFmpegMediaMetadataRetriever provides a unified interface for retrieving frame and meta data from an input media file.
1.72k stars 387 forks source link

Some special videos use `setDataSource(context, uri)` will crash. #246

Open xloger opened 3 years ago

xloger commented 3 years ago

I have used this library for a long time, It is a great library.I recently upgraded the targetSdkVersion to 29,so I need to convert all file paths to Uri. I found that some special videos will crash when calling FFmpegMediaMetadataRetriever's setDataSource. Crash Info:

A/libc: Fatal signal 6 (SIGABRT), code 0 (SI_USER) in tid 19808 (ceunity.arvideo), pid 19808 (ceunity.arvideo)


Build fingerprint: 'HUAWEI/SPN-AL00/HWSPN:10/HUAWEISPN-AL00/10.1.0.102C00:user/release-keys' Revision: '0' ABI: 'arm64' SYSVMTYPE: Maple Timestamp: 2021-05-28 12:01:55+0800 pid: 19808, tid: 19808, name: ceunity.arvideo >>> com.faceunity.arvideo <<< uid: 10358 signal 6 (SIGABRT), code 0 (SI_USER), fault addr -------- x0 0000000000000000 x1 0000000000004d60 x2 0000000000000006 x3 0000007fd10d5810 x4 ff092f363539672d x5 ff092f363539672d x6 ff092f363539672d x7 7f7f7f7f7f7f7f7f x8 00000000000000f0 x9 69990dab3b71458e x10 0000000000000001 x11 0000000000000000 x12 fffffff0fffffbdf x13 0a3037363a682e6c x14 0000000000000010 x15 0000007b39d1a39a x16 0000007b39d1f908 x17 0000007b39cff700 x18 0000000000000001 x19 0000000000004d60 x20 0000000000004d60 x21 00000000ffffffff x22 0000000000000000 x23 0000000000000001 x24 000000000000000a x25 0000000000000000 x26 0000000000000000 x27 0000007a18d5fe98 x28 0000000000000000 x29 0000007fd10d58b0 sp 0000007fd10d57f0 lr 0000007b39cb4580 pc 0000007b39cb45ac backtrace:

00 pc 00000000000705ac /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: >cc1cd33495bfc74372c309c90877642e)

 #01 pc 0000000000031e04  /data/app/com.faceunity.arvideo-7aPm7tqD-p_OrDXn56xBiw==/lib/arm64/libswscale.so (sws_setColorspaceDetails+1772)

this video is normal when use MediaCodec's setDataSource(fileDescriptor),but in FFmpegMediaMetadataRetriever, I use setDataSource(context, uri)setDataSource(afd.getFileDescriptor())setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getDeclaredLength()) will crash. but this video is normal when targetSDK is 28 and input file path. I watch https://stackoverflow.com/questions/24701029/how-to-properly-pass-an-asset-filedescriptor-to-ffmpeg-using-jni-in-android and try add this video to assets,but it still didn't work.This won't crash,but print java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFFF. I tested it on your fmmr-demo, and it still does. this video download url:https://1drv.ms/v/s!AkJHUVMfwf_0gr4OOHZLM7JoblRpzg?e=JFdjXA . I build this video by MediaCodec.Maybe I lacked some information when I made this video?Such as skip_initial_bytes? I'm not familiar with these. I wonder what suggestions you have.

NeighborhoodCoding commented 1 year ago

I got error

AhteshamShahNitor commented 1 year ago

Hi @NeighborhoodCoding, I am getting this same error, how did you resolved this issue? I checked your #261 but not able to understand it properly. Please help me out, thank you.

I am using library react-native-video-processing for video trim and the app is getting crashed for some of the videos.

nguyen95 commented 1 year ago

Same issue

bqfa commented 1 year ago

Did you find any solution?