有没有办法通过使用ffmpeg命令来确定ffmpeg在我的系统中的性能是否最佳?

有没有办法通过使用ffmpeg命令来确定ffmpeg在我的系统中的性能是否最佳?,ffmpeg,Ffmpeg,我正在使用以下命令对文件(下面的mediainfo)进行编码: ffmpeg -i AHomeMovie.mkv -map 0 -c copy -c:v libx264 -preset veryslow -crf 17 -c:a aac -b:a 256k -threads 8 resultdir/AHomeMovie.mkv 并在几分钟后大致获得以下性能: frame= 2036 fps=2.5 q=22.0 size= 87535kB time=00:01:25.25 bitrate=

我正在使用以下命令对文件(下面的mediainfo)进行编码:

ffmpeg -i AHomeMovie.mkv -map 0 -c copy -c:v libx264 -preset veryslow -crf 17 -c:a aac -b:a 256k -threads 8 resultdir/AHomeMovie.mkv
并在几分钟后大致获得以下性能:

frame= 2036 fps=2.5 q=22.0 size=   87535kB time=00:01:25.25 bitrate=8411.2kbits/s speed=0.104x    
对于运行Linux的i7-8550U、16gb RAM、UHD图形620的笔记本电脑来说,这是正常性能吗?有没有办法通过使用ffmpeg命令来确定ffmpeg的性能是否最佳?我知道它现在是商品硬件,但我只是想了解一下系统的性能。我知道我可以使用不同的预设速度

媒体信息:

General
Unique ID                                : 25145236523685421256398752247554522365 (0x14258745965823652446224452555874)
Complete name                            : AHomeMovie.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 6.35 GiB
Duration                                 : 22 min 47 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 39.9 Mb/s
Movie name                               : A Home Movie
Encoded date                             : UTC 2020-09-10 22:10:12
Writing application                      : mkvmerge v42.0.0 ('Overtime') 64-bit
Writing library                          : libebml v1.3.10 + libmatroska v1.5.2

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 22 min 45 s
Bit rate mode                            : Variable
Bit rate                                 : 38.0 Mb/s
Maximum bit rate                         : 40.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.764
Stream size                              : 6.04 GiB (95%)
Default                                  : Yes
Forced                                   : No

Audio #1
ID                                       : 2
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Codec ID                                 : A_FLAC
Duration                                 : 22 min 45 s
Bit rate mode                            : Variable
Bit rate                                 : 614 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 11.719 FPS (4096 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossless
Stream size                              : 100 MiB (2%)
Writing library                          : libFLAC 1.2.1 (UTC 2007-09-17)
Language                                 : Japanese
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Codec ID                                 : A_FLAC
Duration                                 : 22 min 46 s
Bit rate mode                            : Variable
Bit rate                                 : 1 317 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 11.719 FPS (4096 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Delay relative to video                  : 24 ms
Stream size                              : 215 MiB (3%)
Writing library                          : libFLAC 1.2.1 (UTC 2007-09-17)
Language                                 : English
Default                                  : No
Forced                                   : No
它已经优化了 您正在使用libx264编码。这是一个具有良好默认设置的编码器,因此没有太多优化工作要做

唯一的性能建议是不要手动声明线程,它会自动为您的硬件使用最佳值。因此,删除
-threads 8
,让它选择

基本建议是使用最慢的
-preset
和看起来可以接受的最高
-crf
值。就这样。看


H.264→ H.264:为什么首先要重新编码? 最好的方法是不重新编码。你在介绍

硬件编码器 您可以使用进行编码。它可能相对较快,并为其他任务节省更多CPU,但在相同比特率的情况下,它看起来永远不会像x264那么好

x265

不清楚你为什么要重新编码,但是如果你的输入被编码得不好并且空间是额外的,你可以考虑用LIBX265编码来输出HEVC格式。它比x264慢得多,但您可能会看到一些文件大小减小

请参阅。

它已经过优化 您正在使用libx264编码。这是一个具有良好默认设置的编码器,因此没有太多优化工作要做

唯一的性能建议是不要手动声明线程,它会自动为您的硬件使用最佳值。因此,删除
-threads 8
,让它选择

基本建议是使用最慢的
-preset
和看起来可以接受的最高
-crf
值。就这样。看


H.264→ H.264:为什么首先要重新编码? 最好的方法是不重新编码。你在介绍

硬件编码器 您可以使用进行编码。它可能相对较快,并为其他任务节省更多CPU,但在相同比特率的情况下,它看起来永远不会像x264那么好

x265

不清楚你为什么要重新编码,但是如果你的输入被编码得不好并且空间是额外的,你可以考虑用LIBX265编码来输出HEVC格式。它比x264慢得多,但您可能会看到一些文件大小减小


请参阅。

为什么要首先重新编码?文件大小。对于我来说,23分钟6.5GB的视频太过了。重新编码后,两个文件看起来几乎相同(crf 17),重新编码的文件是原始文件大小的1/6。为什么首先要重新编码?文件大小。对于我来说,23分钟6.5GB的视频太过了。重新编码后,两个文件看起来几乎相同(crf 17),重新编码的文件是原始文件大小的1/6。