ffmpeg图像叠加导致视频冻结

时间:2019-04-10 07:24:49

标签: php command-line ffmpeg

我制作了一个php脚本,该脚本生成ffmpeg命令行,该命令行生成带有淡入淡出的电影。当我在视频上添加图像时,第一个场景在大约3秒钟后冻结了不到一秒钟,然后一切正常。

当我不添加图像时,一切正常。当我在浏览器中执行命令行时,一切正常,但是当我在命令行中使用png图像执行时,会发生错误,jpg图像没有显示错误,但1秒冻结仍然存在。

C:\xampp\htdocs\ffmpeg>ffmpeg -y -i 60SecondCountdown.mp4 -i image.png -filter_complex "[0:a]atrim=0:duration=8.667,afifo[a0];[0:v]trim=0:duration=6.667,setpts=PTS-STARTPTS[v0];[0:v]trim=6.667:duration=1,setpts=PTS-STARTPTS,format=pix_fmts=yuva420p,fade=t=out:alpha=1[0fo];[0:a]atrim=10:duration=8.667,afifo[a1];[0:v]trim=11:duration=5.667,setpts=PTS-STARTPTS[v1];[0:v]trim=10:duration=1,setpts=PTS-STARTPTS,format=pix_fmts=yuva420p,fade=t=in:alpha=1[0fi];[0:v]trim=16.667:duration=1,setpts=PTS-STARTPTS,format=pix_fmts=yu
va420p,fade=t=out:alpha=1[1fo];[0:a]atrim=21:duration=6.666,afifo[a2];[0:v]trim=22:duration=5.666,setpts=PTS-STARTPTS[v2];[0:v]trim=21:duration=1,setpts=PTS-STARTPTS,format=pix_fmts=yuva420p,fade=t=in:alpha=1[1fi];[0fi]fifo[0fififo];[0fo]fifo[0fofifo];[1fi]fifo
[1fififo];[1fo]fifo[1fofifo];[0fofifo][0fififo]overlay[0f];[1fofifo][1fififo]overlay[1f];[v0][0f][v1][1f][v2]concat=n=5[output];[a0][a1]acrossfade=d=2[audio];[output]scale=320:-1[output];[output][1:v]overlay=W-w-20:H-h-20[output];[audio][a2]acrossfade=d=2[audio
]" -map [output] -map [audio] 2>&1 -strict -2 preview/20190411092942.mp4
ffmpeg version N-77715-gfc703f5 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --en
able-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --en
able-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --
enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 12.100 / 55. 12.100
  libavcodec     57. 21.100 / 57. 21.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 23.100 /  6. 23.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '60SecondCountdown.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-08-28 07:24:49
  Duration: 00:01:05.97, start: 0.000000, bitrate: 994 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x676 [SAR 1:1 DAR 320:169], 864 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2016-08-28 07:24:49
      handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2016-08-28 07:24:49
      handler_name    : ISO Media file produced by Google Inc.
[png @ 0000022d8a48e1e0] Invalid PNG signature 0x10001002828.
[image2 @ 0000022d8a4ade20] decoding for stream 0 failed
[image2 @ 0000022d8a4ade20] Could not find codec parameters for stream 0 (Video: png, none(pc)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
image.png: could not find codec parameters
Input #1, image2, from 'image.png':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 1036 kb/s
    Stream #1:0: Video: png, none(pc), 25 tbr, 25 tbn, 25 tbc
[buffer @ 0000022d8a513a00] Unable to parse option value "0x0" as image size
[buffer @ 0000022d8a513a00] Unable to parse option value "-1" as pixel format
[buffer @ 0000022d8a513a00] Unable to parse option value "0x0" as image size
[buffer @ 0000022d8a513a00] Error setting option video_size to value 0x0.
[graph 0 input from stream 1:0 @ 0000022d8a55bf20] Error applying options to the filter.
Error configuring complex filters.
Invalid argument

0 个答案:

没有答案