Hardware transcoding issue

Didn’t have time (been really sick here and trying to get some hours in)

I can’t speak to any of that but Consumer Equipment with Consumer Drivers with Consumer PMS …

Do I sense a compatibility pattern here?

Just asking.

Yes, there Is a very clear & obvious compatibility pattern.

But I have nowhere seen, or heard that Plex Media Server does not support to run with NVIDIA in ANY kind of server equipment. For me this is really surprising really. Usually there is no difference between them for regular applications, except the enterprise servers are of course more reliable.

I have noticed, there is an absolute shitton of second hand enterprise hardware going around for the cheap or almost free everywhere. This equipment is increasingly getting into the hands of consumers, through various means like eBay. Everywhere I look on Facebook, Reddit, etc I see people boasting about their latest catch of insanely powerful enterprise equipment they got for cheap. This stuff is only going to get even more cheap and common.

So I would think it would make sense for Plex to fix this issue, when 99.99% is working already except NVIDIA + Chrome + Transcode. It is obvious to me now, that many people who have been complaining through the years, were running into this exact issue I’m describing. It always ends in the same way, they find no solution with Plex and they move on to Emby & JF where there are no such compatability issues. I have tested this comprehensively as well.

I am gonna say, Plex should at the very least, document better (or at all) that using Plex Media Server in a server grade equipment is known to break NVIDIA & Plex has no interest in fixing it. So users don’t waste their time trying. There is absolutely nothing showing anywhere that the issue has anything to do with the server class equipment. In logs or anywhere else.

I hope you get well soon. My offer stands, I can give you or the developers, SSH root access to multiple servers where the same issue occurs, if there is any interest whatsoever in solving this issue.

1 Like

I might have sent you logs from after it was working (the downgrade) apologies. Im very certain it wasn’t subtitles because the same movie would change behavior at 8Mbps vs 4Mbps.

Alright was able to set aside a few minutes when family wasnt using the server and install 1.29.2.6364 and give it a test library of the jellyfish files you had posted. With that I am also running CUDA 12 drives for nvidia, specifically 525.89.02. Transcoding of the hevc file worked properly and can be seen in the logs.

[pozunmv@pozunflix ~]$ ps aux |grep "jelly" | grep -v jelly; nvidia-smi; tail -10 /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Media\ Server.log 
plex     1009560 33.0  0.5 5013520 184856 ?      Sl   07:57   0:00 /usr/lib/plexmediaserver/Plex Transcoder -codec:0 hevc -hwaccel:0 nvdec -hwaccel_fallback_threshold:0 10 -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i /srv/ftp/movies/test/jellyfish-30-mbps-hd-hevc.mkv -filter_complex [0:0]hwupload[0];[0]scale_cuda=w=1920:h=1080:format=nv12[1] -map [1] -codec:0 h264_nvenc -b:0 14232k -maxrate:0 18976k -bufsize:0 37952k -forced-idr:0 1 -r:0 29.969999999999999 -force_key_frames:0 expr:gte(t,n_forced*1) -f dash -seg_duration 1 -dash_segment_type mp4 -init_seg_name init-stream$RepresentationID$.m4s -media_seg_name chunk-stream$RepresentationID$-$Number%05d$.m4s -window_size 5 -delete_removed false -skip_to_segment 1 -time_delta 0.0625 -manifest_name http://127.0.0.1:32400/video/:/transcode/session/q7sq68puton9k475hp24w4gs/4d0cfd0c-05b7-47e9-9010-f80323c6484c/manifest?X-Plex-Http-Pipeline=infinite -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 dash -start_at_zero -copyts -vsync cfr -init_hw_device cuda=cuda: -filter_hw_device cuda -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/q7sq68puton9k475hp24w4gs/4d0cfd0c-05b7-47e9-9010-f80323c6484c/progress
Tue Feb 14 07:57:42 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.89.02    Driver Version: 525.89.02    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   46C    P0    54W / 130W |    218MiB /  6144MiB |      5%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A   1009560      C   ...iaserver/Plex Transcoder      214MiB |
+-----------------------------------------------------------------------------+
Feb 14, 2023 07:57:42.764 [0x7f5c0f398b38] DEBUG - [Req#372/Transcode/q7sq68puton9k475hp24w4gs] Asked for segment 10 from session.
Feb 14, 2023 07:57:42.764 [0x7f5c0f398b38] DEBUG - [Req#372/Transcode/q7sq68puton9k475hp24w4gs] Returning segment 10 from session
Feb 14, 2023 07:57:42.764 [0x7f5c0f398b38] DEBUG - Content-Length of /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-q7sq68puton9k475hp24w4gs-4d0cfd0c-05b7-47e9-9010-f80323c6484c/init-stream0.m4s,/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-q7sq68puton9k475hp24w4gs-4d0cfd0c-05b7-47e9-9010-f80323c6484c/chunk-stream0-00011.m4s is 1977352 (of total: 1977352).
Feb 14, 2023 07:57:42.767 [0x7f5c1d1f6b38] DEBUG - Completed: [192.168.11.96:40016] 200 GET /video/:/transcode/universal/session/q7sq68puton9k475hp24w4gs/0/10.m4s (12 live) TLS GZIP 2ms 1977352 bytes (pipelined: 203)
Feb 14, 2023 07:57:42.795 [0x7f5c0f398b38] DEBUG - Request: [192.168.11.96:40016 (Subnet)] GET /video/:/transcode/universal/session/q7sq68puton9k475hp24w4gs/0/11.m4s (13 live) #375 TLS GZIP Signed-in
Feb 14, 2023 07:57:42.795 [0x7f5c0f398b38] DEBUG - [Req#375/Transcode/q7sq68puton9k475hp24w4gs] Asked for segment 11 from session.
Feb 14, 2023 07:57:42.795 [0x7f5c1bcc8b38] DEBUG - [Req#373/Transcode/q7sq68puton9k475hp24w4gs/4d0cfd0c-05b7-47e9-9010-f80323c6484c] Transcoder segment range: 0 - 11 (11)
Feb 14, 2023 07:57:42.795 [0x7f5c0f398b38] DEBUG - [Req#375/Transcode/q7sq68puton9k475hp24w4gs] Returning segment 11 from session
Feb 14, 2023 07:57:42.795 [0x7f5c0f398b38] DEBUG - Content-Length of /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-q7sq68puton9k475hp24w4gs-4d0cfd0c-05b7-47e9-9010-f80323c6484c/init-stream0.m4s,/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-q7sq68puton9k475hp24w4gs-4d0cfd0c-05b7-47e9-9010-f80323c6484c/chunk-stream0-00012.m4s is 1945654 (of total: 1945654).
Feb 14, 2023 07:57:42.798 [0x7f5c1cff3b38] DEBUG - Completed: [192.168.11.96:40016] 200 GET /video/:/transcode/universal/session/q7sq68puton9k475hp24w4gs/0/11.m4s (12 live) TLS GZIP 2ms 1945654 bytes (pipelined: 204)

So yeah looking at the transcode settings the only thing different is bitrate (could have swore I had both set at 20MB but the 1.29.2 version set a variable bitrate -b:0 14232k -maxrate:0 18976k versus 1.31 setting -b:0 20000k -preset:0 hq and the 1.31 version is adding -extra_hw_frames:0 8. Given that its essentially calling the transcoder with the same settings, the issue appears once again to be coming directly from ffmpeg and how you are compiling/calling it.

@Ossalingur

I understand and appreciate your thoughts.

I am working hard to resolve this but have nothing I can share at this time.

Without further discussion of any kind, regarding “server” grade equipment, which can also be seen as “commercial” grade equipment.

https://www.plex.tv/about/privacy-legal/plex-terms-of-service/

Is your Plex server for HOME use or COMMERCIAL use ?
Server cards can most frequently be found in ENTERPRISE (Commercial) environments.

You want a published list of “All Approved Parts” ? Do you realize what you’re asking?

If Emby and JellyFin are so good, WHY ARE YOU STILL HERE ?

NO: I’m not trying to be a jerk but I am pointing out there are multiple points of view and there’s more happening than you see/I can convey. Please take a breath.

I am stepping away from this thread for a break. (back to bed)

Hope you get well soon.

But, just because a piece of hardware is typically used for commercial purposes, doesn’t mean is always is.

Take a look through /r/homelab or /r/homelabsales. You’ll find MANY folks are running older “enterprise” systems (I sell IBM Power Systems for a living, and the stuff from most x86 vendors is not truly enterprise-class, but that’s an entirely different conversation) in their labs at home purely for hobby/skill building. I’m confident a large swath of Plex users fall into this category where they’re running older commercial-grade gear from Dell, Lenovo, HPE, etc…

It would be smart of Plex not to focus on the underlying hardware to determine if a system is being used for home or commercial use… A wiser metric could be max total concurrent remote streams in excess of idk 20-30 as the bar to measure when someone may be using their server for something outside the scope of what is intended.

To use OS as an example, I’m using Server 2019 as my OS due to it being significantly more stable than Win10/11 on a custom-built PC.

Please don’t use the underlying hardware or OS to determine if a system is being used appropriately or not. There are plenty of legitimate reasons why someone would use commercial Hardware or OS in their labs at home.

1 Like

Also having the same issue after upgrading to 1.31.0.6654

OS: Ubuntu 20.04.5 LTS x86_64
GPU: NVIDIA Quadro P400

Error log reports:

Feb 15, 2023 10:07:25.269 [0x7f83a1597b38] ERROR - [Req#168/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 15, 2023 10:07:26.198 [0x7f83a1597b38] ERROR - [Req#168/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 15, 2023 10:07:26.906 [0x7f83a1597b38] ERROR - [Req#168/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 15, 2023 10:07:27.930 [0x7f83a1191b38] ERROR - [Req#198/Transcode/sqyz477dnornqbj6c5w1u8vs/3ce1fd76-83ee-44ac-a41c-89e824b5252c] [hevc @ 0x7ff65eaa2b80] No decoder surfaces left
Feb 15, 2023 10:07:27.931 [0x7f83a1394b38] ERROR - [Req#199/Transcode/sqyz477dnornqbj6c5w1u8vs/3ce1fd76-83ee-44ac-a41c-89e824b5252c] [hevc @ 0x7ff65eaa2b80] decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx->pic_params) failed -> CUDA_ERROR_INVALID_VALUE: invalid argument
Feb 15, 2023 10:07:27.931 [0x7f83a832bb38] ERROR - [Req#19a/Transcode/sqyz477dnornqbj6c5w1u8vs/3ce1fd76-83ee-44ac-a41c-89e824b5252c] [hevc @ 0x7ff65eaa2b80] hardware accelerator failed to decode picture
Feb 15, 2023 10:07:27.932 [0x7f83a1191b38] ERROR - [Req#19b/Transcode/sqyz477dnornqbj6c5w1u8vs/3ce1fd76-83ee-44ac-a41c-89e824b5252c] Error while decoding stream #0:0: Generic error in an external library
Feb 15, 2023 10:07:27.932 [0x7f83a1394b38] ERROR - [Req#19c/Transcode/sqyz477dnornqbj6c5w1u8vs/3ce1fd76-83ee-44ac-a41c-89e824b5252c] [hevc @ 0x7ff65eaa2b80] Could not find ref with POC 15
Feb 15, 2023 10:07:27.933 [0x7f83a832bb38] ERROR - [Req#19d/Transcode/sqyz477dnornqbj6c5w1u8vs/3ce1fd76-83ee-44ac-a41c-89e824b5252c] [hevc @ 0x7ff65eaa2b80] No decoder surfaces left
root@plex:~# nvidia-smi
Wed Feb 15 10:18:05 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.89.02    Driver Version: 525.89.02    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro P400         Off  | 00000000:11:00.0 Off |                  N/A |
| 34%   46C    P8    N/A /  30W |      2MiB /  2048MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Could this be a upstream FFMPEG issue?

EDIT: Was able to transcode without issues using FFMPEG directly.

@ChuckPa @pozunmv
I was able to transcode a failing file with ffmpeg by using the -preset p1 (jellyfin was able to transcode such files and starting eliminating all option used and ended up with “”-preset p1 “”
[[ also work p2, p3 and fast ]]

works::>>>
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mkv -codec:v:0 h264_nvenc -preset p1 output.mp4

Fails::>>>
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mkv -codec:v:0 h264_nvenc output.mp4
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mkv -codec:v:0 h264_nvenc -preset:0 hq output.mp4
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mkv -codec:v:0 h264_nvenc -preset slow output.mp4

Substituting “Plex Transcoder” for “ffmpeg”, can you create the same magic?

If you look in your PMS logs, the “[FFMPEG]” line shows you the exact Plex Transcoder command.

All you need to do is cut off from the Progress URL to the end & add your output filename

Everything in the log is already in “Shell-quoted” format so you can literally Copy & Paste

@ChuckPa I’m on version 29

I tried to include more transcoder options, not that easy you can’t just copy the arguments to ffmpeg; however kept the main options to simulate)

But tried to simulate the options I could and was able to simulate the same. works for instance with p3 even when using the newer tune option “”-preset:0 p3 -tune hq""

note: now using 5.1.2 instead of older ffmpeg 4 version that is part of the standard ubuntu
also: ffmpeg version 5.1.2 gives a warning when using hq … :: The selected preset is deprecated. Use p1 to p7 + -tune …

==============================
Not working :: with -preset:0 hq

ffmpeg -codec:0 hevc -hwaccel:0 nvdec -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i input.mkv -codec:0 h264_nvenc -preset:0 hq -copyts -vsync cfr -init_hw_device cuda=cuda: output.mp4

Stream mapping:
Stream #0:0#0:0 (hevc (native) → h264 (h264_nvenc))
Stream #0:1#0:1 (ac3 (native) → aac (native))
Press [q] to stop, [?] for help
[h264_nvenc @ 0x557fd0ddd0c0] The selected preset is deprecated. Use p1 to p7 + -tune or fast/medium/slow.

[hevc @ 0x557fd0d84140] No decoder surfaces left0:00:00.00 bitrate=N/A speed= 0x
[hevc @ 0x557fd0d84140] decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx->pic_params) failed → CUDA_ERROR_INVALID_VALUE: invalid argument
[hevc @ 0x557fd0d84140] hardware accelerator failed to decode picture
Error while decoding stream #0:0: Generic error in an external library
[hevc @ 0x557fd0d84140] Could not find ref with POC 8
[hevc @ 0x557fd0d84140] No decoder surfaces left

===========================
WORKING by only changing the -preset:0 p3 -tune hq

ffmpeg -codec:0 hevc -hwaccel:0 nvdec -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i input.mkv -codec:0 h264_nvenc -preset:0 p3 -tune hq -copyts -vsync cfr -init_hw_device cuda=cuda: output.mp4

Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), cuda(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 24 fps, 12288 tbn (default)
Metadata:
BPS : 11002019
BPS-eng : 11002019
DURATION-eng : 00:40:21.709000000
NUMBER_OF_FRAMES: 58121
NUMBER_OF_FRAMES-eng: 58121
NUMBER_OF_BYTES : 3330461254
NUMBER_OF_BYTES-eng: 3330461254
_STATISTICS_WRITING_APP: mkvmerge v13.0.0 (‘The Juggler’) 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v13.0.0 (‘The Juggler’) 64bit
_STATISTICS_WRITING_DATE_UTC: 2018-09-26 20:06:48
_STATISTICS_WRITING_DATE_UTC-eng: 2018-09-26 20:06:48
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:40:21.922000000
encoder : Lavc59.37.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1(side), fltp, 394 kb/s (default)
Metadata:
BPS : 640000
BPS-eng : 640000
DURATION-eng : 00:40:21.728000000
NUMBER_OF_FRAMES: 75679
NUMBER_OF_FRAMES-eng: 75679
NUMBER_OF_BYTES : 193738240
NUMBER_OF_BYTES-eng: 193738240
_STATISTICS_WRITING_APP: mkvmerge v13.0.0 (‘The Juggler’) 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v13.0.0 (‘The Juggler’) 64bit
_STATISTICS_WRITING_DATE_UTC: 2018-09-26 20:06:48
_STATISTICS_WRITING_DATE_UTC-eng: 2018-09-26 20:06:48
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:40:21.728000000
encoder : Lavc59.37.100 aac
frame= 1563 fps=318 q=28.0 Lsize= 19155kB time=00:00:59.50 bitrate=2637.1kbits/s speed=12.1x

@ChuckPa
Update with more parameters including filter_complex used by the transcoder

Not working with hq
ffmpeg -codec:0 hevc -hwaccel:0 nvdec -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i input.mkv -filter_complex “[0:0]hwupload[0];[0]scale_cuda=w=1920:h=1080:format=nv12[1]” -map “[1]” -codec:0 h264_nvenc -b:0 14012k -maxrate:0 18683k -bufsize:0 37366k -preset:0 hq -forced-idr:0 1 -r:0 23.975999999999999 -force_key_frames:0 “expr:gte(t,n_forced*1)” -init_hw_device cuda=cuda: output.mp4

working with p3
ffmpeg -codec:0 hevc -hwaccel:0 nvdec -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i input.mkv -filter_complex “[0:0]hwupload[0];[0]scale_cuda=w=1920:h=1080:format=nv12[1]” -map “[1]” -codec:0 h264_nvenc -b:0 14012k -maxrate:0 18683k -bufsize:0 37366k -preset:0 p3 -tune hq -forced-idr:0 1 -r:0 23.975999999999999 -force_key_frames:0 “expr:gte(t,n_forced*1)” -init_hw_device cuda=cuda: output.mp4

ps during the testing I also noticed there’s a problem with stereo option used by the transcoder ** :ocl=‘stereo’** >> ocl is depreciated and now ochl … Removed audio and subs from the test as this makes it hard to simulate

edit : also saw from previous test that version 29 is using expr:gte(t,n_forced*1) 31 “expr:gte(t,n_forced*3)” but that doesn’t make a difference in results

edit2:
Since the input file was encoded with HQ preset [main 10] I tried to re-encode it with p7_hq but that didn’t change the behaviour (didn’t have an possibility to encode a h264 to h.265 directly with p7_hq and main10 profile)

edit3 by adding the -vf scale_cuda=format=yuv420p which is not compatible with complex filter i can use hq or p7 as preset See edit 4
ffmpeg -codec:0 hevc -hwaccel:0 nvdec -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i input.mkv -vf scale_cuda=format=yuv420p -codec:0 h264_nvenc -b:0 14012k -maxrate:0 18683k -bufsize:0 37366k -preset:0 hq -forced-idr:0 1 -r:0 23.975999999999999 -force_key_frames:0 “expr:gte(t,n_forced*3)” -init_hw_device cuda=cuda: output.mp4

edit 4 the problem seems to be in the complex filter … replacing :format=nv12[1] by format=yuv420p[1] it works

ffmpeg -codec:0 hevc -hwaccel:0 nvdec -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i input_p7.mkv -filter_complex “[0:0]hwupload[0];[0]scale_cuda=w=1920:h=1080:format=yuv420p[1]” -map “[1]” -codec:0 h264_nvenc -b:0 14012k -maxrate:0 18683k -bufsize:0 37366k -preset:0 hq -forced-idr:0 1 -r:0 23.975999999999999 -force_key_frames:0 “expr:gte(t,n_forced*3)” -init_hw_device cuda=cuda: output.mp4

Somehow ffmpeg/nvidia is not able to output format=nv12 if the input is format=yuv420p ? [or to any other output format]

*note: getting the warning for hq but that’s not an issue *
[h264_nvenc @ 0x55fd1628c3c0] The selected preset is deprecated. Use p1 to p7 + -tune or fast/medium/slow.

@ChuckPa Do you have feedback from the team on a way forward?

Other complex filter options

It looks you use the nv12 pixel format as output if you first instruct the filter to use the source format and then nv12 [[if I got it right]]. It uses GPU (20%) but hardly any CPU [on GTX1050Ti]. (with only yuv420p 10% GPU)
P7 converts half as fast as p3 (p3 which is lesser quality at 4% CPU, directly in nv12).
The output results for both nv12 and yuv420p a yuv420p(progressive) (as per ffprobe). The target indicated by ffpmeg is cuda(tv, progressive).

fmpeg -codec:0 hevc -hwaccel:0 nvdec -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i input.mkv -filter_complex “[0:0]hwupload[0];[0]scale_cuda=w=1920:h=1080:format=yuv420p[1];[1]scale_cuda=format=nv12[2]” -map “[2]” -codec:0 h264_nvenc -b:0 14012k -maxrate:0 18683k -bufsize:0 37366k -preset:0 p7 -tune hq -forced-idr:0 1 -r:0 23.975999999999999 -force_key_frames:0 “expr:gte(t,n_forced*3)” -init_hw_device cuda=cuda: output.mp4

HQ depreciated
fmpeg -codec:0 hevc -hwaccel:0 nvdec -threads:0 1 -hwaccel_output_format:0 cuda -hwaccel_device:0 cuda -analyzeduration 20000000 -probesize 20000000 -i input.mkv -filter_complex “[0:0]hwupload[0];[0]scale_cuda=w=1920:h=1080:format=yuv420p[1];[1]scale_cuda=format=nv12[2]” -map “[2]” -codec:0 h264_nvenc -b:0 14012k -maxrate:0 18683k -bufsize:0 37366k -preset:0 hq -forced-idr:0 1 -r:0 23.975999999999999 -force_key_frames:0 “expr:gte(t,n_forced*3)” -init_hw_device cuda=cuda: output.mp4

1 Like

Re-Encode in 10 bit

Since the problem is only with 8 bit hevc files why not re-encode them. If you use the p7 hq option the result is actually smaller than the original hq 8bit encoding

You can re-code the HEVC 8 bit to 10 bit with the p7 hq setting and constant bit rate with following settings
-vf scale_cuda=format=p010le -c:V hevc_nvenc -preset:V p7 -tune hq -rc cbr -profile:V main10 -rc-lookahead 20

=edit=

below an quick script I use to find the files i need to re-encode

Blockquote
for directory in “/media/movie2/series”
do
echo “Dir is : ${directory}”
IFS=$‘\n’
for sub_directory in find "${directory}" -mindepth 1 -maxdepth 1 -type d
do
#echo “SubDir: ${sub_directory}”
lines=find "${sub_directory}" -name *nvidia265.mkv -exec ffprobe -show_format -i {} \; 2>&1| grep -e 'Video: hevc (Main 10), yuv420p(tv' -e 'filename=' | grep -e 'filename' -e '1920x1080'
for a in ${lines}
do
stream=echo ${a} | cut -f3 -d ' '
if [[ “${stream}” == “Stream” ]]
then
#echo $a
getnextline=“1”
else
if [[ ${getnextline} == “1” ]]
then
Filefound=echo "${a}" | sed s/filename\=//
#echo “File: ${Filefound}”
Filemove=echo "${Filefound}" | sed s/AC3.nvidia265.mkv$/mkv/
echo “File: ${Filefound} use ${Filemove}”
#read -p “Continue with re-encode? " -n 1 -r
#echo # (optional) move to a new line
#if [[ ! $REPLY =~ [1]$ ]]
#then
#exit 1
#fi
mv “${Filefound}” “${Filemove}”
### next line is re-encoding using another script/pipeline I wrote
### GitHub - sverhaeg/nvidia_ffmpeg: Bash script to convert video file using nvidia hardware on linux Ubuntu using ffmpeg I changed it to code in p7
./nvidia_ffmpeg.sh -e5 -Force -S -f “${Filemove}”
fi
getnextline=“0”
stream=”"
fi
done
done
done

Blockquote


  1. Yy ↩︎

gang,

Been a bit out sick

The engineers gave me this to try for the Nvidia problem.

Please let me know ASAP

Don’t confuse this with 1.31.1.6716 (in PlexPass)

2 Likes

@plex_famverhaegen.be

8 bit HEVC? (as in SDR) ?

Working like a charm so far for me. The last PlexPass version (1.31.1.6716) still had 1080p (non-HEVC) → 1080p transcodes broken, but everything else was working okay.

@skiddy11

Please try to break it.

This is important as it’ll get pushed FAST if it fixes everything

Running Ubuntu LTS 22.04.01
GPU: 2060 RTX w/driver 525.89.02 (patched to remove nvenc cap)

I have a wide variety of content, and so far all of it has passed hw transcording:

  • 4kHDR (HEVC) → 4k/1080p/720p/480p
  • 4k (HEVC) → 4k/1080p/720p/480p
  • 1080p (HEVC) → 1080p/720p/480p
  • 1080p (H264) → 1080p/720p/480p
  • 1080p (VC1) → 1080p/720p/480p
  • 1080p (MPEG2) → 1080p/720p/480p
  • 480p (H264) → 480p/360p
  • 480i (MPEG2) → 480p/360p

Will leave a 1080p H264 → 10Mbit 1080p transcode running for a bit.

2 Likes

No as in yuv420p vs p010le pixel format >> So streams like “” Video: hevc (Main 10), yuv420p(tv '“”

I’m heading to bed (very late) did you test the above?

initial report is good