OSX错误上的Ffmpeg和png水印

标签 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 安装的自制软件,但结果表明 Apple 已经在 OSX 中包含了 png 支持。

我也做过
ffmpeg -codecs list | grep -i png

我在 ffmpeg 中确实有 PNG 支持:
DEV D  png             PNG (Portable Network Graphics) image

最佳答案

你的文件是带 alpha 的 16 位灰度吗?看起来像 ffmpeg不支持这种组合。尝试将其转换为 8 位和/或 RGBA。

关于OSX错误上的Ffmpeg和png水印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11250097/

相关文章:

ruby-on-rails - Rails 中的 ffmpeg 缩略图错误

ffmpeg - 无法添加过滤器 :a to ffplay

audio - 如何使用 ffmpeg 在视频中添加新音频(不混合)?

macos - 从命令行减少PNG文件的位深度

video - 如何使用 ffmpeg 或 imagemagick 将两个图像序列与 alpha channel 批量组合?

video - H264 AVC 编解码器中的各种配置文件和设置

audio - mp4atom - 如何区分音频编解码器?是 AAC 还是 MP3?

php - 如何在 PHPmotion 中使用 ffmpeg &mp4box 将视频从任何视频转换为 mp4 时减小文件大小?

ios - 如何将 UIImage 保存为透明 PNG?

windows - 干净的 Windows 安装中存在哪些视频编解码器?