OSX错误时Ffmpeg和png水印

时间:2012-06-28 17:42:51

标签: ffmpeg png codec

我正在尝试使用ffmpeg在OSX上添加带透明背景的水印。

我正在使用此命令:

ffmpeg -i test.mpg -vf "movie=stuff.png, scale=100:100 [watermark]; [in][watermark] overlay=main_w-overlay_w:main_h-overlay_h-10 [out]"  out.mpg

我得到了这个:

ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun 12 2012 21:37:10 with clang 3.1 (tags/Apple/clang-318.0.54)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/0.11.1 --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libfreetype --cc=/usr/bin/clang --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-libvo-aacenc --disable-ffplay
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpeg, from 'test.mpg':
  Duration: 00:00:01.04, start: 1.000000, bitrate: 9106 kb/s
    Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p, 640x480 [SAR 1:1 DAR 4:3], 104857 kb/s, 24 fps, 24 tbr, 90k tbn, 24 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16, 128 kb/s
File 'out.mpg' already exists. Overwrite ? [y/N] y
w:640 h:480 pixfmt:yuv420p tb:1/90000 sar:1/1 sws_param:flags=2
[buffersink @ 0x7ff50bc1c3e0] No opaque field provided
[png @ 0x7ff50c038400] unsupported bit depth 16 and color type 4
[image2 @ 0x7ff50c044800] decoding for stream 0 failed
[image2 @ 0x7ff50c044800] Could not find codec parameters (Video: png, 640x480)
[movie @ 0x7ff50bc17200] Failed to find stream info
[movie @ 0x7ff50bc17200] seek_point:0 format_name:(null) file_name:stuff.png stream_index:0
[scale @ 0x7ff50bc178c0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_movie_0' and the filter 'Parsed_scale_1'
Impossible to convert between the formats supported by the filter 'Parsed_movie_0' and the filter 'auto-inserted scaler 0'
Error opening filters!

我以为我缺少png支持而且我检查了自制程序的libpng安装,但结果是png支持已经包含在Apple OSX中。

我也做了

ffmpeg -codecs list | grep -i png

我在ffmpeg中有PNG支持:

DEV D  png             PNG (Portable Network Graphics) image

1 个答案:

答案 0 :(得分:1)

您的文件是否是带有alpha的16位灰度?看起来ffmpeg不支持此组合。尝试将其转换为8位和/或RGBA。

相关问题