gpt4 book ai didi

video - 使用 ffmpeg 将图像添加到视频中,无法播放输出文件

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

我需要给一个mp4视频加水印,但它不起作用,它困扰了我一个星期,请帮助我
这是我的代码:

ffmpeg -i sss01.mp4 -i watermark.png -filter_complex "[0:v][1:v] overlay=10:10" -pix_fmt yuv420p -c:a copy output.mp4

****此命令执行成功,但output.mp4只有50kb,无法播放。命令详情:****
>  ffmpeg -i sss01.mp4 -i watermark.png -filter_complex "[0:v][1:v] overlay=10:10" -pix_fmt yuv420p -c:a copy output.mp4  
ffmpeg version git-2017-06-08-a3b5b60 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-openssl
libavutil 55. 63.100 / 55. 63.100
libavcodec 57. 96.101 / 57. 96.101
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 91.100 / 6. 91.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, png_pipe, from 'watermark.png':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 215x115 [SAR 2835:2835 DAR 43:23], 25 tbr, 25 tbn, 25 tbc
Invalid file index 1 in filtergraph description [0:v][1:v] overlay=10:10.
[root@localhost wwwroot]# ffmpeg -i sss01.mp4 -i watermark.png -filter_complex "[0:v][1:v] overlay=10:10" -pix_fmt yuv420p -c:a copy output.mp4
ffmpeg version git-2017-06-08-a3b5b60 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-openssl
libavutil 55. 63.100 / 55. 63.100
libavcodec 57. 96.101 / 57. 96.101
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 91.100 / 6. 91.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sss01.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.72.101
Duration: 00:03:09.80, start: 0.000000, bitrate: 1547 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 1416 kb/s, 24 fps, 24 tbr, 90k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
handler_name : SubtitleHandler
Input #1, png_pipe, from 'watermark.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 215x115 [SAR 2835:2835 DAR 43:23], 25 tbr, 25 tbn, 25 tbc
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 (h264) -> overlay:main
Stream #1:0 (png) -> overlay:overlay
overlay -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0xb4ee7e0] using SAR=1/1
[libx264 @ 0xb4ee7e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0xb4ee7e0] profile High, level 4.0
[libx264 @ 0xb4ee7e0] 264 - core 150 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.72.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
Metadata:
encoder : Lavc57.96.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
frame= 20 fps=0.0 q=0.0 size= 0kB time=00:00:00.81 bitrate= 0.0kbits/sframe= 30 fps= 29 q=0.0 size= 0kB time=00:00:01.23 bitrate= 0.0kbits/sframe= 37 fps= 23 q=0.0 size= 0kB time=00:00:01.50 bitrate= 0.0kbits/sframe= 42 fps= 11 q=28.0 size= 40kB time=00:00:01.71 bitrate= 190.6kbits/frame= 44 fps= 10 q=28.0 size= 46kB time=00:00:01.81 bitrate= 210.2kbits/Killedd=0.41x

最佳答案

我更改了源文件,它工作正常。我相信源文件包含字幕流所以这个问题。

关于video - 使用 ffmpeg 将图像添加到视频中,无法播放输出文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44668038/

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