gpt4 book ai didi

javascript - FFMPEG - 无法在 JS 文件中添加水印

转载 作者:行者123 更新时间:2023-12-04 23:22:42 27 4
gpt4 key购买 nike

这是我的文件中关于 FFMPEG 字符串的部分。

    if (transcoderType === 'ffmpeg') {
// https://www.ffmpeg.org/ffmpeg-formats.html#segment
var tsOutputFormat = 'stream%05d.ts';
var args = [
'-i', file, '-sn',
'-async', '1', '-acodec', 'libmp3lame', '-b:a', audioBitrate + 'k', '-ar', '44100', '-ac', '2',
'-vf', 'scale=min(' + targetWidth + '\\, iw):-1', '-b:v', videoBitrate + 'k', '-vcodec', 'libx264', '-profile:v', 'baseline', '-preset:v' ,'superfast',
'-x264opts', 'level=3.0',
'-threads', '0', '-flags', '-global_header', '-map', '0',
// '-map', '0:v:0', '-map', '0:a:1'
'-f', 'segment',
'-segment_list', playlistFileName, '-segment_format', 'mpegts', '-segment_list_flags', 'live', tsOutputFormat
//'-segment_time', '10', '-force_key_frames', 'expr:gte(t,n_forced*10)',
//'-f', 'hls', '-hls_time', '10', '-hls_list_size', '0', '-hls_allow_cache', '0', '-hls_segment_filename', tsOutputFormat, playlistFileName

我在'-i',文件,'-sn'之后添加了这一行以添加水印,
-i', '/home/logo.png', '-filter_complex', "overlay=10:102",

任何帮助,将不胜感激。

最佳答案

ffmpeg -i file -i logo.png -filter_complex "[0]scale[bg];[bg][1]overlay=10:102[v]" -map "[v]" -map 0:a? … output
  • 不要同时使用 -vf-filter_complex .将它们合二为一-filter_complex .
  • 删除 -map 0而是 -map -filter_complex 的输出.
  • 关于javascript - FFMPEG - 无法在 JS 文件中添加水印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62154932/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com