Skip to content

Most videos from my phone fail to encode #167

Description

@yaomtc

Describe the bug
Most videos I have give me an error when I try to encode them.

Settings applied
Everything is set to default.

App Logs

Command:
ffmpeg -y -i VID_20260831_224847.mp4 -preset medium -crf 23 -b:a 192k -maxrate 1735k -bufsize 1735k -vf "scale=-1:720,setsar=1,format=yuv420p" 307652a7-0377-4818-b3b9-116996683b6d.mp4
Output:
ffmpeg version n8.1.2 Copyright (c) 2000-2026 the FFmpeg developers
  built with Android (13691557, +pgo, +bolt, +lto, +mlgo, based on r522817d) clang version 18.0.4 (https://android.googlesource.com/toolchain/llvm-project d8003a456d14a3deb8054cdaa529ffbf02d9b262)
  configuration: --cross-prefix=aarch64-linux-android- --sysroot=/nix/store/6sd6s3z4zc0cv300biwa1gq66b1p8kg7-androidsdk/libexec/android-sdk/ndk/27.3.13750724/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/vagrant/build/com.caydey.ffshare/ffmpeg-kit-next/prebuilt/android-arm64-24/ffmpeg --pkg-config=/nix/store/h5rj7l2nxnhwz88jj5ljkpr1dz3x0p0f-pkg-config-wrapper-0.29.2/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=llvm-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=llvm-ranlib --strip=llvm-strip --nm=llvm-nm --extra-libs='-L/home/vagrant/build/com.caydey.ffshare/ffmpeg-kit-next/prebuilt/android-arm64-24/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --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-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libdav1d --enable-libkvazaar --enable-libx264 --enable-libxvid --enable-libx265 --enable-libvidstab --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-libzimg --disable-openssl --enable-libharfbuzz --enable-zlib --disable-mediacodec --enable-libvvenc --enable-libjxl --enable-gpl
  libavutil      60. 26.102 / 60. 26.102
  libavcodec     62. 28.102 / 62. 28.102
  libavformat    62. 12.102 / 62. 12.102
  libavdevice    62.  3.102 / 62.  3.102
  libavfilter    11. 14.102 / 11. 14.102
  libswscale      9.  5.102 /  9.  5.102
  libswresample   6.  3.102 /  6.  3.102
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ffkitsaf:8.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2026-09-01T03:49:55.000000Z
    com.android.version: 17
  Duration: 00:01:07.18, start: 0.000000, bitrate: 35870 kb/s
  Stream #0:0[0x1](eng): Video: h264 (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 3840x2160, 35773 kb/s, 29.80 fps, 29.75 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2026-09-01T03:49:55.000000Z
      handler_name    : VideoHandle
    Side data:
      Display Matrix: rotation of -90.00 degrees
  Stream #0:1[0x2](eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 96 kb/s, start 0.019792 (default)
    Metadata:
      creation_time   : 2026-09-01T03:49:55.000000Z
      handler_name    : SoundHandle
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[swscaler @ 0xdd815d554000] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0xdc01e6a7d600] width not divisible by 2 (405x720)
[vost#0:0/libx264 @ 0xdbdf5db38a00] [enc:libx264 @ 0xdb5172241380] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0xdc2251292e00] Error sending frames to consumers: Generic error in an external library
[vf#0:0 @ 0xdc2251292e00] Task finished with error code: -542398533 (Generic error in an external library)
[vf#0:0 @ 0xdc2251292e00] Terminating thread with return code -542398533 (Generic error in an external library)
[af#0:1 @ 0xdbd425cb3200] No filtered frames for output stream, trying to initialize anyway.
[vost#0:0/libx264 @ 0xdbdf5db38a00] [enc:libx264 @ 0xdb5172241380] Could not open encoder before EOF
[vost#0:0/libx264 @ 0xdbdf5db38a00] Task finished with error code: -22 (Invalid argument)
[vost#0:0/libx264 @ 0xdbdf5db38a00] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 0xdb7faf245300] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:00.48    
[aac @ 0xdc01e6a9b900] Qavg: nan
Conversion failed!

Result: FAILURE
App Version: 2.0.0

File used

Tested a variety of videos I recorded with my Pixel 8 Pro.

For example: https://mega.nz/file/KFEAAbqR#h3iBuBL1sTPVwFCTgAxUo_WZ7byVzJTsnJpwQbDtj8U

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions