Closed Vigrond closed 3 years ago
Do you have the same issue when you use a local file?
Do you have the same issue when you use a local file?
Yes. Tried today to decode from local app storage and encode back to it on the Pixel 4A:
kotlin code:
val filePath: kotlin.String = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).toString() + "/Big_Buck_Bunny_1080_10s_30MB.mp4"
val testPath = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).toString() + "/test.mp4"
var executionId = FFmpeg.executeAsync("-y -hwaccel mediacodec -c:v h264_mediacodec -i \"$filePath\" -r 30 -c:v libx264 -b:v 6000k -minrate 6000k -maxrate 6000k -bufsize 24500k -preset veryfast -c:a copy -flvflags no_duration_filesize -f flv $testPath ") { executionId, returnCode ->
if (returnCode === com.arthenica.mobileffmpeg.Config.RETURN_CODE_SUCCESS) {
Log.i(Config.TAG, "Async command execution completed successfully.")
} else if (returnCode === com.arthenica.mobileffmpeg.Config.RETURN_CODE_CANCEL) {
Log.i(Config.TAG, "Async command execution cancelled by user.")
} else {
Log.i(Config.TAG, String.format("Async command execution failed with rc=%d.", returnCode))
}
}
log:
04/02 12:35:49: Launching 'app' on Google Pixel 4a.
Install successfully finished in 2 s 498 ms.
$ adb shell am start -n "com.example.rigobs/com.example.rigobs.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.example.rigobs.test | com.example.rigobs
Waiting for application to come online: com.example.rigobs.test | com.example.rigobs
Connected to process 15954 on device 'google-pixel_4a-11131JEC204565'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/ActivityThread: Application com.example.rigobs is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
Waiting for application to come online: com.example.rigobs.test | com.example.rigobs
Connecting to com.example.rigobs
Connected to the target VM, address: 'localhost:45709', transport: 'socket'
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/.example.rigob: Late-enabling -Xcheck:jni
I/.example.rigob: Unquickening 12 vdex files!
W/ActivityThread: Application com.example.rigobs is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/System.out: Debugger has connected
waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/chatty: uid=10317(com.example.rigobs) identical 2 lines
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1416)
D/ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/.example.rigob: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/.example.rigob: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
I/mobile-ffmpeg: Loading mobile-ffmpeg.
I/mobile-ffmpeg: Loaded mobile-ffmpeg-full-gpl-arm64-v8a-4.4-lts-20210207.
D/mobile-ffmpeg: Callback thread started.
I/AdrenoGLES-0: QUALCOMM build : 85da404, I46ff5fc46f
Build Date : 11/30/20
OpenGL ES Shader Compiler Version: EV031.31.04.01
Local Branch : promo490_3_Google
Remote Branch :
Remote Branch :
Reconstruct Branch :
Build Config : S P 10.0.4 AArch64
Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
I/AdrenoGLES-0: PFP: 0x016ee189, ME: 0x00000000
W/AdrenoUtils: <ReadGpuID_from_sysfs:197>: Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model
<ReadGpuID:221>: Failed to read chip ID from gpu_model. Fallback to use the GSL path
I/Gralloc4: mapper 4.x is not supported
D/mobile-ffmpeg: ffmpeg version v4.4-dev-416
D/mobile-ffmpeg: Copyright (c) 2000-2020 the FFmpeg developers
D/mobile-ffmpeg: built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
D/mobile-ffmpeg: configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android21-clang --cxx=aarch64-linux-android21-clang++ --extra-libs='-L/storage/light/projects/mobile-ffmpeg/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec
D/mobile-ffmpeg: libavutil 56. 55.100 / 56. 55.100
D/mobile-ffmpeg: libavcodec 58. 96.100 / 58. 96.100
D/mobile-ffmpeg: libavformat 58. 48.100 / 58. 48.100
D/mobile-ffmpeg: libavdevice 58. 11.101 / 58. 11.101
D/mobile-ffmpeg: libavfilter 7. 87.100 / 7. 87.100
D/mobile-ffmpeg: libswscale 5. 8.100 / 5. 8.100
D/mobile-ffmpeg: libswresample 3. 8.100 / 3. 8.100
D/mobile-ffmpeg: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Android/data/com.example.rigobs/files/Download/Big_Buck_Bunny_1080_10s_30MB.mp4':
D/mobile-ffmpeg: Metadata:
D/mobile-ffmpeg: major_brand :
D/mobile-ffmpeg: isom
D/mobile-ffmpeg: minor_version :
D/mobile-ffmpeg: 512
D/mobile-ffmpeg: compatible_brands:
D/mobile-ffmpeg: isomiso2avc1mp41
D/mobile-ffmpeg: title :
D/mobile-ffmpeg: Big Buck Bunny, Sunflower version
D/mobile-ffmpeg: artist :
D/mobile-ffmpeg: Blender Foundation 2008, Janus Bager Kristensen 2013
D/mobile-ffmpeg: composer :
D/mobile-ffmpeg: Sacha Goedegebure
D/mobile-ffmpeg: encoder :
D/mobile-ffmpeg: Lavf57.63.100
D/mobile-ffmpeg: comment :
D/mobile-ffmpeg: Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
D/mobile-ffmpeg: genre :
D/mobile-ffmpeg: Animation
D/mobile-ffmpeg: Duration:
D/mobile-ffmpeg: 00:00:10.00
D/mobile-ffmpeg: , start:
D/mobile-ffmpeg: 0.000000
D/mobile-ffmpeg: , bitrate:
D/mobile-ffmpeg: 24563 kb/s
D/mobile-ffmpeg: Stream #0:0
D/mobile-ffmpeg: (und)
D/mobile-ffmpeg: : Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 24559 kb/s
D/mobile-ffmpeg: ,
D/mobile-ffmpeg: 30 fps,
D/mobile-ffmpeg: 30 tbr,
D/mobile-ffmpeg: 15360 tbn,
D/mobile-ffmpeg: 60 tbc
D/mobile-ffmpeg: (default)
D/mobile-ffmpeg: Metadata:
D/mobile-ffmpeg: handler_name :
D/mobile-ffmpeg: VideoHandler
D/mobile-ffmpeg: [h264_mediacodec @ 0xb400006ff96e2970] Using surface 0x0
W/VideoCapabilities: Unsupported mime image/vnd.android.heic
D/CCodec: allocate(c2.qti.avc.decoder)
I/Codec2Client: Available Codec2 services: "default" "software"
I/CCodec: setting up 'default' as default (vendor) store
I/CCodec: Created component [c2.qti.avc.decoder]
D/CCodecConfig: read media type: video/avc
D/ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.pool-ids.values
D/CCodecConfig: ignoring local param raw.size (0xd2001800) as it is already supported
ignoring local param raw.color (0xd2001809) as it is already supported
ignoring local param raw.hdr-static-info (0xd200180a) as it is already supported
I/CCodecConfig: query failed after returning 17 values (BAD_INDEX)
D/CCodecConfig: c2 config diff is Dict {
c2::i32 algo.priority.value = -1
c2::float algo.rate.value = 30
c2::u32 algo.secure-mode.value = 0
c2::float coded.frame-rate.value = 30
c2::u32 coded.pl.level = 20480
c2::u32 coded.pl.profile = 20480
c2::u32 coded.vui.color.matrix = 0
c2::u32 coded.vui.color.primaries = 0
c2::u32 coded.vui.color.range = 0
c2::u32 coded.vui.color.transfer = 0
c2::u32 default.color.matrix = 0
c2::u32 default.color.primaries = 0
c2::u32 default.color.range = 0
c2::u32 default.color.transfer = 0
c2::u32 input.buffers.max-size.value = 13271040
c2::u32 input.delay.value = 0
string input.media-type.value = "video/avc"
c2::u32 output.delay.value = 18
string output.media-type.value = "video/raw"
c2::u32 raw.color.matrix = 0
c2::u32 raw.color.primaries = 0
c2::u32 raw.color.range = 0
c2::u32 raw.color.transfer = 0
c2::float raw.hdr-static-info.mastering.blue.x = 0
c2::float raw.hdr-static-info.mastering.blue.y = 0
c2::float raw.hdr-static-info.mastering.gree
W/ColorUtils: expected specified color aspects (0:0:0:0)
D/CCodec: [c2.qti.avc.decoder] buffers are bound to CCodec for this session
D/CCodecConfig: no c2 equivalents for csd-1
no c2 equivalents for flags
c2 config diff is c2::u32 raw.pixel-format.value = 842094169
W/ColorUtils: expected specified color aspects (0:0:0:0)
W/Codec2Client: query -- param skipped: index = 1107298332.
D/CCodec: setup formats input: AMessage(what = 0x00000000) = {
int32_t feature-secure-playback = 0
int32_t frame-rate = 30
int32_t height = 1080
int32_t level = 1
int32_t max-input-size = 13271040
string mime = "video/avc"
int32_t priority = 1
int32_t profile = 1
int32_t width = 1920
Rect crop(0, 0, 1919, 1079)
} and output: AMessage(what = 0x00000000) = {
int32_t android._video-scaling = 1
Rect crop(0, 0, 1919, 1079)
int32_t color-standard = 0
int32_t color-range = 0
int32_t color-transfer = 0
int32_t android._dataspace = 0
int32_t width = 1920
int32_t feature-secure-playback = 0
int32_t frame-rate = 30
int32_t height = 1080
int32_t max-height = 2160
int32_t max-width = 4096
string mime = "video/raw"
int32_t priority = 1
int32_t rotation-degrees = 0
int32_t sar-height = 1
int32_t sar-width = 1
Buffer hdr-static-info = {
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000010: 00 00 00 00 00 00 00 00 00
W/Codec2Client: query -- param skipped: index = 1342179345.
query -- param skipped: index = 2415921170.
query -- param skipped: index = 1610614798.
D/CCodecBufferChannel: [c2.qti.avc.decoder#688] Query input allocators returned 0 params => BAD_INDEX (6)
E/FMQ: grantorIdx must be less than 3
grantorIdx must be less than 3
D/CCodecBufferChannel: [c2.qti.avc.decoder#688] Created input block pool with allocatorID 16 => poolID 17 - OK (0)
[c2.qti.avc.decoder#688] Query output allocators returned 0 params => BAD_INDEX (6)
D/CCodecBufferChannel: [c2.qti.avc.decoder#688] Configured output block pool ids 1 => OK
E/ion: ioctl c0044901 failed with code -1: Inappropriate ioctl for device
E/FMQ: grantorIdx must be less than 3
D/CCodecBuffers: Increasing local buffer pool capacity from 37748736 to 75497472
D/mobile-ffmpeg: [h264_mediacodec @ 0xb400006ff96e2970] Output crop parameters top=0 bottom=1079 left=0 right=1919, resulting dimensions width=1920 height=1080
D/mobile-ffmpeg: [h264_mediacodec @ 0xb400006ff96e2970] MediaCodec started successfully: codec = c2.qti.avc.decoder, ret = 0
D/mobile-ffmpeg: Stream mapping:
D/mobile-ffmpeg: Stream #0:0 -> #0:0
D/mobile-ffmpeg: (h264 (h264_mediacodec) -> h264 (libx264))
D/mobile-ffmpeg: Press [q] to stop, [?] for help
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/chatty: uid=10317(com.example.rigobs) Thread-2 identical 22 lines
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
D/CCodecConfig: c2 config diff is c2::u32 raw.crop.height = 1080
c2::u32 raw.crop.left = 0
c2::u32 raw.crop.top = 0
c2::u32 raw.crop.width = 1920
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
W/ColorUtils: expected specified color aspects (0:0:0:0)
D/CCodecBuffers: [c2.qti.avc.decoder#688:Output[N]] updating image-data
D/CCodecBuffers: [c2.qti.avc.decoder#688:Output[N]] updating stride = 1920
[c2.qti.avc.decoder#688:Output[N]] updating vstride = 1080
[c2.qti.avc.decoder#688:Output[N]] popFromStashAndRegister: output format changed to AMessage(what = 0x00000000) = {
int32_t android._video-scaling = 1
Rect crop(0, 0, 1919, 1079)
int32_t color-standard = 0
int32_t color-range = 0
int32_t color-transfer = 0
int32_t android._dataspace = 0
int32_t width = 1920
int32_t feature-secure-playback = 0
int32_t frame-rate = 30
int32_t height = 1080
int32_t max-height = 2160
int32_t max-width = 4096
string mime = "video/raw"
int32_t priority = 1
int32_t rotation-degrees = 0
int32_t sar-height = 1
int32_t sar-width = 1
Buffer hdr-static-info = {
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000010: 00 00 00 00 00 00 00 00 00 .........
}
int32_t android._color-format = 2135033992
int32_t color-format = 19
}
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/chatty: uid=10317(com.example.rigobs) Thread-2 identical 5 lines
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/chatty: uid=10317(com.example.rigobs) Thread-2 identical 67 lines
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/chatty: uid=10317(com.example.rigobs) Thread-2 identical 13 lines
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/chatty: uid=10317(com.example.rigobs) Thread-2 identical 17 lines
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/hw-BpHwBinder: onLastStrongRef automatically unlinking death recipients
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/chatty: uid=10317(com.example.rigobs) Thread-2 identical 8 lines
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/mobile-ffmpeg: Async command execution failed with rc=69.
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
I/chatty: uid=10317(com.example.rigobs) Thread-2 identical 146 lines
D/mobile-ffmpeg: Error while decoding stream #0:0: Try again
D/mobile-ffmpeg: [h264_mediacodec @ 0xb400006ff96e2970] Output MediaFormat changed to {crop-right=1919, max-height=2160, sar-width=1, color-format=19, slice-height=1080, image-data=java.nio.HeapByteBuffer[pos=0 lim=104 cap=104], mime=video/raw, hdr-static-info=java.nio.HeapByteBuffer[pos=0 lim=25 cap=25], priority=1, stride=1920, color-standard=0, feature-secure-playback=0, color-transfer=0, sar-height=1, crop-bottom=1079, max-width=4096, crop-left=0, width=1920, color-range=0, crop-top=0, frame-rate=30, rotation-degrees=0, height=1080}
D/mobile-ffmpeg: [h264_mediacodec @ 0xb400006ff96e2970] Output crop parameters top=0 bottom=1079 left=0 right=1919, resulting dimensions width=1920 height=1080
D/mobile-ffmpeg: [graph 0 input from stream 0:0 @ 0xb400006f89690d10] sws_param option is deprecated and ignored
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] using SAR=1/1
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] using cpu capabilities: ARMv8 NEON
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] profile High, level 4.0, 4:2:0, 8-bit
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=cbr mbtree=1 bitrate=6000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=6000 vbv_bufsize=24500 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
D/mobile-ffmpeg: Output #0, flv, to '/storage/emulated/0/Android/data/com.example.rigobs/files/Download/test.mp4':
D/mobile-ffmpeg: Metadata:
D/mobile-ffmpeg: major_brand :
D/mobile-ffmpeg: isom
D/mobile-ffmpeg: minor_version :
D/mobile-ffmpeg: 512
D/mobile-ffmpeg: compatible_brands:
D/mobile-ffmpeg: isomiso2avc1mp41
D/mobile-ffmpeg: title :
D/mobile-ffmpeg: Big Buck Bunny, Sunflower version
D/mobile-ffmpeg: artist :
D/mobile-ffmpeg: Blender Foundation 2008, Janus Bager Kristensen 2013
D/mobile-ffmpeg: composer :
D/mobile-ffmpeg: Sacha Goedegebure
D/mobile-ffmpeg: genre :
D/mobile-ffmpeg: Animation
D/mobile-ffmpeg: comment :
D/mobile-ffmpeg: Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
D/mobile-ffmpeg: encoder :
D/mobile-ffmpeg: Lavf58.48.100
D/mobile-ffmpeg: Stream #0:0
D/mobile-ffmpeg: (und)
D/mobile-ffmpeg: : Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 6000 kb/s
D/mobile-ffmpeg: ,
D/mobile-ffmpeg: 30 fps,
D/mobile-ffmpeg: 1k tbn,
D/mobile-ffmpeg: 30 tbc
D/mobile-ffmpeg: (default)
D/mobile-ffmpeg: Metadata:
D/mobile-ffmpeg: handler_name :
D/mobile-ffmpeg: VideoHandler
D/mobile-ffmpeg: encoder :
D/mobile-ffmpeg: Lavc58.96.100 libx264
D/mobile-ffmpeg: Side data:
D/mobile-ffmpeg:
D/mobile-ffmpeg: cpb:
D/mobile-ffmpeg: bitrate max/min/avg: 6000000/0/6000000 buffer size: 24500000
D/mobile-ffmpeg: vbv_delay: N/A
D/mobile-ffmpeg: frame= 4 fps=0.0 q=-1.0 Lsize= 469kB time=00:00:09.96 bitrate= 385.5kbits/s speed=19.5x
D/mobile-ffmpeg: video:468kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
D/mobile-ffmpeg: 0.135929%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] frame I:1 Avg QP:21.15 size:448158
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] frame P:1 Avg QP:25.21 size: 16655
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] frame B:2 Avg QP:24.32 size: 7050
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] consecutive B-frames: 25.0% 0.0% 75.0% 0.0%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] mb I I16..4: 0.4% 8.0% 91.6%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] mb P I16..4: 0.0% 0.6% 0.1% P16..4: 25.3% 11.7% 6.4% 0.0% 0.0% skip:55.9%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 14.0% 4.0% 0.6% direct: 5.5% skip:75.9% L0:55.2% L1:17.7% BI:27.1%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] 8x8 transform intra:8.5% inter:31.0%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] coded y,uvDC,uvAC intra: 99.0% 99.3% 92.5% inter: 5.2% 2.0% 0.1%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] i16 v,h,dc,p: 8% 19% 28% 44%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 17% 13% 5% 8% 7% 6% 10% 11%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 13% 16% 5% 13% 8% 8% 10% 10%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] i8c dc,h,v,p: 49% 24% 15% 12%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] Weighted P-Frames: Y:0.0% UV:0.0%
D/mobile-ffmpeg: [libx264 @ 0xb400006ff96bc0c0] kb/s:28734.78
D/mobile-ffmpeg: Conversion failed!
This project will be retired. Please consider switching to FFmpegKit.
Description
Using mediacodec sometimes works, but most of the time fails. When it fails, no frames are decoded.
Here's my code, which simply downloads a Blender test mp4 video, decodes it using mediacodec, and re-encodes it using libx264.
Expected behavior mediacodec to initialize and decode frames consistently
Current behavior Same code will fail most of the time on either an emulator or a real device. Every now and then the same code will begin decoding successfully.
Screenshots If applicable, add screenshots to help explain your problem.
Logs
Log when ran successfully on an emulator:
Log when fails on emulator:
Log when fails on device:
Environment
Other Sorry if this should be posted over at FFmpeg, figured I'd try here first.