Opened 10 years ago
Closed 7 years ago
#3831 closed defect (fixed)
conversion to bgr8 does not work correctly for some resolutions
Reported by: | Chillance | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | swscale |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Well, basically I'm trying to convert a movie to an animated gif. I love that it's as easy as:
ffmpeg -i movie_to_be_animated.mp4 output.gif
However, using 1.x branch the colors aren't as good:
http://pastebin.com/qWkNPrKP - this works, but colors aren't as good. especially with fading, and the file is huge (17MB).
I prefer this:
http://pastebin.com/hrpaavJT
However, as you can see in the attatched file, there is a flickering going on on the right there. And this is what this ticket is about. Why is that happening?
Change History (7)
comment:1 by , 10 years ago
Component: | undetermined → avcodec |
---|---|
Keywords: | gif added |
Reproduced by developer: | set |
Status: | new → open |
Summary: | Slight right line flickering when converting to animated .gif → gif encoder uses uninitialized memory for some resolutions |
Version: | 2.3 → git-master |
comment:2 by , 10 years ago
Component: | avcodec → swscale |
---|---|
Keywords: | regression added |
Priority: | normal → important |
Summary: | gif encoder uses uninitialized memory for some resolutions → conversion to bgr8 does not work correctly for some resolutions |
Not gif related:
$ ffmpeg -i fate-suite/svq3/Vertical400kbit.sorenson3.mov -s 214x214 -qscale 2 -an out.mov
$ ffmpeg -i out.mov -pix_fmt bgr8 -f rawvideo out ffmpeg version N-65368-g7c73d21 Copyright (c) 2000-2014 the FFmpeg developers built on Aug 7 2014 10:00:38 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl libavutil 52. 98.100 / 52. 98.100 libavcodec 55. 73.100 / 55. 73.100 libavformat 55. 52.100 / 55. 52.100 libavdevice 55. 13.102 / 55. 13.102 libavfilter 4. 11.102 / 4. 11.102 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 19.100 / 0. 19.100 libpostproc 52. 3.100 / 52. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mov': Metadata: major_brand : qt minor_version : 512 compatible_brands: qt artist : Logan Kelsey artist-eng : Logan Kelsey title : Vertical Online SV3 Demo title-eng : Vertical Online SV3 Demo encoder : Lavf55.52.100 copyright : © Vertical Online 2001 copyright-eng : © Vertical Online 2001 Duration: 00:00:43.60, start: 0.000000, bitrate: 697 kb/s Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 214x214 [SAR 1:1 DAR 1:1], 696 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (default) Metadata: handler_name : DataHandler encoder : Lavc55.73.100 mpeg4 [swscaler @ 0x3361520] No accelerated colorspace conversion found from yuv420p to bgr8. Output #0, rawvideo, to 'out': Metadata: major_brand : qt minor_version : 512 compatible_brands: qt artist : Logan Kelsey artist-eng : Logan Kelsey title : Vertical Online SV3 Demo title-eng : Vertical Online SV3 Demo copyright-eng : © Vertical Online 2001 copyright : © Vertical Online 2001 encoder : Lavf55.52.100 Stream #0:0(eng): Video: rawvideo (BGR[8] / 0x8524742), bgr8, 214x214 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default) Metadata: handler_name : DataHandler encoder : Lavc55.73.100 rawvideo Stream mapping: Stream #0:0 -> #0:0 (mpeg4 (native) -> rawvideo (native)) Press [q] to stop, [?] for help frame= 1308 fps=0.0 q=0.0 Lsize= 58497kB time=00:00:43.60 bitrate=10991.0kbits/s video:58497kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Decoding the output file shows artefacts on the right border.
comment:3 by , 10 years ago
Keywords: | regression removed |
---|---|
Priority: | important → normal |
Not really a regression, the border used to be initialized though.
comment:5 by , 10 years ago
[19:55] <Chillance> so, what is going on with https://trac.ffmpeg.org/ticket/3831 ?
Sorry, I wasn't aware you are searching for a workaround - in this case, it would have been better to report to the ffmpeg-user mailing list.
The issue is not reproducible if you actually scale, the following is an example command line, many others are possible:
$ ffmpeg -i movie_to_be_animated.mp4 -vf super2xsai,scale=w=iw/2:h=ih/2 out.gif
Note that if you look at my examples, it was always necessary to create an input video with the right resolution first because scaling "fixes" the issue.
comment:6 by , 10 years ago
Ok, so that works, but means I had to redo the mp4 file, so I could scale it down. But hey, it works! Thanks!
comment:7 by , 7 years ago
Keywords: | gif removed |
---|---|
Resolution: | → fixed |
Status: | open → closed |
Fixed in 3d00ba2688f69a55ed2832349b802997bef7f876, duplicate of ticket #2570.
For future tickets:
Please test current FFmpeg git head before reporting problems, always provide the
ffmpeg
command line that allows to reproduce the issue together with the complete uncut console output, do not attach output files unless explicitely asked to and please do not attach compressed files (unless necessary).out.gif looks ugly.