1

我正在开发 Windows 服务,我的 Windows 服务使用“ffmpeg”,同时我正在开发用于测试代码的桌面应用程序。

我想在我的视频中导入水印。我可以用我的桌面应用程序做到这一点。但是当我运行我的 Windows 服务时,它会出错。

ffmpeg version N-36635-gceb0dd9 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan  9 2012 17:39:58 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 34.100 / 51. 34.100
  libavcodec     53. 54.100 / 53. 54.100
  libavformat    53. 29.100 / 53. 29.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 58.100 /  2. 58.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    51.  2.100 / 51.  2.100
[mpeg4 @ 01CA93A0] Invalid and inefficient vfw-avi packed B frames detected
Input #0, avi, from 'C:\Apps\SabilVideoProcesser\WAITING_FOR_WATERMARK\Pixar - For the Birds.avi':
  Metadata:
    encoder         : Nandub v1.0rc2
  Duration: 00:03:16.56, start: 0.000000, bitrate: 2113 kb/s
    Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 720x416 [SAR 1:1 DAR 45:26], 25 fps, 25 tbr, 25 tbn, 30k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 32 kb/s
[buffer @ 02746A20] w:720 h:416 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[movie @ 02748E00] Failed to avformat_open_input 'logo.png'
Error initializing filter 'movie' with args 'logo.png'
Error opening filters!

我有时会更改 logo.png,但它不起作用并已修复。我不明白出了什么问题?

我尝试更改 ffmpeg.exe 并从“http://ffmpeg.arrozcru.org/autobuilds/ffmpeg/mingw32/static/”下载,但是当我运行服务时,我再次遇到错误。这次错误不同,我会发疯的...

FFmpeg version SVN-r26400, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 18 2011 04:07:05 with gcc 4.4.2
  configuration: --enable-gpl --enable-version3 --enable-libgsm --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-libvpx --disable-decoder=libvpx --arch=x86 --enable-runtime-cpudetect --enable-libxvid --enable-libx264 --enable-librtmp --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm' --target-os=mingw32 --enable-avisynth --enable-w32threads --cross-prefix=i686-mingw32- --cc='ccache i686-mingw32-gcc' --enable-memalign-hack
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
[mpeg4 @ 003dfbd0] Invalid and inefficient vfw-avi packed B frames detected
[mpeg4 @ 003dfbd0] frame skip 8

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 25.00 (25/1)
Input #0, avi, from 'C:\Apps\SabilVideoProcesser\WAITING_FOR_WATERMARK\Pixar - For the Birds.avi':
  Metadata:
    encoder         : Nandub v1.0rc2
  Duration: 00:03:16.56, start: 0.000000, bitrate: 2113 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 720x416 [PAR 1:1 DAR 45:26], 25 fps, 25 tbr, 25 tbn, 30k tbc
    Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16, 189 kb/s
[buffer @ 020d51b0] w:720 h:416 pixfmt:yuv420p
No such filter: 'movie'
Error opening filters!

这是我的 ffmpeg 参数;

-i "C:\Apps\SabilVideoProcesser\WAITING_FOR_WATERMARK\Pixar - For the Birds.avi" -vf "movie=logo.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" -vcodec libx264 -acodec ac3_fixed "C:\Apps\SabilVideoProcesser\WAITING_FOR_SPLIT\inprocess_Pixar - For the Birds.avi"
4

2 回答 2

2

问题 #1:Failed to avformat_open_input 'logo.png'

您遇到两个不同的问题。该消息Failed to avformat_open_input 'logo.png'可能表明 ffmpeg 找不到logo.png(或者可能无法正确解码)。要么提供文件的绝对路径,要么将其放在与 ffmpeg 二进制文件相同的目录(或“文件夹”,我相信是 Windows 术语)中。如果文件位于正确的位置,则运行ffmpeg -i logo.png以查看 ffmpeg 是否甚至可以对其进行解码。

问题 #2:No such filter: 'movie'

第二条消息No such filter: 'movie'表明此命令中使用的 ffmpeg 太旧,或者不支持过滤器,或者对于movie. 来自 arrozcru.org 的二进制文件已过时。Zeranoe FFmpeg Builds保持最新并且配置合理。您应该继续获取更新的二进制文件。修订版 36635 已经至少有 3696 个修订版。然后看看FFmpeg:终极的视频和音频操作工具,以获得对使用的一个很好的概述。

添加水印

无论如何,您不需要movie源过滤器来添加水印。请参阅如何使用 ffmpeg 在视频中心添加透明水印中的示例?

于 2012-05-04T21:26:12.550 回答
0

Faced the same issue

(Error initializing filter 'movie' with args '/mnt/sdcard/MyApp/frame.png').

Using static ffmpeg library in my android app. On samsung galaxy s3 it works fine, but on the lenovo and htc 2.3.6 i had same error in ffmpeg - he coudln't find my watermark. Fixed this error by moving waterkmark in the same folder as ffmpeg (executable). So now i using next path in movie filter "...movie=frame.png..." instead of "...movie=/mnt/sdcard/MyApp/frame.png". Still don't know is it a bug or i'm just doing something wrong.

于 2014-08-13T17:49:19.377 回答