Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noise when decoding hevc yuv420p10le videos with device="cuda" #598

Open
hanchchch opened this issue Mar 26, 2025 · 1 comment
Open

noise when decoding hevc yuv420p10le videos with device="cuda" #598

hanchchch opened this issue Mar 26, 2025 · 1 comment

Comments

@hanchchch
Copy link

🐛 Describe the bug

when I try to decode videos with pixel format yuv420p10le like below,

# ffprobe result
  Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709/bt709/unknown), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn (default)
# decoding script
decoder = VideoDecoder("./test.mp4", device="cuda")
frames = decoder.get_frames_in_range(0, 100)

cv2.imwrite("frame.png", frames.data.permute(0, 2, 3, 1).cpu().numpy()[0])

decoded frames appears like this, with full of noise:

Image

but with h264 yuv420p videos or if I use cpu decoding it works fine.

  Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x816 [SAR 1:1 DAR 40:17], 23.98 fps, 23.98 tbr, 1k tbn (default)

why is this happening?

Versions

0.2.1

@haixuanTao
Copy link

haixuanTao commented Apr 12, 2025

I'm not super familiar with torch codec but it seems that the bitdepth is hardcoded as uint8 (#585) and so trying with yuv420p10le (10bit) encoding should result in either reading 2 pixels over one or truncation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants