gpt4 book ai didi

video - FFmpeg:省略 -filter_complex 会导致某些播放器中的视频丢失

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

我创建了一个不那么简单的 ffmpeg 命令,它带有一个复杂的过滤器来将开/关字幕附加到视频中。在同一过程中,视频被调整大小并重新编码。这在我测试过的所有播放器中都可以正常工作。

当我省略 -filter_complex 参数和图像输入时,生成的文件在 VLC 中按预期播放,但在 Windows Media Player 中只有音频(没有视频)。

这一切都在 Windows 10 上使用标准 Windows 批处理文件完成。

有人知道这里发生了什么吗?我的 ffmpeg foo 非常有限。

ffmpeg.exe ^
-i "..\videos\film.mov" ^
-y ^
-codec:a aac ^
-s:v 1280x720 ^
-codec:v libx264 -preset slower -tune animation -crf 22 ..\videos\film.mov.m4v"

ffmpeg.exe ^
-i "..\videos\film.mov" ^
-i OpeningCredits.de.png -i ClosingCredits.de.png ^
-filter_complex "[0:v][1:v] overlay=0:0:enable='between(t,0,3.5)',drawtext=enable='between(t,0,3.5)':fontfile=fonts/Roboto-Bold.ttf:text=Test:fontcolor=white:fontsize=104:x=(w-text_w)/2:y=(h-text_h)/2+45,drawtext=enable='between(t,0,3.5)':fontfile=fonts/Roboto-Bold.ttf:text=:fontcolor=white:fontsize=104:x=(w-text_w)/2:y=(h-text_h)/2+45+text_h+20 [tmp]; [tmp][2:v] overlay=0:0:enable='between(t,39-5.2,39)'" ^
-y ^
-codec:a aac ^
-s:v 1280x720 ^
-codec:v libx264 -preset slower -tune animation -crf 22 "..\videos\film.mov.m4v"

最佳答案

叠加滤镜默认输出到 YUV420P,所有播放器都支持。所以在使用的时候,这种格式转换是隐含的副作用。

在这种情况下,您的输入看起来不是 YUV420P。因此,当省略 filter_complex 时,不会发生到 4:2:0 的转换,并且 WMP 显然没有过滤器来解码非 4:2:0 YUV 格式。

添加 -pix_fmt yuv420p强制转换。

关于video - FFmpeg:省略 -filter_complex 会导致某些播放器中的视频丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69082462/

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