3

I'm setting up Sickbeard MP4 Automator (calling it Automator now) to process video files after I receive them. Currently what I want it to do is to turn every file into x264 with NVENC acceleration, without having noticeable loss in audio quality. I've set up the Automator to what I think would probably work, basing it off the closed issues that I found on its GitHub page.

However, I keep getting this error in the sma.log of Automator, "10 bit encode not supported"

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

I've tried using just software encoding by using FFMPEG without going through Automator and found that it converted fine. If I do use CUDA acceleration by inputting this 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 I also get the 10 bit encode error, so I don't think it's the fault of Automator. But, if I do have to adjust something, I have to do it in Automator too, right?

Here's my autoprocess.ini from Automator. If there are other things off about it, please let me know.

[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 = 

Edit: got this error after trying -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!

I tried using -pix_fmt yuv420p, here's what I got

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!

Edit:

Finally got ffmpeg to cooperate with me by using

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

Apparently you needed to "mix cpu and gpu in processing 10 bit color to 8 bit, which means you cannot ask ffmpeg to use CUDA hardware acceleration" according to the one that helped me. Now I just need to figure out how to make Automator work.

5
  • Try adding the -vf scale_cuda=format=yuv420p output option to your ffmpeg command.
    – llogan
    Commented Jul 21, 2021 at 17:06
  • I get this error when I do, though. [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! Commented Jul 22, 2021 at 9:07
  • 1
    Your ffmpeg is too old for my suggestion. Download git essentials from gyan.dev.
    – llogan
    Commented Jul 23, 2021 at 16:25
  • 1
    scale_cuda=format=yuv420p didn't help me either, even with the latest 2021-11-15-git-9e8cdb24cd build ("Impossible to convert between the formats supported by the filter ... Failed to inject frame into filter network"). But setting -pix_fmt yuv420p did help (credits to tprice).
    – retif
    Commented Nov 15, 2021 at 18:57
  • I was experiencing the same issue on Linux with my 3070 Ti using NVIDIA driver 515.65.01 with ffmpeg 4.4.2. I was using this: ffmpeg -i "${input}" -c:v h264_nvenc -minrate 1000k -maxrate 1000k -c:a mp3 -b:a 128k "${output}" what solved it for me was adding -pix_fmt yuv420p like this: ffmpeg -i "${input}" -c:v h264_nvenc -pix_fmt yuv420p -minrate 1000k -maxrate 1000k -c:a mp3 -b:a 128k "${output}"
    – ipkpjersi
    Commented Nov 1, 2022 at 13:43

1 Answer 1

1

I filmed a test input video on a SamSung Galaxy S22 ultra at 1920x2080. The Galaxy S22 encodes videos with a HVC1 codec.

I am able to reencode my test video using nvidia hardware acceleration using these command line parameters:

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"

I'm using the latest precompiled Windows binary of ffmpeg version 5.01 which I downloaded from: Download ffmpeg

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .