Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8442 closed defect (fixed)

CUDA mpeg2-decode issue (hwaccel)

Reported by: barhom Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: cuda
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

The new CUDA HW mpeg2 decoder is producing bad and pixelated decoding on some video.
The legacy CUVID mpeg2_cuvid decoder is producing expected output.

The testing has been made with a NVIDIA GTX 1050 Ti GPU with Driver version 440.31 and Cuda 10.2.
FFmpeg version used: git-2019-11-13-a7245ad

How to reproduce:

Bad output:

ffmpeg -y -hwaccel cuda -i "/tmp/original_cut.ts" -c:v h264_nvenc -c:a aac -b:a:0 64k  -f mpegts /tmp/mpeg2_cuda_decode.ts

Good output:

ffmpeg -y -hwaccel cuvid -c:v mpeg2_cuvid -i "/tmp/original_cut.ts" -c:v h264_nvenc -c:a aac -b:a:0 64k  -f mpegts /tmp/mpeg2_cuvid_legacy_decode.ts

I have attached "original_cut.ts" for you to be able to reproduce this issue.
Also attached the output when running the commands on my system.

Attachments (4)

original_cut.ts (1.8 MB ) - added by barhom 4 years ago.
mpeg2_cuvid_legacy_decode.ts (1.5 MB ) - added by barhom 4 years ago.
The good output
mpeg2_cuda_decode.ts (1.5 MB ) - added by barhom 4 years ago.
The bad output
debug-mpeg2_cuda_decode.ts.txt (277.0 KB ) - added by barhom 4 years ago.
Console output CUDA

Change History (9)

by barhom, 4 years ago

Attachment: original_cut.ts added

by barhom, 4 years ago

The good output

by barhom, 4 years ago

Attachment: mpeg2_cuda_decode.ts added

The bad output

comment:1 by Carl Eugen Hoyos, 4 years ago

Which commit introduced the regression?
Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket.

in reply to:  1 comment:2 by barhom, 4 years ago

Replying to cehoyos:

Which commit introduced the regression?
Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket.

I cannot say which commit introduced this. Maybe this bug has been here all along.
I attached the uncut console output when using the "bad" CUDA output.

I also tried to use this on todays git commit git-2019-12-26-b0d0d7e.

Last edited 4 years ago by barhom (previous) (diff)

by barhom, 4 years ago

Console output CUDA

comment:3 by barhom, 4 years ago

Additional information in case it was not understood:
The encoder makes no difference. You can encode using libx264,h264_nvenc or any other encoder.

The problem arises only from the choice of decoder (before the -i)

comment:4 by barhom, 4 years ago

Resolution: fixed
Status: newclosed

Commit d4996a600ca0334235a4b66beae5b5c3474535c4 and 12c4d00c10cb73f1976c8de5b23b1405803bd454 fix this issue.

The patch was posted way back in 2017,
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20170921032609.26242-1-zhong.li@intel.com/

I guess as discussed in #ffmpeg-devel nobody cared enough about mpeg2-hw decoding.

Last edited 4 years ago by Carl Eugen Hoyos (previous) (diff)

comment:5 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavcodec
Keywords: cuda added
Version: unspecifiedgit-master
Note: See TracTickets for help on using tickets.