jocover / jetson-ffmpeg

ffmpeg support on jetson nano
Other
611 stars 196 forks source link

Decoding AV_PIX_FMT_YUVJ420P produces incorrect colors in image #68

Open prophetzopu opened 3 years ago

prophetzopu commented 3 years ago

Hello,

I am using jetson-ffmpeg with ffmpeg 4.2.1 on a Jetson AGX Xavier running JetPack 4.3. My inputs are RTSP and RTMP streams in AV_PIX_FMT_YUVJ420P format. The decoder claims to be decoding to AV_PIX_FMT_YUV420P format with color_range AVCOL_RANGE_JPEG (full range 0-255).

It looks like high and low ranges are being clipped. Here are histogram dumps of what I am seeing:

Raw image histogram raw histogram

Software decode histogram (histogram obtained after dumping image to JPEG) preview software decode histogram

Hardware decode histogram (histogram obtained after dumping image to JPEG) preview hardware decode histogram

Thoughts/suggestions?

This project has been great so far. Thank you for your time!

mhm0902 commented 3 years ago

How to support yuvj420 decoding?thank you!

grantthomas commented 3 years ago

How to support yuvj420 decoding?thank you!

https://github.com/jocover/jetson-ffmpeg/issues/83 https://github.com/jocover/jetson-ffmpeg/issues/80

When I apply the advice in issue 83, I can use yuvj420p, but transcoding to mp4 containers hangs ffmpeg. When I apply the advice in issue 80, I can transcode to mp4 ffmpeg, but yuvj420p doen't work.

I'm sure there's a combo of commits that makes it all work.