1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00
Go to file
Ico Doornekamp e3e6a2cff4 avformat/rtpdec_jpeg: fix low contrast image on low quality setting
Original mail and my own followup on ffmpeg-user earlier today:

I have a device sending out a MJPEG/RTP stream on a low quality setting.
Decoding and displaying the video with libavformat results in a washed
out, low contrast, greyish image. Playing the same stream with VLC results
in proper color representation.

Screenshots for comparison:

  http://zevv.nl/div/libav/shot-ffplay.jpg
  http://zevv.nl/div/libav/shot-vlc.jpg

A pcap capture of a few seconds of video and SDP file for playing the
stream are available at

  http://zevv.nl/div/libav/mjpeg.pcap
  http://zevv.nl/div/libav/mjpeg.sdp

I believe the problem might be in the calculation of the quantization
tables in the function create_default_qtables(), the attached patch
solves the issue for me.

The problem is that the argument 'q' is of the type uint8_t. According to the
JPEG standard, if 1 <= q <= 50, the scale factor 'S' should be 5000 / Q.
Because the create_default_qtables() reuses the variable 'q' to store the
result of this calculation, for small values of q < 19, q wil subsequently
overflow and give wrong results in the calculated quantization tables. The
patch below uses a new variable 'S' (same name as in RFC2435) with the proper
range to store the result of the division.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 15:40:10 +01:00
compat
doc avfilter/vf_waveform: add subsampling input support for remaining filters 2016-03-19 21:18:35 +01:00
libavcodec vc2enc: optimize and simplify quantization 2016-03-24 13:04:59 +00:00
libavdevice
libavfilter all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h 2016-03-22 10:15:31 -07:00
libavformat avformat/rtpdec_jpeg: fix low contrast image on low quality setting 2016-03-24 15:40:10 +01:00
libavresample
libavutil Refactor libavutil/parseutils.c 2016-03-24 03:38:12 +01:00
libpostproc
libswresample swresample/swresample: Remove "less than" comparissions of enums 2016-03-22 14:20:12 +01:00
libswscale sws/aarch64: add {nv12,nv21,yuv420p,yuv422p}_to_{argb,rgba,abgr,rgba}_neon 2016-03-01 17:53:33 +01:00
presets
tests fate: Add test that also decodes packed_bframes.avi 2016-03-23 20:28:28 +01:00
tools
.gitattributes
.gitignore fate: add audiomatch 2016-03-22 09:42:05 +01:00
.travis.yml
arch.mak
Changelog lavc: add AudioToolbox encoders 2016-03-22 12:43:14 -05:00
cmdutils_common_opts.h
cmdutils_opencl.c
cmdutils.c
cmdutils.h
common.mak
configure lavc: add AudioToolbox encoders 2016-03-22 12:43:14 -05:00
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
ffmpeg_dxva2.c
ffmpeg_filter.c
ffmpeg_opt.c ffmpeg: remove hardcoded 'now' creation_time support 2016-03-03 01:37:22 +01:00
ffmpeg_qsv.c
ffmpeg_vdpau.c ffmpeg_vdpau: Free ctx on error path 2016-03-03 16:41:11 +01:00
ffmpeg_videotoolbox.c
ffmpeg.c vp9: add superframe merging bitstream filter. 2016-03-11 11:19:14 -05:00
ffmpeg.h
ffplay.c ffplay: remove redundant silence buffer 2016-03-22 00:04:21 +01:00
ffprobe.c
ffserver_config.c
ffserver_config.h
ffserver.c ffserver: Fixed ffserver to support large ffm files 2016-03-08 11:39:29 +01:00
INSTALL.md
library.mak
LICENSE.md LICENSE: Thorough editing 2016-02-28 08:19:44 -08:00
MAINTAINERS lavc: add h264 mediacodec decoder 2016-03-07 11:28:29 +01:00
Makefile fate: add audiomatch 2016-03-22 09:42:05 +01:00
README.md
RELEASE
version.sh version.sh: Fix spurious rebuilds. 2016-03-10 09:53:10 +01:00

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • ffserver is a multimedia streaming server for live broadcasts.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process. Few developers follow pull requests so they will likely be ignored.