[FFmpeg-devel] MJPG decoder picture quality

Pavel Pavlov pavel
Wed Jun 9 02:04:19 CEST 2010


> -----Original Message-----
> bounces at mplayerhq.hu] On Behalf Of Michael Niedermayer
> > 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
> 
> you need -sws_flags +accurate_rnd+full_chroma_int the scalers defaults are
> tuned a bit toward realtime speed for video decoding.
> This may arguably be something we should change for ffmpeg, iam not sure ...
> 

 [Pavel Pavlov] 
I use libavcodec, not the ffmpeg cmd line app.


> 
> > 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
> 
> -f rawvideo -pix_fmt yuv444p -s 1024x768 or something like that
> 

[Pavel Pavlov] 
I tried: ffplay -f rawvideo Tulips_1024x768.yuv.bin -pix_fmt yuv444p -s 1024x768
It didn't work (window is just a black square).

Here's the putput:
C:\work\summit\SIP\Extra\ffmpeg\bin>ffplay -f rawvideo Tulips_1024x768.yuv.bin -pix_fmt yuv444p -s 1024x768
FFplay version SVN-r20069, Copyright (c) 2003-2010 the FFmpeg developers
  built on Jun  8 2010 19:40:07 with icl 1110
  configuration: icl v.1110 build
  libavutil     50.18. 0 / 50.18. 0
  libavcodec    52.75. 1 / 52.75. 1
  libavformat   52.68. 0 / 52.68. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[rawvideo @ 01195850]Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'Tulips_1024x768.yuv.bin':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: rawvideo, yuv444p, 1024x768, 25 tbr, 25 tbn, 25 tbc
[ffplay_output @ 0321DD30]auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 03255F60]w:1024 h:768 fmt:yuv444p -> w:1024 h:768 fmt:yuv420p flags:0x4
  16.61 A-V:  0.000 s:0.0 aq=    0KB vq=    0KB sq=    0B f=0/0   f=0/0


> 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)

I use libavcodec and I read directly from http that's why I get that error.
ffmpeg -i http://dev5.summit-tech.ca/pps/ffmpeg/Tulips.jpg test%d.png gives the same error, therefore the new changes in http code broke reader



More information about the ffmpeg-devel mailing list