a-schild / jave2

The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project
GNU General Public License v3.0
1.24k stars 247 forks source link

Ffmpeg No such filter Exception #219

Open 156640677 opened 1 year ago

156640677 commented 1 year ago

I want to add a rotating watermark to the video, and the command executed is as follows: It can be converted correctly under Windows system (Windows 10). However, an error will be reported under Linux

2022-10-30 11:53:59.423 [pool-66-thread-1] INFO  c.s.lglm.action.video.VideoExecution - ffmpegCmd final is :/home/apache-tomcat-8.5.82/temp/jave/ffmpeg-amd64-3.1.1  -y  -i /tmp/lglm/video/LGLM1/2022/10/01_451C4183280739A508E814B9F4591451.mp4 -i /tmp/lglm/video/watermark_video.png -lavfi "[1:v]format=rgba,scale=200:-1,colorchannelmixer=aa=99/100,rotate='PI/(180/1):c=0x00000000:ow=hypot(iw,ih):oh=ow'[out];[0:v][out]overlay=main_w-overlay_w-20:main_h-overlay_h-20" /tmp/lglm/video/LGLM1/2022/10/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695/ts/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695_ts.mp4 
2022-10-30 11:53:59.433 [pool-66-thread-1] INFO  c.s.lglm.action.video.VideoProcess - ffmpeg version 4.2.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/lglm/video/LGLM1/2022/10/01_451C4183280739A508E814B9F4591451.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Multimedia Cloud Transcode (cloud.baidu.com)
    comment         : Content Adaptive Encoding 3.0
  Duration: 00:05:17.05, start: 0.000000, bitrate: 640 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x1280 [SAR 1:1 DAR 9:16], 503 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 133 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, png_pipe, from '/tmp/lglm/video/watermark_video.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, rgba(pc), 561x143 [SAR 11811:11811 DAR 51:13], 25 tbr, 25 tbn, 25 tbc
[AVFilterGraph @ 0x70e06c0] No such filter: '"'
Error initializing complex filters.
Invalid argument

Linux system version

[root@sx_test video]# cat /proc/version
Linux version 3.10.0-1160.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Mon Oct 19 16:18:59 UTC 2020
[root@sx_test video]# uname -a
Linux sx_test 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@sx_test video]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

Java version

[root@sx_test ts]# java -version
openjdk version "1.8.0_352"
OpenJDK Runtime Environment (build 1.8.0_352-b08)
OpenJDK 64-Bit Server VM (build 25.352-b08, mixed mode)

Try upgrading to version 3.3.1 and the same issue will still occur. Trying to upgrade Tomcat version to 9.0 did not resolve the issue.

I'm sure the directory in question exists

[root@sx_test video]# pwd
/tmp/lglm/video
[root@sx_test video]# ll
total 8
drwxr-x---. 3 root root   18 Nov  2 10:21 LGLM1
-rw-r-----. 1 root root 6408 Nov  2 10:22 watermark_video.png
[root@sx_test video]# cd LGLM1/2022/10/
[root@sx_test 10]# ll
total 24800
-rw-r-----. 1 root root 25391934 Nov  2 10:22 01_451C4183280739A508E814B9F4591451.mp4
drwxr-x---. 3 root root       16 Nov  2 10:22 01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695
[root@sx_test 10]# cd 01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695/ts/
[root@sx_test ts]# pwd
/tmp/lglm/video/LGLM1/2022/10/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695/ts
[root@sx_test ts]#

Trying to execute directly from the command line will be done correctly

[root@sx_test etc]# /home/apache-tomcat-8.5.82/temp/jave/ffmpeg-amd64-3.3.1  -y  -i /tmp/lglm/video/LGLM1/2022/10/01_451C4183280739A508E814B9F4591451.mp4 -i /tmp/lglm/video/watermark_video.png -lavfi "[1:v]format=rgba,scale=200:-1,colorchannelmixer=aa=99/100,rotate='PI/(180/1):c=0x00000000:ow=hypot(iw,ih):oh=ow'[out];[0:v][out]overlay=main_w-overlay_w-20:main_h-overlay_h-20" /tmp/lglm/video/LGLM1/2022/10/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695/ts/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695_ts.mp4
ffmpeg version 4.4.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/lglm/video/LGLM1/2022/10/01_451C4183280739A508E814B9F4591451.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Multimedia Cloud Transcode (cloud.baidu.com)
    comment         : Content Adaptive Encoding 3.0
  Duration: 00:05:17.05, start: 0.000000, bitrate: 640 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x1280 [SAR 1:1 DAR 9:16], 503 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 133 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Input #1, png_pipe, from '/tmp/lglm/video/watermark_video.png':
  Duration: N/A, bitrate: N/A
  Stream #1:0: Video: png, rgba(pc), 561x143 [SAR 11811:11811 DAR 51:13], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 (h264) -> overlay:main (graph 0)
  Stream #1:0 (png) -> format (graph 0)
  overlay (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x6f36f40] using SAR=1/1
[libx264 @ 0x6f36f40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x6f36f40] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x6f36f40] 264 - core 164 r3075 66a5bc1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/tmp/lglm/video/LGLM1/2022/10/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695/ts/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695_ts.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    comment         : Content Adaptive Encoding 3.0
    encoder         : Lavf58.76.100
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 720x1280 [SAR 1:1 DAR 9:16], q=2-31, 30 fps, 15360 tbn (default)
    Metadata:
      encoder         : Lavc58.134.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 aac
frame= 9510 fps=123 q=-1.0 Lsize=   36244kB time=00:05:16.99 bitrate= 936.6kbits/s speed= 4.1x   
video:30920kB audio:4990kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.929435%
[libx264 @ 0x6f36f40] frame I:39    Avg QP:15.45  size: 52687
[libx264 @ 0x6f36f40] frame P:2956  Avg QP:17.61  size:  6708
[libx264 @ 0x6f36f40] frame B:6515  Avg QP:21.27  size:  1501
[libx264 @ 0x6f36f40] consecutive B-frames:  2.1% 15.0% 14.0% 68.9%
[libx264 @ 0x6f36f40] mb I  I16..4: 35.2% 40.8% 24.0%
[libx264 @ 0x6f36f40] mb P  I16..4:  2.4%  7.9%  0.9%  P16..4: 10.7%  3.6%  1.4%  0.0%  0.0%    skip:73.0%
[libx264 @ 0x6f36f40] mb B  I16..4:  0.2%  0.7%  0.1%  B16..8:  9.0%  1.5%  0.3%  direct: 0.5%  skip:87.7%  L0:47.4% L1:46.9% BI: 5.6%
[libx264 @ 0x6f36f40] 8x8 transform intra:67.8% inter:76.3%
[libx264 @ 0x6f36f40] coded y,uvDC,uvAC intra: 45.5% 38.9% 6.3% inter: 2.8% 2.0% 0.1%
[libx264 @ 0x6f36f40] i16 v,h,dc,p: 31% 36%  8% 25%
[libx264 @ 0x6f36f40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 22% 19%  4%  5%  6%  6%  5%  6%
[libx264 @ 0x6f36f40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 27% 13%  5%  7%  7%  6%  5%  5%
[libx264 @ 0x6f36f40] i8c dc,h,v,p: 65% 19% 13%  3%
[libx264 @ 0x6f36f40] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x6f36f40] ref P L0: 63.3% 15.2% 13.9%  7.6%
[libx264 @ 0x6f36f40] ref B L0: 85.6% 11.4%  3.0%
[libx264 @ 0x6f36f40] ref B L1: 98.1%  1.9%
[libx264 @ 0x6f36f40] kb/s:799.03
[aac @ 0x6e67e80] Qavg: 183.656

It is possible to modify the command to simple video transcoding

/home/apache-tomcat-8.5.82/temp/jave/ffmpeg-amd64-3.1.1  -y  -i /tmp/lglm/video/LGLM1/2022/10/01_451C4183280739A508E814B9F4591451.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb /tmp/lglm/video/LGLM1/2022/10/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695/ts/01_A1B78C6C-4952-11ED-A699-FA163EE5272B5695_ts.mp4

The problem is not resolved after several attempts. Please help to see if there is a problem with the command?

Thank you!