gpt4 book ai didi

ffmpeg - 将带有 -filter_complex 的水印覆盖添加到多个输出(破折号)

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

我正在为 DASH(无音频)创建一组文件:

ffmpeg -i "input.mov"
-y
-keyint_min 100 -g 100
-sc_threshold 0
-c:v libx264
-pix_fmt yuv420p
-map v:0 -s:0 320x180 -b:v:0 681.125k -maxrate:0 681.125k -bufsize:0 340.5625k
-map v:0 -s:1 640x360 -b:v:1 2724.5k -maxrate:1 2724.5k -bufsize:1 1362.25k
-map v:0 -s:2 1280x720 -b:v:2 5449k -maxrate:2 5449k -bufsize:2 2724.5k
-map v:0 -s:3 1920x1080 -b:v:3 10898k -maxrate:3 10898k -bufsize:3 5449k
-init_seg_name "myname_$RepresentationID$.$ext$"
-media_seg_name "myname_$RepresentationID$-$Number%05d$.$ext$"
-use_template 1 -use_timeline 1
-seg_duration 4 -adaptation_sets "id=0,streams=v"
-f dash "myname.mpd"
现在我想添加一个水印。它是如何完成的?我试过类似的东西:
ffmpeg -i "input.mov"
-y
-i "watermark.png" // Added
-filter_complex "overlay=24:960" // Added
-keyint_min 100 -g 100
-sc_threshold 0
-c:v libx264
-pix_fmt yuv420p
-map v:0 -s:0 320x180 -b:v:0 681.125k -maxrate:0 681.125k -bufsize:0 340.5625k
-map v:0 -s:1 640x360 -b:v:1 2724.5k -maxrate:1 2724.5k -bufsize:1 1362.25k
-map v:0 -s:2 1280x720 -b:v:2 5449k -maxrate:2 5449k -bufsize:2 2724.5k
-map v:0 -s:3 1920x1080 -b:v:3 10898k -maxrate:3 10898k -bufsize:3 5449k
-init_seg_name "myname_$RepresentationID$.$ext$"
-media_seg_name "myname_$RepresentationID$-$Number%05d$.$ext$"
-use_template 1 -use_timeline 1
-seg_duration 4 -adaptation_sets "id=0,streams=v"
-f dash "myname.mpd"
但这导致只能获得 180p 版本的视频。我怎样才能仍然获得所有版本的带有叠加层的视频?
添加:
我也试过:
ffmpeg -i "input.mov"
-y
-i "watermark.png"
-filter_complex "[0:v][1:v]overlay=24:960[out0][out1][out2][out3]"
-keyint_min 100 -g 100
-sc_threshold 0
-c:v libx264
-pix_fmt yuv420p
-map "[out0]" -s:0 320x180 -b:v:0 681.125k -maxrate:0 681.125k -bufsize:0 340.5625k
-map "[out1]" -s:1 640x360 -b:v:1 2724.5k -maxrate:1 2724.5k -bufsize:1 1362.25k
-map "[out2]" -s:2 1280x720 -b:v:2 5449k -maxrate:2 5449k -bufsize:2 2724.5k
-map "[out3]" -s:3 1920x1080 -b:v:3 10898k -maxrate:3 10898k -bufsize:3 5449k
-init_seg_name "myname_$RepresentationID$.$ext$"
-media_seg_name "myname_$RepresentationID$-$Number%05d$.$ext$"
-use_template 1 -use_timeline 1
-seg_duration 4 -adaptation_sets "id=0,streams=v"
-f dash "myname.mpd"
这导致错误:
没有输出焊盘可以与链接标签“out1”相关联。

最佳答案

添加 split filter :

ffmpeg -i "input.mov"
-y
-i "watermark.png"
-filter_complex "[0:v][1:v]overlay=24:960,format=yuv420p,split=4[out0][out1][out2][out3]"
-keyint_min 100 -g 100
-sc_threshold 0
-c:v libx264
-map "[out0]" -s:0 320x180 -b:v:0 681.125k -maxrate:0 681.125k -bufsize:0 340.5625k
-map "[out1]" -s:1 640x360 -b:v:1 2724.5k -maxrate:1 2724.5k -bufsize:1 1362.25k
-map "[out2]" -s:2 1280x720 -b:v:2 5449k -maxrate:2 5449k -bufsize:2 2724.5k
-map "[out3]" -s:3 1920x1080 -b:v:3 10898k -maxrate:3 10898k -bufsize:3 5449k
-init_seg_name "myname_$RepresentationID$.$ext$"
-media_seg_name "myname_$RepresentationID$-$Number%05d$.$ext$"
-use_template 1 -use_timeline 1
-seg_duration 4 -adaptation_sets "id=0,streams=v"
-f dash "myname.mpd"

关于ffmpeg - 将带有 -filter_complex 的水印覆盖添加到多个输出(破折号),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62862773/

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