1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00
Go to file
Ico Doornekamp e112096885 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>
(cherry picked from commit e3e6a2cff4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-28 03:47:13 +02:00
compat compat/os2threads: Check av_malloc() return code 2015-06-02 15:16:45 +02:00
doc avformat/concatdec: set safe mode to enabled instead of auto 2016-04-28 03:47:13 +02:00
libavcodec avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored 2016-04-28 03:47:13 +02:00
libavdevice doc: avoid incorrect phrase 'allows to' 2015-06-19 20:31:44 +02:00
libavfilter avfilter/vf_scale: set proper out frame color range 2016-01-15 16:00:31 +01:00
libavformat avformat/rtpdec_jpeg: fix low contrast image on low quality setting 2016-04-28 03:47:13 +02:00
libavresample Merge commit 'd68c05380cebf563915412182643a8be04ef890b' 2015-06-01 00:22:47 +02:00
libavutil avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool 2016-04-28 03:47:13 +02:00
libpostproc postproc: fix unaligned access 2016-04-28 03:47:12 +02:00
libswresample swresample/swresample: Fix integer overflow in seed calculation 2015-11-12 02:55:46 +01:00
libswscale swscale/utils: Fix chrSrcHSubSample for GBRAP16 2016-04-28 03:47:12 +02:00
presets presets: remove moldering iPod presets 2014-06-17 16:15:04 -08:00
tests avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay 2016-04-28 03:47:13 +02:00
tools tools/graph2dot: use larger data types than int for array/string sizes 2015-05-12 04:01:25 +02:00
.gitattributes Treat all '*.pnm' files as non-text file 2014-11-28 17:52:43 -05:00
.gitignore doc/examples: add directory listing example 2015-03-28 03:13:44 +01:00
arch.mak Merge commit 'eecd29b3fd7fee221580798346d6582b75c7ade4' 2015-05-31 23:42:36 +02:00
Changelog Update for 2.7.6 2016-01-31 00:42:09 +01:00
cmdutils_common_opts.h opts: add list device sources/sinks options 2014-10-25 20:20:31 +02:00
cmdutils_opencl.c OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c 2015-04-28 12:18:23 +02:00
cmdutils.c cmdutils: Fix sign error in display matrix auto-rotation code 2015-05-18 02:07:34 +02:00
cmdutils.h ffplay&cmdutils:Factor get_rotation() code out 2015-05-03 23:49:16 +02:00
common.mak x86: Makefile: fix DBG parameter evaluation 2015-03-11 01:54:07 +01:00
configure configure: bump copyright year to 2016 2016-01-15 16:26:06 +01:00
COPYING.GPLv2
COPYING.GPLv3 Add configure option to upgrade (L)GPL to version 3. 2009-06-05 11:04:03 +00:00
COPYING.LGPLv2.1 cosmetics: Delete empty lines at end of file. 2012-02-09 12:26:45 +01:00
COPYING.LGPLv3 Add configure option to upgrade (L)GPL to version 3. 2009-06-05 11:04:03 +00:00
CREDITS CREDITS: redirect to Git log, remove current outdated content 2013-01-31 18:02:52 +01:00
ffmpeg_dxva2.c ffmpeg_dxva2: call GetDesktopWindow() in place of GetShellWindow() 2015-06-03 16:25:08 +02:00
ffmpeg_filter.c ffmpeg_filter: use get_rotation() 2015-05-04 00:14:36 +02:00
ffmpeg_opt.c ffmpeg_opt: Fix forcing fourccs 2015-07-05 23:08:21 +02:00
ffmpeg_vda.c vda: unlock the pixel buffer base address. 2015-07-18 20:23:45 +02:00
ffmpeg_vdpau.c Merge commit '1f9237f2ac46dfbed1bfa1f4f0f1314c2a1d62ec' 2014-12-27 13:26:38 +01:00
ffmpeg.c ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format. 2015-11-12 02:55:47 +01:00
ffmpeg.h ffmpeg: Do not copy the display matrix if rotation meta-data is manually added 2015-05-18 00:52:36 +02:00
ffplay.c ffplay: use av_clip() instead of nested min & max 2015-06-06 13:18:28 +02:00
ffprobe.c ffprobe: print stream_index with frame data 2015-05-27 11:19:19 +02:00
ffserver_config.c ffserver: Use singlejpeg muxer for jpeg 2015-06-08 03:36:22 +02:00
ffserver_config.h ffserver: Use singlejpeg muxer for jpeg 2015-06-08 03:36:22 +02:00
ffserver.c ffserver: Use singlejpeg muxer for jpeg 2015-06-08 03:36:22 +02:00
INSTALL.md INSTALL: add markdown syntax 2014-05-28 22:38:38 +02:00
library.mak library.mak: Workaround SDL redefining main and breaking fate tests on mingw 2015-06-26 16:22:54 -03:00
LICENSE.md LICENSE.md: add *_rect filters 2015-05-03 01:43:30 +02:00
MAINTAINERS MAINTAINERS: add myself as an OS/2 maintainer 2016-04-28 03:47:12 +02:00
Makefile makefile: add Loongson-3 support 2015-04-27 14:10:28 +02:00
README.md README: add ffserver 2015-02-12 11:59:22 +01:00
RELEASE Update for 2.7.6 2016-01-31 00:42:09 +01:00
RELEASE_NOTES add RELEASE_NOTES, based on previous 2015-06-09 23:36:06 +02:00
version.sh version.sh: Print versions based on the last git tag for release branches 2014-07-28 15:44:59 +02: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.