caydey / ffshare

An android app to compress image, video and audio files through ffmpeg before sharing them
GNU General Public License v3.0
615 stars 30 forks source link

Cannot convert any video #54

Closed samlemarnais closed 5 months ago

samlemarnais commented 1 year ago

Hi, I can't make FFShare working on any of my devices (pixel 3 and 5). I always receive an error. Here are the logs of my latest attempt:

Command:
ffmpeg -y -i PXL_20230805_074353893.mp4 -preset fast -crf 25 -vf format=yuv420p -c:v h264 -vf scale=-1:720,setsar=1 PXL_20230805_074353893.mp4
Output:
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
  configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/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-postproc --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-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-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-zlib --enable-mediacodec --enable-gpl
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'saf:8.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 131072
    compatible_brands: isomiso2mp41
    creation_time   : 2023-08-05T07:44:10.000000Z
    com.android.capture.fps: 30.000000
  Duration: 00:00:13.55, start: 0.000000, bitrate: 20055 kb/s
  Stream #0:0[0x1](eng): Data: none (mett / 0x7474656D), 36 kb/s (default)
    Metadata:
      creation_time   : 2023-08-05T07:44:10.000000Z
      handler_name    : MetaHandle
  Stream #0:1[0x2](eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s (default)
    Metadata:
      creation_time   : 2023-08-05T07:44:10.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](eng): Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt470bg/bt470bg/smpte170m), 1920x1080, 19819 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 30 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2023-08-05T07:44:10.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
    Side data:
      displaymatrix: rotation of -90.00 degrees
Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v scale=-1:720,setsar=1' will be used.
Stream mapping:
  Stream #0:2 -> #0:0 (hevc (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c22380] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c423a0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c823e0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c723d0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c623c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c923f0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29cc2420] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29ca2400] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29cd2430] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29cd2430] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29ca2400] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29cc2420] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c923f0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c623c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c723d0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c823e0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c423a0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c22380] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c22380] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c423a0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c823e0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c723d0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c623c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c923f0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29cc2420] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29ca2400] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29cd2430] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29cd2430] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29ca2400] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29cc2420] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c923f0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c623c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c723d0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c823e0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c423a0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xb400007c29c32390] [swscaler @ 0xb400007c29c22380] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0xb400007b299fe0f0] width not divisible by 2 (405x720)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Result: FAILURE
App Version: 1.2.6
samlemarnais commented 1 year ago

Is there something to do with "scale=-1:720"? The -1 looks odd (but maybe a special value to say "whatever"). I don't know anything about FFMpeg

caydey commented 1 year ago

if it not too much to ask are you able to send the video over to me so I can further look into what's causing the issue

buddhhu commented 1 year ago

if it not too much to ask are you able to send the video over to me so I can further look into what's causing the issue

It's written width not divisible by 2 (405x720) in 5th line from last, you need to manually check width and height to be divisible by 2, if not just ±1 in width or height, and you need to replace -1 in scale with the value you got.

caydey commented 5 months ago

Closed by #75