FFmpeg - 在图像上添加水印

FFmpeg - 在图像上添加水印

我使用此命令在图像上添加水印:

ffmpeg -i input.png -i watermark.png -filter_complex overlay=15:15 output.png

但是我收到了这个错误:

[NULL @ 0x7a1403f800] Unable to find a suitable output format for '/storage/emulated/0/A_Folder/ac/img_wat.png'

我已经在视频上添加了水印,但在这种情况下我不知道如何对图像而不是视频进行水印添加。

有人可以帮帮我吗?

编辑

这是完整日志:

built with gcc 4.9.x (GCC) 20150123 (prerelease)
      configuration: --target-os=android --cross-prefix=/home/george/ffmpeg-android/toolchain-android/bin/aarch64-linux-android- --arch=arm64 --cpu=cortex-a57 --enable-runtime-cpudetect --sysroot=/home/george/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-filters --enable-libx264 --enable-zlib --enable-libfreetype --enable-libmp3lame --enable-fontconfig --enable-pthreads --enable-protocol=file --disable-debug --disable-network --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-small --disable-shared --enable-static --enable-ffmpeg --enable-jni --enable-mediacodec --disable-bsfs --disable-encoders --enable-encoder='rawvideo,libx264,mpeg4,bmp,png,aac,mp3,gif,libmp3lame,pcm_s8,pcm_u8' --disable-decoders --enable-decoder='aac,h264,h264_mediacodec,mpeg4,mpeg4_mediacodec,bmp,mp3,png,gif,pcm_s8,pcm_u8' --disable-muxers --enable-muxer='mp3,gif,mp4,rawvideo,ac3,flac,ipod,pcm_u8' --disable-demuxers --enable-demuxer='aac,gif,mp3,image_png_pipe,rawvideo,mov,flac,ac3,sdp,pcm_u8,mpegvideo' --disable-parsers --enable-parser='aac,bmp,h264,mjpeg,png,mpeg4video,mpegvideo,mpegaudio' --disable-hwaccels --enable-hwaccel=h264_mediacodec --enable-gpl --disable-x86asm --disable-doc --pkg-config=/home/george/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/george/ffmpeg-android/build/arm64 --extra-cflags='-I/home/george/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -Wall -Os -O3 -pipe -ffast-math' --extra-ldflags='-L/home/george/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -luuid -lm -lz' --extra-cxxflags=
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, png_pipe, from '/storage/emulated/0/Pictures/Screenshots/Screenshot_20181228-014724.png':

  Duration: N/A, bitrate: N/A

    Stream #0:0: Video: png, rgb24(pc), 2160x3840, 25 tbr, 25 tbn, 25 tbc

Input #1, png_pipe, from '/storage/emulated/0/stv_text_icon.png':

  Duration: N/A, bitrate: N/A

    Stream #1:0: Video: png, rgba(pc), 205x53 [SAR 2835:2835 DAR 205:53], 25 tbr, 25 tbn, 25 tbc

[NULL @ 0x76f9c3f800] Unable to find a suitable output format for '/storage/emulated/0/A_Folder/ac/img_wat.png'

/storage/emulated/0/A_Folder/ac/img_wat.png: Invalid argument

答案1

您的 ffmpeg 尚未编译为支持图像序列复用器。您需要在运行时启用图像序列复用器configure

--enable-muxer='mp3,gif,image2,mp4,rawvideo,ac3,flac,ipod,pcm_u8' 

相关内容