Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When adding a watermark to the video, this error log, how do I solve it? #1078

Open
343757500 opened this issue Dec 5, 2024 · 0 comments
Open

Comments

@343757500
Copy link

dependencies {
implementation 'com.arthenica:ffmpeg-kit-full:4.5'
}

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
        String currentTime = sdf.format(new Date());
        String inputFilePath = "/storage/emulated/0/Android/data/com.wisezk.uniphone/files/Videos/1733385371230.mp4";
        String outputFilePath = "/storage/emulated/0/Android/data/com.wisezk.uniphone/files/Videos/output.mp4";
        String ffmpegCommand = String.format("-i %s -vf \"drawtext=text='%s'\" %s",
                inputFilePath, currentTime, outputFilePath);
        FFmpegKit.executeAsync(ffmpegCommand,session -> {
            if (!ReturnCode.isSuccess(session.getReturnCode())) {
                Log.d("FFmpegKit", ""+session.getAllLogsAsString());
            }
        });

ffmpeg version v4.5-dev-2008-g90da43557f Copyright (c) 2000-2021 the FFmpeg developers
built with Android (7284624, based on r416183b) clang version 12.0.5 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee)
configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/23.0.7599858/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/storage/light/projects/ffmpeg-kit/prebuilt/android-arm64-lts/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android21-clang --cxx=aarch64-linux-android21-clang++ --ranlib=llvm-ranlib --strip=llvm-strip --nm=llvm-nm --extra-libs='-L/storage/light/projects/ffmpeg-kit/prebuilt/android-arm64-lts/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 --disable-static --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-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-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libtwolame --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec
libavutil 57. 5.100 / 57. 5.100
libavcodec 59. 7.103 / 59. 7.103
libavformat 59. 5.100 / 59. 5.100
libavdevice 59. 0.101 / 59. 0.101
libavfilter 8. 9.100 / 8. 9.100
libswscale 6. 1.100 / 6. 1.100
libswresample 4. 0.100 / 4. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Android/data/com.wisezk.uniphone/files/Videos/1733385371230.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2024-12-05T07:56:21.000000Z
com.android.version: 11
Duration: 00:00:08.51, start: 0.000000, bitrate: 18668 kb/s
Stream #0:00x1: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 20053 kb/s, 30 fps, 30 tbr, 90k tbn (default)
Metadata:
creation_time : 2024-12-05T07:56:21.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Stream #0:10x2: Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
Metadata:
creation_time : 2024-12-05T07:56:21.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[Parsed_drawtext_0 @ 0x779a76d890] Cannot find a valid font for the family Sans
[AVFilterGraph @ 0x776a776430] Error initializing filter 'drawtext'[AVFilterGraph @ 0x776a776430] with args 'fontfile=/path/to/font.ttf:text=2024-12-05 18:50:59'[AVFilterGraph @ 0x776a776430]
Error reinitializing filters!
Failed to inject frame into filter network: No such file or directory
Error while processing the decoded data for stream #0:0
[aac @ 0x780a7beb50] Qavg: 3109.650
[aac @ 0x780a7beb50] 2 frames left in the queue on closing
Conversion failed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant