Opened 2 years ago

Closed 2 years ago

#10005 closed defect (invalid)

ffmpeg creates different output when jpeg file does not have a .jpg extension

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

Description

Summary of the bug:
When this jpeg IMG does not have a .jpg extension the output gif flickers between 2 frames. One of the frames looks like an x-ray image.

If the same file has a .jpg extension the output gif works as expected.

How to reproduce:
ffmpeg_g -v 9 -loglevel 99 -i IMG -f gif -y bad.gif

vs.
ffmpeg_g -v 9 -loglevel 99 -i IMG.jpg -f gif -y good.gif

OUTPUT of: ffmpeg_g -v 9 -loglevel 99 -i IMG -f gif -y bad.gif

ffmpeg version N-108912-g2537fdc510 Copyright (c) 2000-2022 the FFmpeg developers

built with gcc 12 (Debian 12.2.0-3)
configuration: --pkg-config-flags=--static --extra-libs='-lpthread -lm' --enable-gpl --enable-gnutls --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libvpx --enable-libvpx --enable-libx264 --enable-nonfree
libavutil 57. 40.100 / 57. 40.100
libavcodec 59. 51.101 / 59. 51.101
libavformat 59. 34.101 / 59. 34.101
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 49.101 / 8. 49.101
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
libpostproc 56. 7.100 / 56. 7.100

Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input url with argument 'IMG'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'gif'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'bad.gif' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url IMG.
Successfully parsed a group of options.
Opening an input file: IMG.
[NULL @ 0x55f210e9e9c0] Opening 'IMG' for reading
[file @ 0x55f210e9f1c0] Setting default whitelist 'file,crypto,data'
Probing mp3 score:1 size:2048
Probing jpeg_pipe score:7 size:2048
Probing mp3 score:1 size:4096
Probing jpeg_pipe score:7 size:4096
Probing jpeg_pipe score:7 size:8192
Probing jpeg_pipe score:26 size:16384
[jpeg_pipe @ 0x55f210e9e9c0] Format jpeg_pipe probed with size=16384 and score=26
[jpeg_pipe @ 0x55f210e9e9c0] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:1
[mjpeg @ 0x55f210ea0200] marker=d8 avail_size_in_buf=1598395
[mjpeg @ 0x55f210ea0200] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x55f210ea0200] marker=e0 avail_size_in_buf=1598393
[mjpeg @ 0x55f210ea0200] marker parser used 19 bytes (152 bits)
[mjpeg @ 0x55f210ea0200] marker=e1 avail_size_in_buf=1598371
[mjpeg @ 0x55f210ea0200] marker parser used 11071 bytes (88568 bits)
[mjpeg @ 0x55f210ea0200] marker=e1 avail_size_in_buf=1587297
[mjpeg @ 0x55f210ea0200] marker parser used 1524 bytes (12192 bits)
[mjpeg @ 0x55f210ea0200] marker=e2 avail_size_in_buf=1585770
[mjpeg @ 0x55f210ea0200] marker parser used 87 bytes (696 bits)
[mjpeg @ 0x55f210ea0200] marker=e2 avail_size_in_buf=1585680
[mjpeg @ 0x55f210ea0200] marker parser used 564 bytes (4512 bits)
[mjpeg @ 0x55f210ea0200] marker=db avail_size_in_buf=1585114
[mjpeg @ 0x55f210ea0200] index=0
[mjpeg @ 0x55f210ea0200] qscale[0]: 0
[mjpeg @ 0x55f210ea0200] index=1
[mjpeg @ 0x55f210ea0200] qscale[1]: 1
[mjpeg @ 0x55f210ea0200] marker parser used 132 bytes (1056 bits)
[mjpeg @ 0x55f210ea0200] marker=dd avail_size_in_buf=1584980
[mjpeg @ 0x55f210ea0200] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x55f210ea0200] marker=c0 avail_size_in_buf=1584974
[mjpeg @ 0x55f210ea0200] Changing bps from 0 to 8
[mjpeg @ 0x55f210ea0200] sof0: picture: 3024x4032
[mjpeg @ 0x55f210ea0200] component 0 2:2 id: 1 quant:0
[mjpeg @ 0x55f210ea0200] component 1 1:1 id: 2 quant:1
[mjpeg @ 0x55f210ea0200] component 2 1:1 id: 3 quant:1
[mjpeg @ 0x55f210ea0200] pix fmt id 22111100
[mjpeg @ 0x55f210ea0200] Format yuvj420p chosen by get_format().
[mjpeg @ 0x55f210ea0200] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x55f210ea0200] marker=c4 avail_size_in_buf=1584955
[mjpeg @ 0x55f210ea0200] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x55f210ea0200] escaping removed 2634 bytes
[mjpeg @ 0x55f210ea0200] marker=da avail_size_in_buf=1584535
[mjpeg @ 0x55f210ea0200] marker parser used 1581901 bytes (12655208 bits)
[mjpeg @ 0x55f210ea0200] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x55f210ea0200] decode frame unused 0 bytes
[jpeg_pipe @ 0x55f210e9e9c0] stream 0: start_time: NOPTS duration: NOPTS
[jpeg_pipe @ 0x55f210e9e9c0] format: start_time: NOPTS duration: NOPTS (estimate from bit rate) bitrate=0 kb/s
[jpeg_pipe @ 0x55f210e9e9c0] After avformat_find_stream_info() pos: 1635533 bytes read:1635533 seeks:0 frames:2
Input #0, jpeg_pipe, from 'IMG':

Duration: N/A, bitrate: N/A
Stream #0:0, 2, 1/25: Video: mjpeg (Baseline), 1 reference frame, yuvj420p(pc, bt470bg/unknown/unknown, center), 3024x4032 [SAR 300:300 DAR 3:4], 0/1, 25 fps, 25 tbr, 25 tbn

Successfully opened the file.
Parsing a group of options: output url bad.gif.
Applying option f (force format) with argument gif.
Successfully parsed a group of options.
Opening an output file: bad.gif.
[file @ 0x55f210ea3940] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:

Stream #0:0 -> #0:0 (mjpeg (native) -> gif (native))

Press [q] to stop, ? for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
EOF in input file 0
Terminating demuxer thread 0
[mjpeg @ 0x55f210eb32c0] marker=d8 avail_size_in_buf=1598395
[mjpeg @ 0x55f210eb32c0] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x55f210eb32c0] marker=e0 avail_size_in_buf=1598393
[mjpeg @ 0x55f210eb32c0] marker parser used 19 bytes (152 bits)
[mjpeg @ 0x55f210eb32c0] marker=e1 avail_size_in_buf=1598371
[mjpeg @ 0x55f210eb32c0] marker parser used 11071 bytes (88568 bits)
[mjpeg @ 0x55f210eb32c0] marker=e1 avail_size_in_buf=1587297
[mjpeg @ 0x55f210eb32c0] marker parser used 1524 bytes (12192 bits)
[mjpeg @ 0x55f210eb32c0] marker=e2 avail_size_in_buf=1585770
[mjpeg @ 0x55f210eb32c0] marker parser used 87 bytes (696 bits)
[mjpeg @ 0x55f210eb32c0] marker=e2 avail_size_in_buf=1585680
[mjpeg @ 0x55f210eb32c0] marker parser used 564 bytes (4512 bits)
[mjpeg @ 0x55f210eb32c0] marker=db avail_size_in_buf=1585114
[mjpeg @ 0x55f210eb32c0] index=0
[mjpeg @ 0x55f210eb32c0] qscale[0]: 0
[mjpeg @ 0x55f210eb32c0] index=1
[mjpeg @ 0x55f210eb32c0] qscale[1]: 1
[mjpeg @ 0x55f210eb32c0] marker parser used 132 bytes (1056 bits)
[mjpeg @ 0x55f210eb32c0] marker=dd avail_size_in_buf=1584980
[mjpeg @ 0x55f210eb32c0] restart interval: 189
[mjpeg @ 0x55f210eb32c0] marker parser used 4 bytes (32 bits)
[mjpeg @ 0x55f210eb32c0] marker=c0 avail_size_in_buf=1584974
[mjpeg @ 0x55f210eb32c0] sof0: picture: 3024x4032
[mjpeg @ 0x55f210eb32c0] component 0 2:2 id: 1 quant:0
[mjpeg @ 0x55f210eb32c0] component 1 1:1 id: 2 quant:1
[mjpeg @ 0x55f210eb32c0] component 2 1:1 id: 3 quant:1
[mjpeg @ 0x55f210eb32c0] pix fmt id 22111100
[mjpeg @ 0x55f210eb32c0] Format yuvj420p chosen by get_format().
[mjpeg @ 0x55f210eb32c0] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x55f210eb32c0] marker=c4 avail_size_in_buf=1584955
[mjpeg @ 0x55f210eb32c0] class=0 index=0 nb_codes=12
[mjpeg @ 0x55f210eb32c0] class=1 index=0 nb_codes=162
[mjpeg @ 0x55f210eb32c0] class=0 index=1 nb_codes=12
[mjpeg @ 0x55f210eb32c0] class=1 index=1 nb_codes=162
[mjpeg @ 0x55f210eb32c0] marker parser used 418 bytes (3344 bits)
[mjpeg @ 0x55f210eb32c0] escaping removed 2634 bytes
[mjpeg @ 0x55f210eb32c0] marker=da avail_size_in_buf=1584535
[mjpeg @ 0x55f210eb32c0] component: 1
[mjpeg @ 0x55f210eb32c0] component: 2
[mjpeg @ 0x55f210eb32c0] component: 3
[mjpeg @ 0x55f210eb32c0] marker parser used 1581900 bytes (12655195 bits)
[mjpeg @ 0x55f210eb32c0] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x55f210eb32c0] decode frame unused 0 bytes
detected 8 logical cores
[graph 0 input from stream 0:0 @ 0x55f2110ad100] Setting 'video_size' to value '3024x4032'
[graph 0 input from stream 0:0 @ 0x55f2110ad100] Setting 'pix_fmt' to value '12'
[graph 0 input from stream 0:0 @ 0x55f2110ad100] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x55f2110ad100] Setting 'pixel_aspect' to value '300/300'
[graph 0 input from stream 0:0 @ 0x55f2110ad100] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x55f2110ad100] w:3024 h:4032 pixfmt:yuvj420p tb:1/25 fr:25/1 sar:300/300
[format @ 0x55f2110ad940] Setting 'pix_fmts' to value 'rgb8|bgr8|rgb4_byte|bgr4_byte|gray|pal8'
[auto_scale_0 @ 0x55f2110af8c0] w:iw h:ih flags: interl:0
[format @ 0x55f2110ad940] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x55f2110a5940] query_formats: 4 queried, 3 merged, 1 already done, 0 delayed
[auto_scale_0 @ 0x55f2110af8c0] picking bgr8 out of 6 ref:yuvj420p alpha:0
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2110be9c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2110be9c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2110ffc40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2110ffc40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f21113f1c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f21113f1c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f21117e740] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f21117e740] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2111bdcc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2111bdcc0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2111fd240] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2111fd240] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f21123c7c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f21123c7c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f21127bd40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f21127bd40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2112bb2c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110b0d80] [swscaler @ 0x55f2112bb2c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[auto_scale_0 @ 0x55f2110af8c0] w:3024 h:4032 fmt:yuvj420p sar:300/300 -> w:3024 h:4032 fmt:bgr8 sar:1/1 flags:0x0
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f2110d06c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f2110d06c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f211104380] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f211104380] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f2111c2180] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f2111c2180] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f211128cc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f211128cc0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f21116ccc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f21116ccc0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f2111f5ac0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f2111f5ac0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f211213840] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f211213840] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f211269e00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f211269e00] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f2112b1ac0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110be9c0] [swscaler @ 0x55f2112b1ac0] No accelerated colorspace conversion found from yuv420p to bgr8.
[auto_scale_0 @ 0x55f2110af8c0] w:3024 h:4032 fmt:yuvj420p sar:300/300 -> w:3024 h:4032 fmt:bgr8 sar:1/1 flags:0x0
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21127fc40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21127fc40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2110e6a40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2110e6a40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2111a4880] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2111a4880] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f211125d40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f211125d40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21115f300] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21115f300] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2111e3dc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2111e3dc0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21121d380] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21121d380] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21125c900] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21125c900] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2112bf680] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2112bf680] No accelerated colorspace conversion found from yuv420p to bgr8.
[auto_scale_0 @ 0x55f2110af8c0] w:3024 h:4032 fmt:yuvj420p sar:300/300 -> w:3024 h:4032 fmt:bgr8 sar:1/1 flags:0x0
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21127fc40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21127fc40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2110e6a40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2110e6a40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2111a4880] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2111a4880] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f211125d40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f211125d40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21115f300] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21115f300] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2111e3dc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2111e3dc0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21121d380] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21121d380] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21125c900] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f21125c900] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2112bf680] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55f2110d06c0] [swscaler @ 0x55f2112bf680] No accelerated colorspace conversion found from yuv420p to bgr8.
[auto_scale_0 @ 0x55f2110af8c0] w:3024 h:4032 fmt:yuvj420p sar:300/300 -> w:3024 h:4032 fmt:bgr8 sar:1/1 flags:0x0
Output #0, gif, to 'bad.gif':

Metadata:

encoder : Lavf59.34.101

Stream #0:0, 0, 1/100: Video: gif, 1 reference frame, bgr8(pc, gbr/unknown/unknown, progressive, center), 3024x4032 (0x0) [SAR 1:1 DAR 3:4], 0/1, q=2-31, 200 kb/s, 25 fps, 100 tbn

Metadata:

encoder : Lavc59.51.101 gif

Clipping frame in rate conversion by 0.000008
[mjpeg @ 0x55f210eb32c0] marker=d8 avail_size_in_buf=371340 bitrate=N/A speed=N/A
[mjpeg @ 0x55f210eb32c0] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x55f210eb32c0] marker=e1 avail_size_in_buf=37132
[mjpeg @ 0x55f210eb32c0] marker parser used 3964 bytes (31712 bits)
[mjpeg @ 0x55f210eb32c0] marker=e2 avail_size_in_buf=33165
[mjpeg @ 0x55f210eb32c0] marker parser used 43 bytes (344 bits)
[mjpeg @ 0x55f210eb32c0] marker=db avail_size_in_buf=33119
[mjpeg @ 0x55f210eb32c0] index=0
[mjpeg @ 0x55f210eb32c0] qscale[0]: 0
[mjpeg @ 0x55f210eb32c0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x55f210eb32c0] marker=dd avail_size_in_buf=33050
[mjpeg @ 0x55f210eb32c0] restart interval: 72
[mjpeg @ 0x55f210eb32c0] marker parser used 4 bytes (32 bits)
[mjpeg @ 0x55f210eb32c0] marker=c0 avail_size_in_buf=33044
[mjpeg @ 0x55f210eb32c0] sof0: picture: 576x768
[mjpeg @ 0x55f210eb32c0] component 0 1:1 id: 1 quant:0
[mjpeg @ 0x55f210eb32c0] pix fmt id 11000000
[mjpeg @ 0x55f210eb32c0] Format gray chosen by get_format().
[mjpeg @ 0x55f210eb32c0] marker parser used 11 bytes (88 bits)
[mjpeg @ 0x55f210eb32c0] marker=c4 avail_size_in_buf=33031
[mjpeg @ 0x55f210eb32c0] class=0 index=0 nb_codes=12
[mjpeg @ 0x55f210eb32c0] class=1 index=0 nb_codes=162
[mjpeg @ 0x55f210eb32c0] marker parser used 210 bytes (1680 bits)
[mjpeg @ 0x55f210eb32c0] escaping removed 90 bytes
[mjpeg @ 0x55f210eb32c0] marker=da avail_size_in_buf=32819
[mjpeg @ 0x55f210eb32c0] component: 1
[mjpeg @ 0x55f210eb32c0] marker parser used 32728 bytes (261817 bits)
[mjpeg @ 0x55f210eb32c0] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x55f210eb32c0] decode frame unused 0 bytes
[graph 0 input from stream 0:0 @ 0x55f2110ad600] Setting 'video_size' to value '576x768'
[graph 0 input from stream 0:0 @ 0x55f2110ad600] Setting 'pix_fmt' to value '8'
[graph 0 input from stream 0:0 @ 0x55f2110ad600] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x55f2110ad600] Setting 'pixel_aspect' to value '300/300'
[graph 0 input from stream 0:0 @ 0x55f2110ad600] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x55f2110ad600] w:576 h:768 pixfmt:gray tb:1/25 fr:25/1 sar:300/300
[scaler_out_0_0 @ 0x55f2110c4540] Setting 'w' to value '3024'
[scaler_out_0_0 @ 0x55f2110c4540] Setting 'h' to value '4032'
[scaler_out_0_0 @ 0x55f2110c4540] w:3024 h:4032 flags: interl:0
[format @ 0x55f2110a6240] Setting 'pix_fmts' to value 'bgr8'
[AVFilterGraph @ 0x55f2110ab440] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
[swscaler @ 0x55f2112cc640] [swscaler @ 0x55f2111d5000] Forcing full internal H chroma due to input having non subsampled chroma
[swscaler @ 0x55f2112cc640] Error-diffusion dither is in use, scaling will be single-threaded.w:576 h:768 fmt:gray sar:300/300 -> w:3024 h:4032 fmt:bgr8 sar:1/1 flags:0x0
[swscaler @ 0x55f2111d5000] [swscaler @ 0x55f211195a40] Forcing full internal H chroma due to input having non subsampled chroma
[swscaler @ 0x55f2111d5000] Error-diffusion dither is in use, scaling will be single-threaded.w:576 h:768 fmt:gray sar:300/300 -> w:3024 h:4032 fmt:bgr8 sar:1/1 flags:0x0
[swscaler @ 0x55f2112cc640] [swscaler @ 0x55f2111d5000] Forcing full internal H chroma due to input having non subsampled chroma
[swscaler @ 0x55f2112cc640] Error-diffusion dither is in use, scaling will be single-threaded.w:576 h:768 fmt:gray sar:300/300 -> w:3024 h:4032 fmt:bgr8 sar:1/1 flags:0x0
[swscaler @ 0x55f2112cc640] [swscaler @ 0x55f2111d5000] Forcing full internal H chroma due to input having non subsampled chroma
[swscaler @ 0x55f2112cc640] Error-diffusion dither is in use, scaling will be single-threaded.w:576 h:768 fmt:gray sar:300/300 -> w:3024 h:4032 fmt:bgr8 sar:1/1 flags:0x0
[gif @ 0x55f210eb0c80] 3024x4032 image at pos (0;0) [area:3024x4032]
[out_0_0 @ 0x55f2110c4340] EOF on sink link out_0_0:default.bitrate= 0.0kbits/s speed=0.0446x
No more output streams to write to, finishing.
All streams finished for output file #0
Terminating muxer thread 0
[AVIOContext @ 0x55f210eb3b00] Statistics: 5690666 bytes written, 0 seeks, 22 writeouts
frame= 2 fps=0.0 q=-0.0 Lsize= 5557kB time=00:00:00.04 bitrate=1138133.2kbits/s speed=0.0442x
video:5557kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000351%
Input file #0 (IMG):

Input stream #0:0 (video): 2 packets read (1635533 bytes); 2 frames decoded;
Total: 2 packets (1635533 bytes) demuxed

Output file #0 (bad.gif):

Output stream #0:0 (video): 2 frames encoded; 2 packets muxed (5690646 bytes);
Total: 2 packets (5690646 bytes) muxed

2 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x55f210ea75c0] Statistics: 1635533 bytes read, 0 seeks

Attachments (2)

IMG (1.6 MB ) - added by Brett 2 years ago.
Jpeg file without .jpg
IMG.jpg (1.6 MB ) - added by Brett 2 years ago.
Same file with .jpg extension

Change History (3)

by Brett, 2 years ago

Attachment: IMG added

Jpeg file without .jpg

by Brett, 2 years ago

Attachment: IMG.jpg added

Same file with .jpg extension

comment:1 by Carl Eugen Hoyos, 2 years ago

Component: ffmpegundetermined
Keywords: jpeg removed
Resolution: invalid
Status: newclosed

The file IMG contains two concatenated jpeg images, you can test this for example with:
$ ffmpeg -i IMG -vcodec copy out%1d.jpg
The pipe demuxer (that correctly auto-detected the format of IMG being jpeg) cannot know that you only want to decode the first image unless you tell it while the image2 demuxer (that at least in some cases is preferred for files with suffix .jpg over the pipe demuxer) only reads the first image. There is no issue that can be fixed.
Please note that you cannot create "good" gifs with your command line, please look at the documentation for the palettegen and paletteuse filters:
https://ffmpeg.org/ffmpeg-filters.html#palettegen-1

Note: See TracTickets for help on using tickets.