Decoding with ffmpeg 3.2.4 is good, Decoding with ffmpeg 3.4 is bad. I have to add the -drop_second_field 1 and -surfaces 10 parameters.
Why -surfaces 10?
FFmpeg 3.4:
Decoder h264_cuvid [Nvidia CUVID H264 decoder]:
General capabilities: delay
Threading capabilities: none
Supported pixel formats: cuda nv12 p010le p016le
h264_cuvid AVOptions:
-deint .D.V… Set deinterlacing mode (from 0 to 2) (default weave)
weave .D.V… Weave deinterlacing (do nothing)
bob .D.V… Bob deinterlacing
adaptive .D.V… Adaptive deinterlacing
-gpu .D.V… GPU to be used for decoding -surfaces .D.V… Maximum surfaces to be used for decoding (from 0 to INT_MAX) (default 25)
-drop_second_field .D.V… Drop second field when deinterlacing (default false)
-crop .D.V… Crop (top)x(bottom)x(left)x(right)
-resize .D.V… Resize (width)x(height)
FFmpeg 3.2.4:
Decoder h264_cuvid [Nvidia CUVID H264 decoder]:
General capabilities: delay
Threading capabilities: none
Supported pixel formats: cuda nv12
h264_cuvid AVOptions:
-deint .D.V… Set deinterlacing mode (from 0 to 2) (default weave)
weave .D.V… Weave deinterlacing (do nothing)
bob .D.V… Bob deinterlacing
adaptive .D.V… Adaptive deinterlacing
-gpu .D.V… GPU to be used for decoding
It seems to me it is a bug, what if you WANT to have frame doubling on deinterlacing? It is a feature which is supported by cuvid so why does ffmpeg drops every other frame?
This is working fine till ffmpeg 3.3.x , by setting output framerate with -r 50 (if original is 25i), for example:
ffmpeg -hwaccel cuvid -c:v h264_cuvid -deint 2 -resize 1280x720 -f mpegts -i interlaced_1080i50.ts -vcodec h264_nvenc -preset slow -r 50 -f mpegts out.ts
However, -r 50 for output framerate does nothing from 3.4.x till latest 4.0.2 (haven’t tried latest git but I guess it will be the same).
Is this something to be reported to ffmpeg or is it an issue with cuvid?