Hardware-Cuda-Decodierungsfehler

Bitte sehen Sie sich meine Eingabe-UDP-Stream-Informationen an:

ffprobe udp://IP:PORT

Input #0, mpegts, from 'udp://IP:PORT':
  Duration: N/A, start: 29796.225911, bitrate: N/A
  Program 16
    Stream #0:3[0x641]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:5[0x642](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
  Program 39
    Stream #0:7[0xf3d]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:8[0xf3e](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
  Program 11
    Stream #0:2[0x13ed]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:6[0x13ee](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
  Program 3
    Stream #0:9[0x10ce]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:4[0x10cf](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 96 kb/s
  Program 1
    Stream #0:0[0x1006]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1007](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s

Ich möchte den Videostream (Stream #0:0[0x1006]) mit der Programm-ID 1 decodieren
und mache dies mit dem folgenden Befehl:

ffmpeg -analyzeduration 2G -probesize 11M -y -hwaccel cuvid -c:v h264_cuvid -i udp://IP:PORT -map 0:#0x1006 -f rawvideo cuda_decoded.yuv

Bitte sehen Sie sich das Protokoll an:

[mpegts @ 0x2351d60] decoding for stream 0 failed
Input #0, mpegts, from 'udp://IP:PORT':
  Duration: N/A, start: 30271.455156, bitrate: N/A
  Program 16
    Stream #0:5[0x641]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:6[0x642](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
  Program 39
    Stream #0:2[0xf3d]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:4[0xf3e](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
  Program 11
    Stream #0:3[0x13ed]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:8[0x13ee](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
  Program 3
    Stream #0:7[0x10ce]: Video: h264 ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 16:15 DAR 4:3], 26.17 fps, 2.08 tbr, 90k tbn, 50 tbc
    Stream #0:9[0x10cf](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 96 kb/s
  Program 1
    Stream #0:0[0x1006]: Video: h264 ([2][0][0][0] / 0x0002), yuvj420p(pc, progressive), 16x32, 2.08 fps, 2.08 tbr, 90k tbn, 2514.04 tbc
    Stream #0:1[0x1007](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
[h264_cuvid @ 0x240ca20] ctx->cvdl->cuvidCreateDecoder(&cudec, &cuinfo) failed -> CUDA_ERROR_INVALID_VALUE: invalid argument
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> rawvideo (native))
Error while opening decoder for input stream #0:0 : Generic error in an external library

Auch ich kann es ohne Probleme mit dem nächsten Befehl decodieren:

ffmpeg -analyzeduration 2G -probesize 11M -y -i udp://IP:PORT -map 0:#0x1006 -f rawvideo -pix_fmt yuv420p software_decoded.yuv

Dieses Problem betrifft nur einige Eingabestreams.

Haben Sie eine Idee, warum dieses Problem auftritt, und irgendwelche Empfehlungen, wie es behoben werden kann?

Versuchen Sie, das zu entfernen, -hwaccel cuvidund kommentieren Sie es zurück, wenn das funktioniert (vorerst als Test).

Antworten (2)

Stream 0 ist Stream #0:0[0x1006]: Video: mpeg2videofür das, was Sie brauchen-c:v mpeg2_cuvid

Es ist ein Fehler in ffmpeg. Wenn Sie explizit einen Typ der HW-Beschleunigung angeben (z. B. cuvid), weist ffmpeg 0 zu CUVIDDECODECREATEINFO::ulNumDecodeSurfacesund zu CUVIDDECODECREATEINFO::ulNumOutputSurfaces. Folglich schlägt ein Aufruf von cuvidCreateDecoder fehl, da NVDEC keine Oberflächen hat, um dekodierte Bilder auszugeben.