我尝试制作带有水印的视频。
“H:\ffmpeg.exe”-i video.mov-i watermark.png-map 0:0-c:v libx264-vsync 0-vb 3M-filter_complex“pad=2048:1152:0:147:black,overlay”-map 0:1-c:a aac-ac 2-ab 448k video_watermark.mp4-report
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2023-03-23T20:09:02.000000Z
Duration: 01:34:56.17, start: 0.000000, bitrate: 27054 kb/s
Stream #0:0[0x1](eng), 1, 1/24: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2048x858, 20136 kb/s, 24 fps, 24 tbr, 24 tbn (default)
Metadata:
creation_time : 2023-03-23T20:09:02.000000Z
handler_name : Обработчик видео Apple
vendor_id : appl
encoder : H.264
Stream #0:1[0x2](eng), 47, 1/48000: Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s (default)
Metadata:
creation_time : 2023-03-23T20:09:02.000000Z
handler_name : Обработчик звука Apple
vendor_id : [0][0][0][0]
Successfully opened the file.
ffmpeg 制作包含 2 个视频的文件。为什么?
Output #0, mp4, to 'video_watermark.mp4':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
encoder : Lavf60.4.100
Stream #0:0, 0, 1/12288: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2048x1152, q=2-31, 3000 kb/s, 24 fps, 12288 tbn
Metadata:
encoder : Lavc60.6.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/3000000 buffer size: 0 vbv_delay: N/A
Stream #0:1(eng), 0, 1/12288: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2048x858, q=2-31, 3000 kb/s, 24 fps, 12288 tbn (default)
Metadata:
creation_time : 2023-03-23T20:09:02.000000Z
handler_name : Обработчик видео Apple
vendor_id : appl
encoder : Lavc60.6.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/3000000 buffer size: 0 vbv_delay: N/A
Stream #0:2(eng), 0, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 448 kb/s (default)
Metadata:
creation_time : 2023-03-23T20:09:02.000000Z
handler_name : Обработчик звука Apple
vendor_id : [0][0][0][0]
encoder : Lavc60.6.101 aac
frame= 0 fps=0.0 q=0.0 q=0.0 size= 0kB time=00:00:01.45 bitrate= 0.3kbits/s speed=1.88x
ffmpeg version N-110065-g30cea1d39b-20230323 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (crosstool-NG 1.25.0.152_89671bf)
答案1
您的命令中有两个映射,第一个映射映射原始视频流。过滤器复合体的输出是输出中的第二个视频流。
您应该标记过滤器复合体中的所有焊盘并映射输出。
ffmpeg.exe -i video.mov -i watermark.png -filter_complex "[0]pad=2048:1152:0:147:black[v];[v][1]overlay[v]" -map [v] -map 0:1 -c:v libx264 -vsync 0 -b:v 3M -c:a aac -ac 2 -b:a 448k video_watermark.mp4