gpt4 book ai didi

video - FFmpeg: "filter_complex"导致质量比 "vf"差

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

我正在尝试使用 FFmpeg 进行一些复杂的视频转码(例如连接多个文件)。为此,我一直在尝试使用 filter_complex,但我注意到我之前使用普通视频过滤器看到的质量略有下降。

为了仔细检查,我将我的命令归结为一个简单的转码——一个使用 filter_complex,一个只使用 vf——我已经确认复杂过滤器的输出与普通视频的输出相比明显模糊筛选。我找不到任何解释这一点的 FFmpeg 文档...有谁知道为什么会这样以及如何让 filter_complex 输出与 vf 相同质量的视频?

使用普通视频过滤器 (vf) 的命令:

ffmpeg -i input.ts -map_chapters -1 -f mpegts -an -sn -map 0:0 -vf "[in]yadif=deint=interlaced[out]" -vcodec libx264 -profile:v baseline -level 2 -b:v 800k output.ts

FFmpeg 输出:
ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.1.2 (GCC) 20070626 (Red Hat 4.1.2-14)
configuration: --enable-gpl --enable-nonfree --enable-libx264 --enable-libfdk-aac --enable-libfaac --enable-libvpx --enable-encoder=vorbis --enable-libvorbis --enable-libmp3lame --enable-libspeex --disable-decoder=prores --disable-decoder=prores_lgpl --disable-ffplay --disable-ffserver --disable-shared --enable-static --extra-cflags=-I/local/build/include --extra-libs=-lfdk-aac --extra-ldflags=-L/local/build/lib --prefix=/local/build/install
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'clip01.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.41.100
Duration: 00:00:10.02, start: 0.023220, bitrate: 741 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 604 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
[libx264 @ 0x138a99e0] No 608/708 caption insertion into sei user data.
[libx264 @ 0x138a99e0] using SAR=1/1
[libx264 @ 0x138a99e0] frame MB size (54x30) > level limit (396)
[libx264 @ 0x138a99e0] MB rate (48600) > level limit (11880)
[libx264 @ 0x138a99e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x138a99e0] profile Constrained Baseline, level 2.0
Output #0, mpegts, to 'output.ts':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Stream #0:0(und): Video: h264 (libx264), yuv420p, 854x480 [SAR 1:1 DAR 427:240], q=-1--1, 800 kb/s, 30 fps, 90k tbn, 30 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc57.24.102 libx264
Side data:
unknown side data type 10 (24 bytes)
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame= 300 fps=179 q=-1.0 Lsize= 1059kB time=00:00:10.03 bitrate= 864.9kbits/s speed= 6x
video:949kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 11.660099%
[libx264 @ 0x138a99e0] frame I:2 Avg QP:23.16 size: 26978
[libx264 @ 0x138a99e0] frame P:298 Avg QP:23.09 size: 3079
[libx264 @ 0x138a99e0] mb I I16..4: 44.3% 0.0% 55.7%
[libx264 @ 0x138a99e0] mb P I16..4: 1.1% 0.0% 0.5% P16..4: 28.7% 8.4% 2.1% 0.0% 0.0% skip:59.3%
[libx264 @ 0x138a99e0] final ratefactor: 22.63
[libx264 @ 0x138a99e0] coded y,uvDC,uvAC intra: 30.8% 62.8% 23.0% inter: 7.2% 14.8% 0.3%
[libx264 @ 0x138a99e0] i16 v,h,dc,p: 25% 39% 11% 24%
[libx264 @ 0x138a99e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 29% 16% 5% 6% 7% 6% 4% 5%
[libx264 @ 0x138a99e0] i8c dc,h,v,p: 45% 29% 18% 8%
[libx264 @ 0x138a99e0] kb/s:777.19

使用复杂过滤器的命令:
ffmpeg -i input.ts -map_chapters -1 -f mpegts -filter_complex "[0:v:0]yadif=deint=interlaced[v0];[v0]concat=n=1:v=1:a=0[cat_v]" -an -sn -map "[cat_v]" -vcodec libx264 -profile:v baseline -level 2 -b:v 800k output.ts

FFmpeg 输出:
ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.1.2 (GCC) 20070626 (Red Hat 4.1.2-14)
configuration: --enable-gpl --enable-nonfree --enable-libx264 --enable-libfdk-aac --enable-libfaac --enable-libvpx --enable-encoder=vorbis --enable-libvorbis --enable-libmp3lame --enable-libspeex --disable-decoder=prores --disable-decoder=prores_lgpl --disable-ffplay --disable-ffserver --disable-shared --enable-static --extra-cflags=-I/local/build/include --extra-libs=-lfdk-aac --extra-ldflags=-L/local/build/lib --prefix=/local/build/install
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'clip01.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.41.100
Duration: 00:00:10.02, start: 0.023220, bitrate: 741 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 604 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
[libx264 @ 0x81f5200] No 608/708 caption insertion into sei user data.
[libx264 @ 0x81f5200] using SAR=1/1
[libx264 @ 0x81f5200] frame MB size (54x30) > level limit (396)
[libx264 @ 0x81f5200] MB rate (48600) > level limit (11880)
[libx264 @ 0x81f5200] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x81f5200] profile Constrained Baseline, level 2.0
Output #0, mpegts, to 'output.ts':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Stream #0:0: Video: h264 (libx264), yuv420p, 854x480 [SAR 1:1 DAR 427:240], q=-1--1, 800 kb/s, 30 fps, 90k tbn, 30 tbc (default)
Metadata:
encoder : Lavc57.24.102 libx264
Side data:
unknown side data type 10 (24 bytes)
Stream mapping:
Stream #0:0 (h264) -> yadif
concat -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
frame= 300 fps=179 q=-1.0 Lsize= 1059kB time=00:00:10.03 bitrate= 864.9kbits/s speed= 6x
video:949kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 11.660099%
[libx264 @ 0x81f5200] frame I:2 Avg QP:23.16 size: 26978
[libx264 @ 0x81f5200] frame P:298 Avg QP:23.09 size: 3079
[libx264 @ 0x81f5200] mb I I16..4: 44.3% 0.0% 55.7%
[libx264 @ 0x81f5200] mb P I16..4: 1.1% 0.0% 0.5% P16..4: 28.7% 8.4% 2.1% 0.0% 0.0% skip:59.3%
[libx264 @ 0x81f5200] final ratefactor: 22.63
[libx264 @ 0x81f5200] coded y,uvDC,uvAC intra: 30.8% 62.8% 23.0% inter: 7.2% 14.8% 0.3%
[libx264 @ 0x81f5200] i16 v,h,dc,p: 25% 39% 11% 24%
[libx264 @ 0x81f5200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 29% 16% 5% 6% 7% 6% 4% 5%
[libx264 @ 0x81f5200] i8c dc,h,v,p: 45% 29% 18% 8%
[libx264 @ 0x81f5200] kb/s:777.19

最佳答案

我已经想通了。这是因为默认缩放算法从 bicubicbilinear .我所要做的就是添加 flags=bicubic现在看起来一样了。

关于video - FFmpeg: "filter_complex"导致质量比 "vf"差,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40603152/

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