[FFmpeg-devel] MJPG decoder picture quality

Pavel Pavlov pavel
Tue Jun 8 21:46:16 CEST 2010


I use libavcodec's jpeg decoder and I noticed that some pictures weren't looking good. Knowing that these pictures were meant to be very high quality, I decided to check out what was wrong.
I couldn't find anything wrong, other that the fact that pictures that come out of libavcodec's MJPG decoder don't looks as good as they are supposed to.
As a simple test I took a picture that comes from win7 install : 
http://dev5.summit-tech.ca/pps/ffmpeg/Tulips.jpg
Here's how this picture gets decoded by ffmpeg:
http://dev5.summit-tech.ca/pps/ffmpeg/Tulips_yuv444.png
Here's doubled pixel compare image:
http://dev5.summit-tech.ca/pps/ffmpeg/Tulips_compare_200.png (On the left, regular windows image viewer, on the right is MJPG from libavcodec)

I also saved raw yuv444: http://dev5.summit-tech.ca/pps/ffmpeg/Tulips_1024x768.yuv.bin
Seems that ffplay can't open raw images (would be useful for development purposes), so I use yay.exe that can view raw yuv images: http://dev5.summit-tech.ca/pps/ffmpeg/yay.exe

I checked out latest svn (the version I'm using is like a month old), and I noticed this new comment:
PIX_FMT_YUVJ444P ... , full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
So, I thought it could have been fixed, and tried latest svn. Instead it didn't work at all now: av_find_stream_info returns -1 and there is message: ffmpeg:  24: Could not find codec parameters (Video: mjpeg, yuv420p)
Also, I wasn't able to find any info on how to set that color_range



More information about the ffmpeg-devel mailing list