This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Trying to deinterlace with Bob NVEnc; job crashes
#11
There are two deinterlace options when using NVEncC both are offered through Hybrid.
No clue what you are looking for. Huh
See:
https://github.com/rigaya/NVEnc/blob/mas...ace-string

Cu Selur
Reply
#12
I just realized why my command had a different deinterlacer: it's using h264_cuvid decoder to deinterlace, which then gets passed to NVEnc to encode.

I guess I'm going to have to fix my own tool to use this for now.

Is it a decent request to ask you to implement h264_cuvid decoder support in Hybrid?
Reply
#13
Quote:Is it a decent request to ask you to implement h264_cuvid decoder support in Hybrid?
Hybrid already does if you enable "Config->Input->Decoding->Use gpu for decoding" and set "Config->Input->Decoding->Use gpu for decoding->Method" to cuvid, but Hybrid does not support: yadif_cuda also no clue what ' -deint 2' does, accoding to the documentation:
Quote:deint
Specify which frames to deinterlace. Accepts one of the following values:
0, all
Deinterlace all frames.
1, interlaced
Only deinterlace frames marked as interlaced.
source: yadif_cuda
'deint' should only support 0 and 1 not 2.

Cu Selur
Reply
#14
Okay, correction "-deint" isn't yadif_cuda, it's an option of 'h264_cuvid' which I'm not supporting since was replaced with h264_nvenc.
On Linux h264_nvenc is supported (but there is no deint option).

If you want decent deinterlacing use QTGMC, YadifMod or similar.
If you need that deinterlacer don't use Hybrid.

Cu Selur
Reply
#15
(20.08.2021, 20:53)Selur Wrote: Okay, correction "-deint" isn't yadif_cuda, it's an option of 'h264_cuvid' which I'm not supporting since was replaced with h264_nvenc.
On Linux h264_nvenc is supported (but there is no deint option).

Umm, it was not replaced. Only the encoder was replaced. The decoder wasn't and uses the latest deinerlacing method from the drivers. This is why I use it.

The encoder was fully removed from FFmpeg, if h264_cuvid ever was an encoder to begin with.

(20.08.2021, 20:53)Selur Wrote: If you want decent deinterlacing use QTGMC, YadifMod or similar.
If you need that deinterlacer don't use Hybrid.

Fair enough.
QTGMC makes some videos flicker, while h264_cuvid doesn't.
QTGMC is far slower than h264_cuvid (30 FPS compared to 220)
YadifMod still keeps many combing artifacts, while h264_cuvid doesn't.

I rewrote the command in the initial post:
ffmpeg -c:v h264_cuvid -deint 2 -i <input_video> -c:v libx264 -profile:v high -preset veryfast -crf 18 -x264opts "keyint=500" -c:a copy <output_video.mkv>

The command initially sets the decoder used for the input video and sets the deinterlacing mode to "2", which means "adaptive". Then, the command follows a normal path, setting and configuring libx264 as an encoder.

In case you do want to add another deinterlacing method by enabling the use of h264_cuvid and h265_cuvid as decoders, you have the info needed here.

As I mentioned above, h264_cuvid and h265_cuvid areĀ not encoders, if this changes your mind.

EDIT: I just noticed there are resizing and cropping options. I have to test them and see whether or not they are more efficient than the usual CPU methods.


Attached Files Thumbnail(s)
   
Reply
#16
Quote:As I mentioned above, h264_cuvid and h265_cuvid are not encoders, if this changes your mind.
Okay. Sorry for the mixup the 'xx_cuvid' filters are basically a list of filters for the specific input format.
So h264_cuvid can only be used when decoding h264 content through the gpu, right? (at least that is what it looks like to me over at https://developer.nvidia.com/blog/nvidia...ing-guide/)

Got a link with some proper documentation?
I would need a documentation about what filters there are available for each format (assuming that h264_cuvid and vp8_cuvid etc. do not support the same= and what are their parameters.

Quote:QTGMC makes some videos flicker, while h264_cuvid doesn't.
Haven't seen that assuming the decoding itself was done properly.
Quote:QTGMC is far slower than h264_cuvid (30 FPS compared to 220)
Naturally.

Quote:YadifMod still keeps many combing artifacts, while h264_cuvid doesn't.
Okay.

Cu Selur
Reply
#17
(21.08.2021, 15:28)Selur Wrote:
Quote:As I mentioned above, h264_cuvid and h265_cuvid are not encoders, if this changes your mind.
Okay. Sorry for the mixup the 'xx_cuvid' filters are basically a list of filters for the specific input format.
So h264_cuvid can only be used when decoding h264 content through the gpu, right? (at least that is what it looks like to me over at https://developer.nvidia.com/blog/nvidia...ing-guide/)

Got a link with some proper documentation?
I would need a documentation about what filters there are available for each format (assuming that h264_cuvid and vp8_cuvid etc. do not support the same= and what are their parameters.

Quote:QTGMC makes some videos flicker, while h264_cuvid doesn't.
Haven't seen that assuming the decoding itself was done properly.
Quote:QTGMC is far slower than h264_cuvid (30 FPS compared to 220)
Naturally.

Quote:YadifMod still keeps many combing artifacts, while h264_cuvid doesn't.
Okay.

Cu Selur

I'll get back to you as soon as I get home.
Reply
#18
https://docs.nvidia.com/video-technologi...o-decoding
https://docs.nvidia.com/video-technologi...rog-guide/

I guess these can be useful links for implementing NVDEC, how they call it, or CUVID, how it is in FFmpeg.

From what I can see in FFmpeg and somewhat deduce from their documentation, all CUVID types have the same options. It seems that, for mpeg2_cuvid, the original field rate has to be forced with the "-r" command from FFmpeg, otherwise it will drop half the frame rate (at least on my drivers). Not the case with h264 and h265 versions.

Selur Wrote:So h264_cuvid can only be used when decoding h264 content through the gpu, right?

Absolutely. I just tested with FFmpeg myself.

(21.08.2021, 15:28)Selur Wrote:
Quote:YadifMod still keeps many combing artifacts, while h264_cuvid doesn't.
Okay.

My mistake, sorry. I was thinking about the VLC version of YADIF, which is horrible. YadifMod is actually pretty ok, similar to QTGMC for my eyes, with less flicker; but still slower and a bit more prone to flicker than CUVID adaptive.

I deinterlaced a video where I saw QTGMC have some flicker. YadifMod did pretty well, but was slower than CUVID (2 seconds vs instant encode). I could also try YadifMod on longer videos, but that will take longer for me to get done.

If you're interested, I'd recommend downloading all videos, since Drive re-encodes them (and deinterlaces when interlaced).

Original - interlaced
CUVID Adaptive Deinterlaced
QTGMC Deinterlaced (Draft, Bob, OpenCL)
YadifMod Deinterlaced (NNEDI3, mode 1)

QTGMC was used in Draft, since that is the only way I can come close to an acceptable speed of 30 FPS for 1080i25 video files.
Reply
#19
QTGMC draft produce very very bad quality and nothing close to real expected QTGMC quality. Use only QTGMC Medium or higher.
What are your computer specs? QTGMC "Very Slow" + NNEDI3 N128 N2 resize to 1920x1080 + fast FFV1 or ProRes codec easy can do 60fps and higher on something like not too modern RX580 or even older Radeon 7970 GPU.
With other additional filters speed can go down to 10 FPS.
Reply
#20
Quote:QTGMC was used in Draft, since that is the only way I can come close to an acceptable speed of 30 FPS for 1080i25 video files.
LOL, you could have lead with that speed is the main concern.
But I'm a bit confused that you speak of 1080i25 files, since your sample is only SD.

How fast is this for you:
ffmpeg -y -loglevel fatal -noautorotate -nostdin -hwaccel auto -threads 8 -r 25/1 -analyzeduration 5M -probesize 5M -i "G:\TestClips&Co\files\MPEG-4 H.264\1080i_25fps_Panasonic_GH1.MTS" -map 0:0 -an -sn -vf bwdif=mode=1:parity=-1:deint=1,crop=718:1076:2:4,zscale=rangein=tv:range=tv -pix_fmt yuv420p10le -strict -1 -vsync 0 -f yuv4mpegpipe - | NVEncC --y4m -i - --fps 50.000 --codec h265 --profile main10 --level auto --tier high --sar 1:1 --lookahead 32 --output-depth 10 --vbrhq 0 --vbr-quality 23.00 --aq --aq-strength 5 --gop-len 0 --ref 7 --nonrefp --bframes 0 --no-b-adapt --mv-precision Q-pel --preset default --colorrange limited --colorprim undef --colormatrix bt709 --cuda-schedule sync --output "E:\Temp\1080i_25fps_Panasonic_GH1_2021-08-21@22_04_03_3210_01.265"
On my system I get ~100fps with that,...

--

Sadly those documentations are not really helpful, then I could probably start reading the ffmpeg source code.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)