sickbeard_mp4_automator icon indicating copy to clipboard operation
sickbeard_mp4_automator copied to clipboard

Where can i add -vf 'scale_qsv=w=1920:h=1080:format=nv12'

Open uchagani opened this issue 11 months ago • 19 comments

Describe the bug I'm trying to convert all videos to h264. but when converting hevc files i'm getting errors. I have hardware decoding and encoding working by using the following ffmpeg command:

/usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel 40 -hwaccel qsv -hwaccel_output_format qsv -c:v hevc_qsv -i input.mkv -vf 'scale_qsv=w=1920:h=1080:format=nv12' -c:v h264_qsv output.mp4

Command or context you are trying to run ./automator/manual.py -a -nd -i input.mkv

autoProcess.ini settings

[Converter]
ffmpeg = /usr/lib/jellyfin-ffmpeg/ffmpeg
ffprobe = /usr/lib/jellyfin-ffmpeg/ffprobe
threads = 0
hwaccels = qsv
hwaccel-decoders = h264_qsv, hevc_qsv
hwdevices = qsv:/dev/dri/renderD128
hwaccel-output-format = qsv:qsv
output-directory =
output-directory-space-ratio = 0.0
output-format = mp4
output-extension = mp4
temp-extension =
minimum-size = 0
ignored-extensions = nfo, ds_store
copy-to =
move-to =
delete-original = True
process-same-extensions = False
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 = 1000
gid = 1000

[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 = h264qsv, h264, x264
max-bitrate = 0
bitrate-ratio =
crf = 18
crf-profiles =
preset =
codec-parameters =
dynamic-parameters = False
max-width = 0
profile = high, main, baseline
max-level = 0.0
pix-fmt = nv12, yuv420p
prioritize-source-pix-fmt = True
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 = eng,hin,urd
default-language = eng
include-original-language = True
first-stream-of-language = False
channel-bitrate = 128
variable-bitrate = 0
max-bitrate = 0
max-channels = 0
filter =
profile =
force-filter = False
sample-rates =
sample-format =
copy-original = True
aac-adtstoasc = False
ignored-dispositions =
force-default = False
unique-dispositions = False
stream-codec-combinations =

[Audio.Sorting]
sorting = language, channels.d, map, d.comment
default-sorting = channels.d, map, d.comment
codecs =

[Universal Audio]
codec = aac
channel-bitrate = 128
variable-bitrate = 0
first-stream-only = False
filter =
profile =
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 =
codec-image-based =
languages =
default-language =
include-original-language = False
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 =
force-default = False
unique-dispositions = False
attachment-codec =
remove-bitstream-subs = False

[Subtitle.Sorting]
sorting = language, d.comment, d.default.d, d.forced.d
burn-sorting = language, d.comment, d.default.d, d.forced.d
codecs =

[Subtitle.CleanIt]
enabled = False
config-path =
tags =

[Subtitle.FFSubsync]
enabled = False

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

[Subtitle.Subliminal.Auth]
opensubtitles =
tvsubtitles =

[Sonarr]
host = 192.168.10.20
port = 9000
apikey = aaaaaaaaaaaa
ssl = False
webroot =
force-rename = False
rescan = True
in-progress-check = True
block-reprocess = False

[Radarr]
host = 192.168.10.20
port = 7000
apikey = aaaaaaaaaaaaa
ssl = False
webroot =
force-rename = False
rescan = True
in-progress-check = 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 =

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

[Deluge]
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]
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]
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]
username =
password =
servername =
host = localhost
port = 32400
refresh = False
token =
ssl = True
ignore-certs = False
path-mapping =

Log files

Manual processor started.
Python 64-bit 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0].
Guessit version: 3.7.1.
/usr/bin/python3
Loading default config file.
Loading config file /automator/config/autoProcess.ini.
No-delete enabled
Input IDs:
TMDBID: 1434
IMDBID: None
TVDBID: None
Using TMDB ID: 1434
Tagging language determined to be eng.
Matched TV episode as XXXXXX
Processing XXXXXXXX
Process started.
Found sdh in stream title, setting hearing_impaired disposition to True.
Input Data
{
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "hevc",
        "bitrate": 769397,
        "pix_fmt": "yuv420p10le",
        "profile": "main10",
        "fps": 23.976023976023978,
        "framedata": {
            "pix_fmt": "yuv420p10le",
            "side_data_list": [
                {
                    "side_data_type": "H.26[45] User Data Unregistered SEI message"
                }
            ]
        },
        "dimensions": "1920x1080",
        "level": 4.0,
        "field_order": "unknown"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        }
    ],
    "subtitle": [
        {
            "index": 2,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng"
        },
        {
            "index": 3,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired-captions",
            "language": "eng"
        }
    ],
    "attachment": []
}
Reading video stream.
Video codec detected: hevc.
Pix Fmt: yuv420p10le.
Profile: main10.
Stream is not HDR, color parameter unknown does not match ['bt2020nc'] [hdr-['bt2020nc']].
Pool of video codecs is ['h264qsv', 'h264', 'x264'].
Total bitrate is 1028977.0.
Total audio bitrate is 256000.
Estimated video bitrate is 772977.0.
Using video bitrate ratio of 1.000000, which results in 734.328150 changing to 734.328150.
Video profile is not supported. Video stream can no longer be copied [video-profile].
Overriding video pix_fmt. Codec cannot be copied because pix_fmt is not approved [pix-fmt].
Source bit-depth 10, output 8, using depth 8.
Video codec: h264qsv.
Video bitrate: 734.3281499999999.
Video CRF: 18.
Video maxrate: None.
Video bufsize: None.
Video level: 0.0.
Video profile: high.
Video preset: None.
Video pix_fmt: nv12.
Video field order: unknown.
Video width: None.
Video debug video.profile.pix_fmt.
Video codec parameters None.
Creating h264qsv video stream from source stream 0.
Reading audio streams.
The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
Pool universal audio codecs is ['aac'].
Pool of audio codecs is ['ac3'].
Audio detected for stream 1 - eac3 eng 6 channel.
Found an audio filter for converting from 6 channels to 2 channels. Applying filter 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 to UA.
Audio codec: aac.
Channels: 2.
Filter: 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.
Bitrate: 256.
VBR: 0.
Profile: None.
Language: eng.
Disposition: +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions.
Audio codec: ac3.
Channels: 6.
Bitrate: 768.
VBR: 0.
Audio Profile: None.
Language: eng.
Filter: None.
Disposition: +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions.
Debug: audio.
Creating ac3 audio stream from source stream 1.
Creating aac audio stream from source audio stream 1 [universal-audio].
Copying audio stream from source stream 1 format eac3 [audio-copy-original].
Purging the following streams:
[]
Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
Triggering audio track sort [audio.sorting-sorting].
Sorting streams with keys ['language', 'channels.d', 'map', 'd.comment'].
Sorted ascending with language:
['0->0', '1->1', '2->2']
Sorted descending with channels:
['0->0', '1->2', '2->1']
Sorted ascending with map:
['0->0', '1->1', '2->2']
Sorted ascending with d.comment:
['0->0', '1->1', '2->2']
Final sorting:
['0->0', '1->2', '2->1']
Sorting streams with keys ['channels.d', 'map', 'd.comment'].
Sorted descending with channels:
['0->0', '1->1', '2->2']
Sorted ascending with map:
['0->0', '1->1', '2->2']
Sorted ascending with d.comment:
['0->0', '1->1', '2->2']
Final sorting:
['0->0', '1->1', '2->2']
Sorting audio streams for default audio stream designation.
3 total audio streams with 3 set to default disposition. 3 defaults in your preferred language (eng), 0 in other languages.
2 streams in preferred language cleared of default disposition flag from preferred language.
Default audio stream set to eng ac3 6 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
Reading subtitle streams.
Subtitle detected for stream 2 - subrip eng.

isImageBasedSubtitle FFmpeg command:
/usr/lib/jellyfin-ffmpeg/ffmpeg -i "input.mkv" -c:s:0 srt -map 0:2 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=und -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f srt -t 00:00:01 -f null -
Stream 2 is text-based subtitle for codec subrip.
Subtitle detected for stream 3 - subrip eng.

isImageBasedSubtitle FFmpeg command:
/usr/lib/jellyfin-ffmpeg/ffmpeg -i "input.mkv" -c:s:0 srt -map 0:3 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=und -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f srt -t 00:00:01 -f null -
Stream 3 is text-based subtitle for codec subrip.
Scanned for external subtitles and found 0 results in your approved languages.
Subtitle output is empty or no default subtitle language is set, will not pass over subtitle output to set a default stream.
Sorting streams with keys ['language', 'd.comment', 'd.default.d', 'd.forced.d'].
Final sorting:
[]
Selected hwaccel options:
['qsv']
Selected hwaccel decoder pairs:
['h264_qsv', 'hevc_qsv']
FFMPEG hwaccels:
['cuda', 'vaapi', 'qsv', 'drm', 'opencl', 'vulkan']
Input format yuv420p10le bit depth 10.
Setting hwaccel device to /dev/dri/renderD128.
qsv hwaccel is supported by this ffmpeg build and will be used [hwaccels].
Decoder: hevc_qsv.
hevc_qsv decoder is also supported by this ffmpeg build and will also be used [hwaccel-decoders].
Decoder formats:
['nv12', 'p010le', 'p012le', 'yuyv422', 'y210le', 'y212le', '0yuv', 'y410le', 'y412le', 'qsv']
Found a matching device /dev/dri/renderD128 for encoder h264qsv [hwdevices].
Device was already set by the decoder, using same device /dev/dri/renderD128 for encoder h264qsv [hwdevices].
canBypassConvert returned False.
Output Data
{
    "source": [
        "input.mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "h264qsv",
        "map": 0,
        "bitrate": 734.3281499999999,
        "crf": 18,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": "high",
        "preset": null,
        "pix_fmt": "nv12",
        "field_order": "unknown",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "bsf": null,
        "debug": "video.profile.pix_fmt",
        "title": "FHD",
        "device": "sma"
    },
    "audio": [
        {
            "map": 1,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio",
            "title": "5.1 Channel"
        },
        {
            "map": 1,
            "codec": "copy",
            "channels": 6,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "debug": "audio-copy-original",
            "title": "5.1 Channel"
        },
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 256,
            "quality": 0,
            "profile": null,
            "samplerate": null,
            "sampleformat": "",
            "filter": "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",
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "debug": "universal-audio",
            "title": "Stereo"
        }
    ],
    "subtitle": [],
    "attachment": []
}
Preopts
[
    "-init_hw_device",
    "qsv=sma:/dev/dri/renderD128",
    "-hwaccel_device",
    "sma",
    "-hwaccel",
    "qsv",
    "-hwaccel_output_format",
    "qsv",
    "-vcodec",
    "hevc_qsv"
]
Postopts
[
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
Starting conversion.
Input directory: .
File name: input.
Input extension: mkv.
Output directory: .
Output extension: .
Output file: input.mp4.
Input directory: .
File name: input.
Input extension: mkv.
Output directory: .
Output extension: .
Output file: input.mp4.
Final output file: input.mp4.

FFmpeg command:
======================
/usr/lib/jellyfin-ffmpeg/ffmpeg -init_hw_device qsv=sma:/dev/dri/renderD128 -hwaccel_device sma -hwaccel qsv -hwaccel_output_format qsv -vcodec hevc_qsv -i "input.mkv" -vcodec h264_qsv -map 0:0 -pix_fmt nv12 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -global_quality 18 -profile:v high -tag:v avc1 -look_ahead 0 -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 copy -map 0:1 -metadata:s:a:1 "title=5.1 Channel" -metadata:s:a:1 "handler_name=5.1 Channel" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:2 aac -map 0:1 -ac:a:2 2 -b:a:2 256k -metadata:s:a:2 BPS=256000 -metadata:s:a:2 BPS-eng=256000 -filter:a: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" -metadata:s:a:2 title=Stereo -metadata:s:a:2 handler_name=Stereo -metadata:s:a:2 language=eng -disposition:a:2 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y "input.mp4"
======================
[                    ] 0% Error converting file, FFMPEG error.
Traceback (most recent call last):
  File "/automator/resources/mediaprocessor.py", line 2314, in convert
    for timecode, debug in conv:
  File "/automator/converter/__init__.py", line 329, in convert
    for timecode, debug in self.ffmpeg.convert(outfile,
  File "/automator/converter/ffmpeg.py", line 795, in convert
    raise FFMpegConvertError('Exited with code %d' % p.returncode, cmd,
converter.ffmpeg.FFMpegConvertError: <unprintable FFMpegConvertError object>
/usr/lib/jellyfin-ffmpeg/ffmpeg -init_hw_device qsv=sma:/dev/dri/renderD128 -hwaccel_device sma -hwaccel qsv -hwaccel_output_format qsv -vcodec hevc_qsv -i input.mkv -vcodec h264_qsv -map 0:0 -pix_fmt nv12 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -global_quality 18 -profile:v high -tag:v avc1 -look_ahead 0 -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 title=5.1 Channel -metadata:s:a:0 handler_name=5.1 Channel -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 copy -map 0:1 -metadata:s:a:1 title=5.1 Channel -metadata:s:a:1 handler_name=5.1 Channel -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:2 aac -map 0:1 -ac:a:2 2 -b:a:2 256k -metadata:s:a:2 BPS=256000 -metadata:s:a:2 BPS-eng=256000 -filter:a: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 -metadata:s:a:2 title=Stereo -metadata:s:a:2 handler_name=Stereo -metadata:s:a:2 language=eng -disposition:a:2 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y input.mp4
ffmpeg version 5.1.3-Jellyfin Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    title           :
    ENCODER         : Lavf58.45.100
  Duration: 00:21:38.11, start: 0.000000, bitrate: 1028 kb/s
  Chapters:
    Chapter #0:0: start 405.020000, end 957.015000
      Metadata:
        title           : Chapter 1
    Chapter #0:1: start 957.015000, end 1209.022000
      Metadata:
        title           : Chapter 2
    Chapter #0:2: start 1209.022000, end 1298.112000
      Metadata:
        title           : Chapter 3
  Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
    Metadata:
      title           : Encoded by Goki for TAoE using Choryu V16bw
      ENCODER         : Lavc58.91.100 libx265
      BPS             : 769397
      BPS-eng         : 769397
      DURATION        : 00:21:38.004708333
      DURATION-eng    : 00:21:38.004708333
      NUMBER_OF_FRAMES: 31121
      NUMBER_OF_FRAMES-eng: 31121
      NUMBER_OF_BYTES : 124835068
      NUMBER_OF_BYTES-eng: 124835068
      _STATISTICS_WRITING_APP: mkvpropedit v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvpropedit v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-12-20 23:11:32
      _STATISTICS_WRITING_DATE_UTC-eng: 2021-12-20 23:11:32
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 256 kb/s (default)
    Metadata:
      title           :
      BPS             : 256006
      BPS-eng         : 256006
      DURATION        : 00:21:38.080000000
      DURATION-eng    : 00:21:38.080000000
      NUMBER_OF_FRAMES: 40566
      NUMBER_OF_FRAMES-eng: 40566
      NUMBER_OF_BYTES : 41539584
      NUMBER_OF_BYTES-eng: 41539584
      _STATISTICS_WRITING_APP: mkvpropedit v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvpropedit v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-12-20 23:11:32
      _STATISTICS_WRITING_DATE_UTC-eng: 2021-12-20 23:11:32
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:2(eng): Subtitle: subrip
    Metadata:
      BPS             : 106
      BPS-eng         : 106
      DURATION        : 00:20:59.618000000
      DURATION-eng    : 00:20:59.618000000
      NUMBER_OF_FRAMES: 464
      NUMBER_OF_FRAMES-eng: 464
      NUMBER_OF_BYTES : 16788
      NUMBER_OF_BYTES-eng: 16788
      _STATISTICS_WRITING_APP: mkvpropedit v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvpropedit v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-12-20 23:11:32
      _STATISTICS_WRITING_DATE_UTC-eng: 2021-12-20 23:11:32
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:3(eng): Subtitle: subrip
    Metadata:
      title           : SDH
      BPS             : 111
      BPS-eng         : 111
      DURATION        : 00:20:59.618000000
      DURATION-eng    : 00:20:59.618000000
      NUMBER_OF_FRAMES: 482
      NUMBER_OF_FRAMES-eng: 482
      NUMBER_OF_BYTES : 17505
      NUMBER_OF_BYTES-eng: 17505
      _STATISTICS_WRITING_APP: mkvpropedit v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvpropedit v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-12-20 23:11:32
      _STATISTICS_WRITING_DATE_UTC-eng: 2021-12-20 23:11:32
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (eac3 (native) -> ac3 (native))
  Stream #0:1 -> #0:2 (copy)
  Stream #0:1 -> #0:3 (eac3 (native) -> aac (native))
Press [q] to stop, [?] for help
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
[aac @ 0x56313dd8bfc0] Qavg: 48851.594
[aac @ 0x56313dd8bfc0] 2 frames left in the queue on closing
Conversion failed!

input.mp4 deleted.
Error converting, no outputfile generated for inputfile input.mkv.
There was an error processing file input.mkv, no output data received

FFMpeg headers

ffmpeg version 5.1.3-Jellyfin Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100

System Information

  • OS: Ubuntu
  • Python version 3.10.6
  • Docker config (if relevant)

Expected behavior hevc_qsv is used for decoding and h264_qsv is used for encoding

Additional context I have it working with the following ffmpeg command:

/usr/lib/jellyfin-ffmpeg/ffmpeg -hwaccel qsv -hwaccel_output_format qsv -c:v hevc_qsv -i input.mkv -vf 'scale_qsv=w=1920:h=1080:format=nv12' -c:v h264_qsv output.mp4

uchagani avatar Jul 29 '23 19:07 uchagani

Looks like adding it to postopts works postopts = -vf,scale_qsv=w=1920:h=1080:format=nv12 however I had to remove the values from pix-fmt so it looks like pix-fmt = . Does this mean that all files will be converted to nv12?

Is there a way for me to only convert only if the source pix_fmt is not nv12, yuv420p? And if a conversion is necessary, use the -vf parameter to specify the format instead of the -pix_fmt since it seems that's what ffmpeg needs in this situation to work correctly.

uchagani avatar Jul 31 '23 16:07 uchagani

@mdhiggins I wonder if these issues are because of ffmpeg 5+? I just tried vaapi instead of qsv and i got the same error trying to convert 10bit hevc to h264: Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0'

uchagani avatar Aug 01 '23 16:08 uchagani

@mdhiggins it seems that for quicksync the pix_fmt option is not supported and it needs to be part of the video format:

https://github.com/jellyfin/jellyfin/issues/2046

uchagani avatar Aug 01 '23 17:08 uchagani

Also when transcoding 10bit to 8bit, the pix_fmt option needs to be nv12 with qsv. other options won't work.

uchagani avatar Aug 01 '23 17:08 uchagani

So it looks like this issue is multifactorial

First problem is that the QSV protcol in SMA doesn't have a specific override like VAAPI or NVENC to handle the resizing scalar options and insert the proper filters, I just added a variant of this based on the way NVEnvc is implemented so see if that helps

bc362d41e4ecc855cebf204c6155270bb440ea7d

The other issue is your approach to inserting this information. With this update and with the behavior of the other codecs you don't need to force the filter using post opts as it will get injected when appropriate

Your pix_fmt shouldn't be nv12 since this is more of a transitional format to move between the hardware encoder/decoder and not a valid final output format, and the above update should inject nv12 as the format transiently

See if that works, if not I have another approach more similar to the way the VAAPI codec injects the filters that I can try. I unfortunately do not have a QSV device available for testing

mdhiggins avatar Aug 03 '23 11:08 mdhiggins

thanks i'll try this out today. I'm aiming to convert all files to 8bit h264. if that's the case, what pix_fmt should i use in order to use qsv?

uchagani avatar Aug 03 '23 13:08 uchagani

@mdhiggins still getting some errors and i'm happy to test out as much as you would like. I tried the following ways:

  1. Leave pix_fmt blank
  2. pix_fmt=yuv420p
  3. pix_fmt=nv12

Here are the different errors and the generated ffmpeg commands:

pix_fmt blank:

[h264_qsv @ 0x55cf63a71580] Current pixel format is unsupported
[h264_qsv @ 0x55cf63a71580] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
[vost#0:0/h264_qsv @ 0x55cf63a6bdc0] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[aac @ 0x55cf63a76a80] Qavg: 55872.289
[aac @ 0x55cf63a76a80] 2 frames left in the queue on closing
Conversion failed!

ffmpeg command:

/usr/lib/jellyfin-ffmpeg/ffmpeg -hwaccel qsv -hwaccel_output_format qsv -vcodec hevc_qsv -i "/downloads/Family Guy (1999) - S20E10 - Christmas Crime [WEBRip-1080p].mkv" -vcodec h264_qsv -map 0:0 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -global_quality 18 -profile:v high -tag:v avc1 -look_ahead 0 -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=eng -disposition:a:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 copy -map 0:1 -metadata:s:a:1 "title=5.1 Channel" -metadata:s:a:1 "handler_name=5.1 Channel" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:2 aac -map 0:1 -ac:a:2 2 -b:a:2 256k -metadata:s:a:2 BPS=256000 -metadata:s:a:2 BPS-eng=256000 -filter:a: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" -metadata:s:a:2 title=Stereo -metadata:s:a:2 handler_name=Stereo -metadata:s:a:2 language=eng -disposition:a:2 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y "/downloads/Family Guy (1999) - S20E10 - Christmas Crime [WEBRip-1080p].mp4"

pix_fmt=yuv420p

Incompatible pixel format 'yuv420p' for codec 'h264_qsv', auto-selecting format 'nv12'
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
[aac @ 0x5640a2edfdc0] Qavg: 55872.289
[aac @ 0x5640a2edfdc0] 2 frames left in the queue on closing
Conversion failed!

ffmpeg command:

/usr/lib/jellyfin-ffmpeg/ffmpeg -hwaccel qsv -hwaccel_output_format qsv -vcodec hevc_qsv -i "/downloads/Family Guy (1999) - S20E10 - Christmas Crime [WEBRip-1080p].mkv" -vcodec h264_qsv -map 0:0 -pix_fmt yuv420p -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -global_quality 18 -profile:v high -tag:v avc1 -look_ahead 0 -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=eng -disposition:a:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 copy -map 0:1 -metadata:s:a:1 "title=5.1 Channel" -metadata:s:a:1 "handler_name=5.1 Channel" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:2 aac -map 0:1 -ac:a:2 2 -b:a:2 256k -metadata:s:a:2 BPS=256000 -metadata:s:a:2 BPS-eng=256000 -filter:a: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" -metadata:s:a:2 title=Stereo -metadata:s:a:2 handler_name=Stereo -metadata:s:a:2 language=eng -disposition:a:2 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y "/downloads/Family Guy (1999) - S20E10 - Christmas Crime [WEBRip-1080p].mp4"

pix_fmt=nv12:

Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
[aac @ 0x55a70524edc0] Qavg: 55872.289
[aac @ 0x55a70524edc0] 2 frames left in the queue on closing
Conversion failed!

ffmpeg command:

/usr/lib/jellyfin-ffmpeg/ffmpeg -hwaccel qsv -hwaccel_output_format qsv -vcodec hevc_qsv -i "/downloads/Family Guy (1999) - S20E10 - Christmas Crime [WEBRip-1080p].mkv" -vcodec h264_qsv -map 0:0 -pix_fmt nv12 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -global_quality 18 -profile:v high -tag:v avc1 -look_ahead 0 -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=eng -disposition:a:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 copy -map 0:1 -metadata:s:a:1 "title=5.1 Channel" -metadata:s:a:1 "handler_name=5.1 Channel" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:2 aac -map 0:1 -ac:a:2 2 -b:a:2 256k -metadata:s:a:2 BPS=256000 -metadata:s:a:2 BPS-eng=256000 -filter:a: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" -metadata:s:a:2 title=Stereo -metadata:s:a:2 handler_name=Stereo -metadata:s:a:2 language=eng -disposition:a:2 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y "/downloads/Family Guy (1999) - S20E10 - Christmas Crime [WEBRip-1080p].mp4"

uchagani avatar Aug 03 '23 15:08 uchagani

@mdhiggins any ideas what i could be doing wrong here?

uchagani avatar Aug 10 '23 13:08 uchagani

Haven't had free time to work on this.

Could you post a sample of a working version of the command you're looking for and I'll try to tweak things to target that

mdhiggins avatar Aug 10 '23 15:08 mdhiggins

this seems to work to convert 10bit HEVC to 8bit h264:

/usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel 40 -hwaccel qsv -hwaccel_output_format qsv -c:v hevc_qsv -i input.mkv -vf 'scale_qsv=w=1920:h=1080:format=nv12' -c:v h264_qsv output.mp4

uchagani avatar Aug 10 '23 15:08 uchagani

Hm so this command is not ideal because you're not specifying any sort of output format, you're just letting it pick defaults. What pix_fmt does this ultimately output? nv12 is just a transitional format so the final pix_fmt here would be out of user control. We would need to come up with a command that allows that to be specified otherwise we are forcing everyone to drop hdr

mdhiggins avatar Aug 12 '23 16:08 mdhiggins

@mdhiggins I'm not really sure tbh, the command above is the only thing i could get to get quicksync working (as verified by intel_gpu_top). Are there any other pix_fmt i should try? I have an Intel® Celeron® G4900 Processor (8th gen) that supports hevc decoding and encoding according to: https://www.intel.com/content/www/us/en/docs/onevpl/developer-reference-media-intel-hardware/1-0/overview.html#SUMMARY

uchagani avatar Aug 13 '23 23:08 uchagani

What was the pix fmt that was created using your sample command? Should be able to pull this from ffprobe

mdhiggins avatar Aug 14 '23 15:08 mdhiggins

@mdhiggins Here is the output for ffprobe. it looks like it is yuv420p. According to https://github.com/jellyfin/jellyfin/issues/2046#issuecomment-558312305 it seems the pix_fmt option is not supported by h264_qsv which is what we're seeing here where it's not taking yuv420p when i set it as a pix_fmt option. This Jellyfin PR seemed to fix a lot of the 10bit hevc to 8bit h264 transcode issues. Maybe it might help solve the mystery around this: https://github.com/jellyfin/jellyfin/pull/2099

ffprobe version 6.0-Jellyfin Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Duration: 00:21:38.11, start: 0.000000, bitrate: 1053 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 957.015000
      Metadata:
        title           : Chapter 1
    Chapter #0:1: start 957.015000, end 1209.022000
      Metadata:
        title           : Chapter 2
    Chapter #0:2: start 1209.022000, end 1298.112000
      Metadata:
        title           : Chapter 3
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 660 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 h264_qsv
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 6 channels, fltp, 387 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](eng): Data: bin_data (text / 0x74786574)
    Metadata:
      handler_name    : SubtitleHandler
Unsupported codec with id 98314 for input stream 2

uchagani avatar Aug 14 '23 18:08 uchagani

Pix_fmt should be supported and is included in the QSV documentation

https://trac.ffmpeg.org/wiki/Hardware/QuickSync

I'll see if I can find a solution

mdhiggins avatar Aug 14 '23 19:08 mdhiggins

I'm seeing similar issues with NVENC :( I'm doing a similar thing - converting 10bit HDR HEVC => 8bit h264 - just using NVENC vs QSV.

I did a bunch of digging and experimentation... Trying different combinations of scaling filters, format filters, etc. The lowest-touch change I was able to come up with was:

  1. Switching from scale_npp to scale_cuda (it appears scale_npp doesn't have the ability to deal with p10le)
  2. Forcing the video filter to get generated as: -vf scale_cuda=w=1920:h=1038:format=yuv420p,hwdownload

Like I said, I tried TONS of combinations such as hwdownloading, converting to nv12 or yuv420p, re-hwuploading, etc etc. But the above is the only thing that worked for my file.

DrEsteban avatar Jan 20 '24 05:01 DrEsteban

a38aabb7f337b8f493c530b0aa59d2c867a0c829

Alright, so trying to find a way to implement this dynamically, that's my first attempt

I added a subclass of the nvenc for h265 that will override the default scaler to scale_cuda instead of scale_npp; so now if you configure your codecs to be either h265_nvenc_cuda or hevc_nvenc_cuda it will use that scaler

Now similar to how vaapi is handled I'm also reading and pulling the pix_fmt data from the settings and if that's specified it's including that in the filter using the sample filter string you provided.

I don't have any nvidia hardware readily available to test this on so let me know if it works. If it get close but you have to tweak the final ffmpeg command generated to get it to behave let me know and I can try and adjust

Open to suggestions too if you think there's a better way to implement this stuff; the hardware acceleration implementations have made this project quite the headache its hard to have a general solution that works for everyone

Edit: if we get this working I'll update the nvenc h264 classes as well

mdhiggins avatar Jan 20 '24 13:01 mdhiggins

This is analgous (albeit re: conversions TO 265...) to a previous issue with pix-fmt...

I have used

pix-fmt =

and

filter = scale_qsv=format=p010

...leaving the pix-fmt emtpy

JasonMeudt avatar Feb 05 '24 12:02 JasonMeudt

Sorry for jumping in here, but it looks like the error I'm getting with SMA and using cuda, cuvid is similar. This error only appears in SMA when I scale down to 720p "No such filter: 'scale_npp'"


/usr/bin/ffmpeg -hwaccels ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Hardware acceleration methods: vdpau cuda vaapi drm opencl cuvid

Relevant sections of .ini file

[Converter] ffmpeg = /usr/bin/ffmpeg ffprobe = /usr/bin/ffprobe threads = 0 hwaccels = cuda, cuvid hwaccel-decoders = h264_cuvid hwdevices = hwaccel-output-format = cuda:cuda output-directory = /media/data1/work output-directory-space-ratio = 0.0 output-format = mp4 output-extension = mp4

[Video] codec = h264_nvenc, h264, x264 max-bitrate = 2800 bitrate-ratio = crf = -1 crf-profiles = preset = codec-parameters = dynamic-parameters = False max-width = 1280 profile = main max-level = 4.1 pix-fmt = yuv420p prioritize-source-pix-fmt = True filter = force-filter = False

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

I can use the following direct ffmpeg command to scale to 720p using cuda without any errors. /usr/local/bin/ffmpeg -benchmark -hwaccel cuda -hwaccel_output_format cuda -i "input.1080p.WEB.h264.mkv" -vf scale_cuda=-2:720 -c:v h264_nvenc "output.720p.WEB.h264.mp4"

sma-log.txt

laryan61 avatar Feb 16 '24 22:02 laryan61