无法使用 NVENC 通过 FFMPEG 进行转换“不支持 10 位编码”

无法使用 NVENC 通过 FFMPEG 进行转换“不支持 10 位编码”

我正在设置 Sickbeard MP4 Automator(现在称为 Automator)来处理收到的视频文件。目前,我希望它能使用 NVENC 加速将每个文件转换为 x264,而不会出现明显的音频质量损失。我已将 Automator 设置为我认为可能有效的状态,其设置基于我在 GitHub 页面上发现的已解决的问题。

但是,我在 Automator 的 sma.log 中不断收到此错误,“不支持 10 位编码”

2021-07-21 22:28:42 - MANUAL - INFO - Starting conversion.
2021-07-21 22:28:42 - MANUAL - INFO - FFmpeg command:
2021-07-21 22:28:42 - MANUAL - INFO - ======================
2021-07-21 22:28:42 - MANUAL - INFO - C:\ffmpeg-20200612-38737b3-win64-static\bin\ffmpeg.exe -fix_sub_duration -hwaccel cuda -i D:\Torrentz\examplefile.mkv.original -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 1358k -metadata:s:v BPS=1358000 -metadata:s:v BPS-eng=1358000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -c:a:0 copy -map 0:1 -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=jpn -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 copy -map 0:2 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=eng -disposition:s:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f matroska -threads 0 -metadata:g encoding_tool=SMA -y D:\Torrentz\examplefile.mkv
2021-07-21 22:28:42 - MANUAL - INFO - ======================
2021-07-21 22:28:42 - MANUAL - ERROR - Error converting file, FFMPEG error.
Traceback (most recent call last):
  File "D:\sickbeard_mp4_automator-master\resources\mediaprocessor.py", line 1613, in convert
    for timecode, debug in conv:
  File "D:\sickbeard_mp4_automator-master\converter\__init__.py", line 317, in convert
    for timecode, debug in self.ffmpeg.convert(outfile,
  File "D:\sickbeard_mp4_automator-master\converter\ffmpeg.py", line 723, in convert
    raise FFMpegConvertError('Exited with code %d' % p.returncode, cmd,
converter.ffmpeg.FFMpegConvertError: <unprintable FFMpegConvertError object>
2021-07-21 22:28:42 - MANUAL - ERROR - C:\ffmpeg-20200612-38737b3-win64-static\bin\ffmpeg.exe -fix_sub_duration -hwaccel cuda -i D:\Torrentz\examplefile.mkv.original -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 1358k -metadata:s:v BPS=1358000 -metadata:s:v BPS-eng=1358000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -c:a:0 copy -map 0:1 -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=jpn -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 copy -map 0:2 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=eng -disposition:s:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f matroska -threads 0 -metadata:g encoding_tool=SMA -y D:\Torrentz\examplefile.mkv
2021-07-21 22:28:42 - MANUAL - ERROR - ffmpeg version git-2020-06-12-38737b3 Copyright (c) 2000-2020 the FFmpeg developers

  built with gcc 9.3.1 (GCC) 20200523

  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf

  libavutil      56. 54.100 / 56. 54.100

  libavcodec     58. 92.100 / 58. 92.100

  libavformat    58. 46.101 / 58. 46.101

  libavdevice    58. 11.100 / 58. 11.100

  libavfilter     7. 86.100 /  7. 86.100

  libswscale      5.  8.100 /  5.  8.100

  libswresample   3.  8.100 /  3.  8.100

  libpostproc    55.  8.100 / 55.  8.100

Input #0, matroska,webm, from 'D:\Torrentz\examplefile.mkv.original':

  Metadata:

    ENCODER         : Lavf59.3.100

  Duration: 00:23:54.69, start: 0.000000, bitrate: 1358 kb/s

    Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709/unknown/unknown, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)

    Metadata:

      ENCODER         : Lavc59.1.101 libx265

      BPS-eng         : 1094189

      DURATION-eng    : 00:23:54.641708333

      NUMBER_OF_FRAMES-eng: 34397

      NUMBER_OF_BYTES-eng: 196221226

      _STATISTICS_WRITING_APP-eng: mkvpropedit v45.0.0 ('Heaven in Pennies') 64-bit

      _STATISTICS_WRITING_DATE_UTC-eng: 2021-07-17 18:05:53

      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

    Stream #0:1(jpn): Audio: aac (LC), 48000 Hz, stereo, fltp (default)

    Metadata:

      BPS-eng         : 256003

      DURATION-eng    : 00:23:54.666000000

      NUMBER_OF_FRAMES-eng: 67251

      NUMBER_OF_BYTES-eng: 45910017

      _STATISTICS_WRITING_APP-eng: mkvpropedit v45.0.0 ('Heaven in Pennies') 64-bit

      _STATISTICS_WRITING_DATE_UTC-eng: 2021-07-17 18:05:53

      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

    Stream #0:2(eng): Subtitle: ass (default)

    Metadata:

      title           : English subs

      BPS-eng         : 133

      DURATION-eng    : 00:23:36.800000000

      NUMBER_OF_FRAMES-eng: 343

      NUMBER_OF_BYTES-eng: 23647

      _STATISTICS_WRITING_APP-eng: mkvpropedit v45.0.0 ('Heaven in Pennies') 64-bit

      _STATISTICS_WRITING_DATE_UTC-eng: 2021-07-17 18:05:53

      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

    Stream #0:3: Attachment: ttf

    Metadata:

      filename        : Roboto-Medium.ttf

      mimetype        : application/x-truetype-font

    Stream #0:4: Attachment: ttf

    Metadata:

      filename        : Roboto-MediumItalic.ttf

      mimetype        : application/x-truetype-font

Stream mapping:

  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_nvenc))

  Stream #0:1 -> #0:1 (copy)

  Stream #0:2 -> #0:2 (copy)

Press [q] to stop, [?] for help

[h264_nvenc @ 000001c73656b580] 10 bit encode not supported

[h264_nvenc @ 000001c73656b580] Provided device doesn't support required NVENC features

Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Conversion failed!


2021-07-21 22:28:42 - MANUAL - ERROR - D:\Torrentz\examplefile.mkv deleted.
2021-07-21 22:28:42 - MANUAL - ERROR - There was an error processing file D:\Torrentz\examplefile.mkv, no output data received

我尝试过使用 FFMPEG 进行软件编码,而不通过 Automator,结果发现转换效果很好。如果我通过输入这个来使用 CUDA 加速,ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i D:\torrentz\examplefile.mkv -c:a copy -c:v h264_nvenc -b:v 5M D:\transcode\waawe.mkv我也会出现 10 位编码错误,所以我不认为这是 Automator 的问题。但是,如果我确实需要调整某些东西,我也必须在 Automator 中进行调整,对吗?

这是我的 Automator 中的 autoprocess.ini。如果还有其他问题,请告诉我。

[Converter]
ffmpeg = C:\ffmpeg-20200612-38737b3-win64-static\bin\ffmpeg.exe
ffprobe = C:\ffmpeg-20200612-38737b3-win64-static\bin\ffprobe.exe
threads = 0
hwaccels = cuda, nvenc
hwaccel-decoders = h264_cuda, hevc_cuda, h264_cuvid, hevc_cuvid, mjpeg_cuvid, mpeg1_cuvid, mpeg2_cuvid, mpeg4_cuvid, vc1_cuvid, hevc_qsv, h264_qsv, hevc_vaapi, h264_vaapi
hwdevices = 
hwaccel-output-format = 
output-directory = 
output-format = mkv
output-extension = mkv
temp-extension = 
minimum-size = 0
ignored-extensions = nfo, ds_store
copy-to = 
move-to = D:\Transcode
delete-original = True
sort-streams = True
process-same-extensions = True
bypass-if-copying-all = False
force-convert = False
post-process = False
wait-post-process = False
detailed-progress = False
opts-separator = ,
preopts = 
postopts = 
regex-directory-replace = [^\w\-_\. ]

[Permissions]
chmod = 0644
uid = -1
gid = -1

[Metadata]
relocate-moov = True
full-path-guess = True
tag = True
tag-language = eng
download-artwork = poster
sanitize-disposition = 
strip-metadata = False
keep-titles = False

[Video]
codec = h264_nvenc, h264, x264
max-bitrate = 0
bitrate-ratio = 
crf = -1
crf-profiles = 
preset = 
codec-parameters = 
dynamic-parameters = False
max-width = 0
profile = 
max-level = 0.0
pix-fmt = 
filter = 
force-filter = False

[HDR]
codec = 
pix-fmt = 
space = bt2020nc
transfer = smpte2084
primaries = bt2020
preset = 
codec-parameters = 
filter = 
force-filter = False
profile = 

[Audio]
codec = ac3
languages = 
default-language = 
first-stream-of-language = False
allow-language-relax = True
channel-bitrate = 128
max-bitrate = 0
max-channels = 0
prefer-more-channels = True
default-more-channels = True
filter = 
force-filter = False
sample-rates = 
copy-original = False
aac-adtstoasc = False
ignore-truehd = mp4, m4v
ignored-dispositions = 
unique-dispositions = False

[Universal Audio]
codec = aac
channel-bitrate = 128
first-stream-only = False
move-after = False
filter = 
force-filter = False

[Audio.ChannelFilters]
6-2 = pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE

[Subtitle]
codec = mov_text, srt, ass
codec-image-based = pgs
languages = 
default-language = 
first-stream-of-language = False
encoding = 
burn-subtitles = False
burn-dispositions = 
embed-subs = True
embed-image-subs = False
embed-only-internal-subs = False
filename-dispositions = forced
ignore-embedded-subs = False
ignored-dispositions = 
unique-dispositions = False
attachment-codec = 

[Subtitle.Subliminal]
download-subs = False
download-hearing-impaired-subs = False
providers = 

[Subtitle.Subliminal.Auth]
opensubtitles = 
tvsubtitles = 

[Sonarr]
host = localhost
port = 8989
apikey = 
ssl = False
webroot = 
force-rename = False
rescan = True
block-reprocess = False

[Radarr]
host = localhost
port = 7878
apikey = 
ssl = False
webroot = 
force-rename = False
rescan = True
block-reprocess = False

[Sickbeard]
host = localhost
port = 8081
ssl = False
apikey = 
webroot = 
username = 
password = 

[Sickrage]
host = localhost
port = 8081
ssl = False
apikey = 
webroot = 
username = 
password = 

[CouchPotato]
host = localhost
port = 5050
username = 
password = 
apikey = 
delay = 65
method = renamer
delete-failed = False
ssl = False
webroot = 

[SABNZBD]
convert = True
sickbeard-category = sickbeard
sickrage-category = sickrage
couchpotato-category = couchpotato
sonarr-category = sonarr
radarr-category = radarr
bypass-category = bypass
output-directory = 
path-mapping = 

[Deluge]
couchpotato-label = couchpotato
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = sonarr
radarr-label = radarr
bypass-label = bypass
convert = True
host = localhost
port = 58846
username = 
password = 
output-directory = 
remove = False
path-mapping = 

[qBittorrent]
couchpotato-label = couchpotato
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = sonarr
radarr-label = radarr
bypass-label = bypass
convert = True
action-before = 
action-after = 
host = localhost
port = 8080
ssl = False
username = 
password = 
output-directory = 
path-mapping = 

[uTorrent]
couchpotato-label = couchpotato
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = sonarr
radarr-label = radarr
bypass-label = bypass
convert = True
webui = False
action-before = 
action-after = 
host = localhost
ssl = False
port = 8080
username = 
password = 
output-directory = 
path-mapping = 

[Plex]
host = localhost
port = 32400
refresh = False
token = 

编辑:尝试后出现此错误-vf scale_cuda=format=yuv420p

[Parsed_scale_cuda_0 @ 0000015d7d828700] Option 'format' not found 
[AVFilterGraph @ 0000015d7dca5580] Error initializing filter 'scale_cuda' with args 'format=yuv420p' Error reinitializing filters! Failed to inject frame into filter network: Option not found Error while processing the decoded data for stream #0:0 
Conversion failed!

我尝试使用-pix_fmt yuv420p,结果如下

Impossible to convert between the formats supported by the filter Parsed_null_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
Conversion failed!

编辑:

最后终于让 ffmpeg 和我合作了

ffmpeg -y -vsync 0 -i D:\foldee\examplefile.mkv -c:a copy -c:v h264_nvenc -pix_fmt yuv420p -b:v 5M D:\transcode\waawe.mkv

显然,根据帮助我的那个人的说法,你需要“混合使用 CPU 和 GPU 来处理 10 位颜色到 8 位,这意味着你不能要求 ffmpeg 使用 CUDA 硬件加速”。现在我只需要弄清楚如何让 Automator 工作。

答案1

我在三星 Galaxy S22 ultra 上以 1920x2080 拍摄了一段测试输入视频。Galaxy S22 使用 HVC1 编解码器对视频进行编码。

我可以使用以下命令行参数,利用 nvidia 硬件加速重新编码我的测试视频:

ffmpeg -y -vsync passthrough -v quiet -stats -hwaccel cuda -hwaccel_output_format cuda -i "ExampleVideo.mp4" -vf scale_cuda=format=yuv420p -c:a copy -c:v h264_nvenc -b:v 50M "ReencodedVideo.mp4"

我正在使用从以下网址下载的最新预编译 Windows 二进制文件 ffmpeg 版本 5.01: 下载 ffmpeg

相关内容