#7753(ffmpeg:new): yadif_cuda fails, with h264_cuvid decoder
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Type: defect Status: new | Priority: normal Component: ffmpeg | Version: 4.1 Keywords: yadif_cuda | Blocked By: h264_cuvid | Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: Trying to use yadif_cuda. It works fine for an mpeg2ts file, using the HW decoder mpeg2_cuvid ... but try the same thing on an H.264 input, and using h264_cuvid, then it fails. How to reproduce: {{{ % ffmpeg -threads 0 -hwaccel cuvid -c:v h264_cuvid -y -i input.MTS -vf yadif_cuda,scale_npp=1280:-1 -c:v hevc_nvenc -preset slow -cq 10 -g 150 -c:a aac -b:a 128k -metadata:s:a:0 language=eng output.mp4 ffmpeg version n4.1.1 built with gcc 8 (Ubuntu 8.2.0-7ubuntu1) }}} Error message(s) ... {{{ Parsed_yadif_cuda_0 @ 0x56524b398000] cuModuleLoadData(&s->cu_module, vf_yadif_cuda_ptx) failed -> CUDA_ERROR_UNKNOWN: unknown error [Parsed_yadif_cuda_0 @ 0x56524b398000] Failed to configure output pad on Parsed_yadif_cuda_0 Error reinitializing filters! Failed to inject frame into filter network: Invalid data found when processing input Error while processing the decoded data for stream #0:0 }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by cehoyos): * keywords: yadif_cuda h264_cuvid => cuda * version: 4.1 => unspecified * component: ffmpeg => undetermined Comment: Please test current FFmpeg git head and provide the command line you tested together with the complete, uncut console output to make this a valid ticket. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by arrmo): Hi, I tried running the git head before reverting to n4.1.1, due to the issue noted here, https://trac.ffmpeg.org/ticket/7742. This seems to say it's corrected, but when I try to build with the git head I run into this problem (i.e. compile fails). I'm more than happy to update this with the latest build, once of course I can get that to build (i.e. need the noted item resolved first). Thanks! -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by philipl): I've pushed the fix for master so you can retest there. The error you are getting is strange - the key point is the failed cuModuleLoadData call - that means the cuda kernel cannot be loaded, but this should either always fail or never fail - the mpeg2 vs h.264 is irrelevant here. For what it's worth, I can run that command line just fine locally for both mpeg2 and h.264. You should probably also use nvdec instead of cuvid. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by arrmo): Yes, you are correct - I pulled the master, and now it builds. Thanks! OK, very odd, but cuvid vs. nvdec react differently (more, below). They both fail, but in different ways. BTW .. what is the difference? Just trying to understand. Here is the difference (providing full command line - I can attach full logs if you want too, no issue!), 1) /mnt/ProgSSD/FFmpeg/ffmpeg -threads 0 -hwaccel cuvid -c:v h264_cuvid -y -i "/mnt/ProgSSD/transcodeAVCHD/test/00005.MTS" -vf yadif_cuda,scale_npp=1280:-1 -c:v hevc_nvenc -preset slow -cq 10 -g 150 -c:a aac -b:a 128k -metadata:s:a:0 language=eng "/mnt/ProgSSD/transcodeAVCHD/test/test1.mp4" {{{ ffmpeg version N-93231-g96d79ff5b5 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8 (Ubuntu 8.2.0-7ubuntu1) configuration: --enable-libnpp --enable-nonfree --enable-cuda --enable- libx264 --enable-gpl --enable-nvenc --enable-libx265 --enable-cuda-sdk --enable-cuvid libavutil 56. 26.100 / 56. 26.100 libavcodec 58. 47.102 / 58. 47.102 libavformat 58. 26.101 / 58. 26.101 libavdevice 58. 6.101 / 58. 6.101 libavfilter 7. 48.100 / 7. 48.100 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 libpostproc 55. 4.100 / 55. 4.100 Input #0, mpegts, from '/mnt/ProgSSD/transcodeAVCHD/test/00005.MTS': Duration: 00:00:15.04, start: 1.033367, bitrate: 16837 kb/s Program 1 Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080 Stream mapping: Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> hevc (hevc_nvenc)) Stream #0:1 -> #0:1 (ac3 (native) -> aac (native)) Press [q] to stop, [?] for help [Parsed_yadif_cuda_0 @ 0x56535d4c27c0] cuModuleLoadData(&s->cu_module, vf_yadif_cuda_ptx) failed -> CUDA_ERROR_UNKNOWN: unknown error [Parsed_yadif_cuda_0 @ 0x56535d4c27c0] Failed to configure output pad on Parsed_yadif_cuda_0 Error reinitializing filters! Failed to inject frame into filter network: Generic error in an external library Error while processing the decoded data for stream #0:0 }}} 2) /mnt/ProgSSD/FFmpeg/ffmpeg -threads 0 -hwaccel nvdec -c:v h264_cuvid -y -i "/mnt/ProgSSD/transcodeAVCHD/test/00005.MTS" -vf yadif_cuda,scale_npp=1280:-1 -c:v hevc_nvenc -preset slow -cq 10 -g 150 -c:a aac -b:a 128k -metadata:s:a:0 language=eng "/mnt/ProgSSD/transcodeAVCHD/test/test1.mp4" {{{ ffmpeg version N-93231-g96d79ff5b5 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8 (Ubuntu 8.2.0-7ubuntu1) configuration: --enable-libnpp --enable-nonfree --enable-cuda --enable- libx264 --enable-gpl --enable-nvenc --enable-libx265 --enable-cuda-sdk --enable-cuvid libavutil 56. 26.100 / 56. 26.100 libavcodec 58. 47.102 / 58. 47.102 libavformat 58. 26.101 / 58. 26.101 libavdevice 58. 6.101 / 58. 6.101 libavfilter 7. 48.100 / 7. 48.100 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 libpostproc 55. 4.100 / 55. 4.100 Input #0, mpegts, from '/mnt/ProgSSD/transcodeAVCHD/test/00005.MTS': Duration: 00:00:15.04, start: 1.033367, bitrate: 16837 kb/s Program 1 Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080 Stream mapping: Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> hevc (hevc_nvenc)) Stream #0:1 -> #0:1 (ac3 (native) -> aac (native)) Press [q] to stop, [?] for help Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0: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 }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by philipl): You would use nvdec with "-hwaccel nvdec -hwaccel_output_format cuda" and not specifying the input codec. nvdec is a proper hwaccel implementation while cuvid is a full decoder implementation using the nvidia parser. Not that I expect you to see different results in each case. As I said, the error doesn't really make sense - cuModuleLoadData should not fail, and certainly should not fail selectively. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by arrmo): Yes, agreed - makes sense, thanks! Please let me know if there is anything at all you want me to try here. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by arrmo): FYI, if I use the command noted above "-hwaccel nvdec -hwaccel_output_format cuda", and don't specify the input codec => then I get the same error as in case #1 (cuModuleLoadData(&s->cu_module, vf_yadif_cuda_ptx) failed -> CUDA_ERROR_UNKNOWN: unknown error) Thoughts? Thanks! -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by arrmo): Hi, OK, I got approach #1 working, but only with sudo in front of the command. Huh? ... ;-). cuvid requires sudo, but not nvdec? Thanks! -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by philipl): Sounds like you have incorrect permissions on your /dev/nvidia*. Set them to 666 and try again. Both should work, without sudo. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:9> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by arrmo): Seems to work with that fix, thanks!!! So to above, still a but confused about the difference between hwaccels (cuvid and nvdec) - they seem to be very similar, just different outputs ... and compatibility with those outputs is confusing (to say the least ... LOL). Is this explained / captured somewhere? Thanks again! -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:10> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by philipl): You can read [https://trac.ffmpeg.org/wiki/HWAccelIntro] for some details. The main difference is that `nvdec` implements a proper hwaccel that hooks into the primary ffmpeg decoders (like `dxva`, `vdpau`, `vaapi`, etc) while `cuvid` is a wrapper around a full decoder implementation from nvidia. That means it cannot take advantaging of any of ffmpeg's bitstream parsing or other features, which is a problem in some situations (eg: 10bit hdr will not decode correctly). On the other hand, `cuvid` provides access to nvidia's own deinterlacer and you don't need yadif_cuda. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:11> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: closed Priority: normal | Component: | undetermined Version: unspecified | Resolution: | worksforme Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by Balling): * status: new => closed * resolution: => worksforme Comment: Replying to [comment:10 arrmo]:
Seems to work with that fix, thanks!!!
Indeed. BTW, why zeranoe build are without --enable-cuda-llvm !!! It is not even in --enable-nonfree after https://github.com/FFmpeg/FFmpeg/commit/01994c93db43e50c01349203a76c0b7111d1... -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:12> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7753: yadif_cuda fails, with h264_cuvid decoder -------------------------------------+------------------------------------- Reporter: arrmo | Owner: Type: defect | Status: closed Priority: normal | Component: | undetermined Version: unspecified | Resolution: invalid Keywords: cuda | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by cehoyos): * resolution: worksforme => invalid -- Ticket URL: <https://trac.ffmpeg.org/ticket/7753#comment:13> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg