升级到最新版本的 ffmpeg 2.8.4 后,我现在遇到了“zoompan”复杂过滤器的错误。这在早期版本 (2.6) 上运行良好。如果我删除该特定命令,进程就会运行。
导致错误的行:
zoompan=z="min(zoom+0.0015\,1.5)":d=700:x="if(gte(zoom\,1.5)\,x\,x+1/a)": y="if(gte(zoom\,1.5)\,y\,y+1)":s=1280x720'
整个命令
cmd = 'ffmpeg'
cmd += ' -loop 1 -i ' + base_images[0] + ' -loop 1 -i ' + base_images[1] + ' -loop 1 -i ' + base_images[2] + ' -loop 1 -i ' + base_images[3]
cmd += ' -filter_complex " '
cmd += ' nullsrc=size=1280x760 [base]; '
cmd += '[0:v] setpts=PTS-STARTPTS,scale=640x380 [upperleft];'
cmd += '[1:v] setpts=PTS-STARTPTS,scale=640x380 [upperright];'
cmd += '[2:v] setpts=PTS-STARTPTS,scale=640x380 [lowerleft];'
cmd += '[3:v] setpts=PTS-STARTPTS,scale=640x380 [lowerright];'
cmd += '[base][upperleft] overlay=shortest=1 [tmp1];'
cmd += '[tmp1][upperright] overlay=shortest=1:x=640 [tmp2];'
cmd += '[tmp2][lowerleft] overlay=shortest=1:y=380 [tmp3];'
cmd += '[tmp3][lowerright] overlay=shortest=1:x=640:y=380"'
cmd += ',zoompan=z="min(zoom+0.0015\,1.5)":d=700:x="if(gte(zoom\,1.5)\,x\,x+1/a)":y="if(gte(zoom\,1.5)\,y\,y+1)":s=1280x720'
cmd += ',drawbox=enable="gt(t\,1)*lt(t\,7)":x="(iw/6)":y="(ih/2)-100":[email protected]:width=iw/1.5:height=100:t=max'
cmd += ',drawbox=enable="gt(t\,1)*lt(t\,7)":x="(iw/3)":y="(ih/1.9)":[email protected]:width=iw/3:height=110:t=max'
cmd += ',"drawtext=fontfile=' + fontfile + ':fontcolor=white:x=(w-text_w)/2:y=(h-text_h-line_h)/2.2:text=' + "The End" + ':fontsize=38","drawtext=fontfile=' + fontfile + ':fontcolor=white:x=(w-text_w)/2:y=(h-text_h-line_h)/1.7:text=' + create_date[0] + ':fontsize=28","drawtext=fontfile=' + fontfile + ':fontcolor=white:x=(w-text_w)/2:y=(h-text_h-line_h)/1.5:text=' + create_date[1] + ':fontsize=28","fps=30"'
cmd += ' -t 5 -c:v libx264 -y ' + theend_video
错误信息
[swscaler @ 0x7fd6b23efe00] Warning: data is not aligned! This can lead to a speedloss
[output stream 0:0 @ 0x7fd6b0c2c2a0] 100 buffers queued in output stream 0:0, something may be wrong.
**ffmpeg(42836,0x7fff797f9300) malloc: *** error for object 0x7fd6b0c34020: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug**
ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=/usr/bin/clang --host-cflags='-Os -w -pipe -march=native -mmacosx-version-min=10.10' --host-ldflags='-L/usr/local/opt/icu4c/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/gettext/lib -L/usr/local/lib -Wl,-headerpad_max_install_names' --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay --enable-libfdk-aac --enable-libopus --enable-libquvi --enable-libx265 --enable-nonfree --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7faee1800000] moov atom not found