Opened 3 years ago

Closed 3 years ago

#2267 closed defect (duplicate)

contrast loss when encoding from h264 yuvj420p to mpeg4 yuv420p

Reported by: sperate Owned by:
Priority: normal Component: swscale
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When trying to encode from ".mov" files from a camera to avi (mpeg4 or libxvid) the output movie colors seemed dull.
I figured out it was a catrast loss.

How to reproduce:

% ffmpeg -i input.MOV -b:v4000k output.AVI
or
% ffmeg -i input.MOV -b:v4000k -vcodec libxvid output.AVI

ffmpeg version N-49610-gc2dd5a1 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb  5 2013 13:20:59 with gcc 4.7.2 (GCC)

running on Windows XP

I get rid of the problem by trying to enhance the contrast with

-vf mp=eq=0:5

then figured out that just using the mplayer filter without modifing the contrast gave the best result

-vf mp=eq=0:0

It seems to be a color space problem fixed with this filter but there must be a better way of getting rid of this contrast loss ???

Attachments (5)

exemple.rar (1.9 MB) - added by sperate 3 years ago.
example_input.MOV (2.0 MB) - added by sperate 3 years ago.
example_output_dull.AVI (1001.7 KB) - added by sperate 3 years ago.
example_output_mpfilter.AVI (1000.5 KB) - added by sperate 3 years ago.
example.png (825.2 KB) - added by sperate 3 years ago.

Change History (10)

comment:1 Changed 3 years ago by sperate

  • Cc sperate@free.fr added
  • Version changed from 1.1.2 to git-master

comment:2 Changed 3 years ago by cehoyos

  • Cc sperate@free.fr removed
  • Component changed from FFmpeg to undetermined
  • Keywords contrast loss removed
  • Priority changed from important to normal

Please provide your failing command line together with complete, uncut console output (if the problem is reproducible without using external libraries, please do not use them) and please provide (or point to) a sample.

Changed 3 years ago by sperate

Changed 3 years ago by sperate

Changed 3 years ago by sperate

Changed 3 years ago by sperate

comment:3 Changed 3 years ago by sperate

I've attached the video files and also a picture of the problem as seen on my screen.

How i've obtained them :

E:\Images\ARCHIVE\éolienne-piggott\Videos\exemple>ffmpeg -i example_input.MOV -b:v 4000k example_output_dull.AVI
ffmpeg version N-49610-gc2dd5a1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  5 2013 13:20:59 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --e
nable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-
libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 35.101 /  3. 35.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example_input.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf54.61.104
  Duration: 00:00:01.70, start: 0.000000, bitrate: 10027 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 640x480, 10023 kb/s, 30 fps, 30 tbr, 12k tbn, 24k tbc
    Metadata:
      handler_name    : DataHandler
Output #0, avi, to 'example_output_dull.AVI':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    ISFT            : Lavf54.61.104
    Stream #0:0(eng): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480, q=2-31, 4000 kb/s, 30 tbn, 30 tbc
    Metadata:
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
Press [q] to stop, [?] for help
frame=   51 fps=0.0 q=3.5 Lsize=    1002kB time=00:00:01.70 bitrate=4827.0kbits/s
video:995kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.680308%



E:\Images\ARCHIVE\éolienne-piggott\Videos\exemple>ffmpeg -i example_input.MOV -vf mp=eq=0:0 -b:v 4000k example_output_mpfilter.AVI
ffmpeg version N-49610-gc2dd5a1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  5 2013 13:20:59 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --e
nable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-
libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 35.101 /  3. 35.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example_input.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf54.61.104
  Duration: 00:00:01.70, start: 0.000000, bitrate: 10027 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 640x480, 10023 kb/s, 30 fps, 30 tbr, 12k tbn, 24k tbc
    Metadata:
      handler_name    : DataHandler
[Parsed_mp_0 @ 026199e0] 'eq' is a wrapped MPlayer filter (libmpcodecs). This filter may be removed
once it has been ported to a native libavfilter.
Output #0, avi, to 'example_output_mpfilter.AVI':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    ISFT            : Lavf54.61.104
    Stream #0:0(eng): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480, q=2-31, 4000 kb/s, 30 tbn, 30 tbc
    Metadata:
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
Press [q] to stop, [?] for help
frame=   51 fps=0.0 q=3.8 Lsize=    1000kB time=00:00:01.70 bitrate=4821.2kbits/s
video:994kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.681429%

Same thing happens when using the libxvid codec instead of mpeg4.

Version 1, edited 3 years ago by sperate (previous) (next) (diff)

Changed 3 years ago by sperate

comment:4 Changed 3 years ago by richardpl

  • Component changed from undetermined to swscale

comment:5 Changed 3 years ago by richardpl

  • Resolution set to duplicate
  • Status changed from new to closed

duplicate of #225.

Note: See TracTickets for help on using tickets.