Opened 10 years ago

Closed 10 years ago

#3303 closed defect (fixed)

Corrupted JPEG cannot be processed (was: TIFF tag type (0) is not implemented)

Reported by: gajdot Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: mjpeg regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug: I have a problem that ffmpeg can't recognize an images made by an android tablet. When I try to run the command it warns me that tiff tag 0 is not found. The command will render, but it will just leave the image out of the final render.

gajdot@gajdot:~/ffmpeg_test$ ./ffmpeg -i first.MOV -i input.jpg -filter_complex "[0:v][1:v]overlay=920:0[video]" -async 1 -map [video] -map 0:a test.mp4
ffmpeg version N-59158-g745c40a Copyright (c) 2000-2013 the FFmpeg developers

built on Dec 17 2013 05:32:25 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
libavutil 53. 0.100 / 53. 0.100
libavcodec 55. 45.101 / 55. 45.101
libavformat 55. 22.100 / 55. 22.100
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 0.100 / 4. 0.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'first.MOV':

Metadata:

major_brand : qt
minor_version : 537331968
compatible_brands: qt CAEP
creation_time : 2013-09-07 00:39:52

Duration: 00:00:07.97, start: 0.000000, bitrate: 44582 kb/s

Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 43037 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 48k tbc (default)
Metadata:

creation_time : 2013-09-07 00:39:52

Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:

creation_time : 2013-09-07 00:39:52

[mjpeg @ 0x2814a40] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x2814a40] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[mjpeg @ 0x2814a40] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x2814a40] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
Input #1, image2, from 'input.jpg':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #1:0: Video: mjpeg, yuvj420p(pc), 1280x960, 25 tbr, 25 tbn, 25 tbc

File 'test.mp4' already exists. Overwrite ? [y/N] y
[swscaler @ 0x27fa460] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x2898aa0] deprecated pixel format used, make sure you did set range correctly
-async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
[libx264 @ 0x2815de0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
[libx264 @ 0x2815de0] profile High, level 4.0
[libx264 @ 0x2815de0] 264 - core 129 r2230 1cffe9f - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test.mp4':

Metadata:

major_brand : qt
minor_version : 537331968
compatible_brands: qt CAEP
encoder : Lavf55.22.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080, q=-1--1, 24k tbn, 23.98 tbc (default)
Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
Metadata:

creation_time : 2013-09-07 00:39:52

Stream mapping:

Stream #0:0 (h264) -> overlay:main (graph 0)
Stream #1:0 (mjpeg) -> overlay:overlay (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (pcm_s16le -> libvo_aacenc)

Press [q] to stop, ? for help
[mjpeg @ 0x2814a40] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x2814a40] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[mjpeg @ 0x2814a40] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x2814a40] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
frame= 191 fps=5.2 q=-1.0 Lsize= 8874kB time=00:00:07.96 bitrate=9124.5kbits/s
video:8743kB audio:125kB subtitle:0 global headers:0kB muxing overhead 0.058395%
[libx264 @ 0x2815de0] frame I:5 Avg QP:24.05 size: 63302
[libx264 @ 0x2815de0] frame P:186 Avg QP:26.37 size: 46428
[libx264 @ 0x2815de0] mb I I16..4: 15.3% 72.0% 12.7%
[libx264 @ 0x2815de0] mb P I16..4: 16.6% 34.8% 3.6% P16..4: 29.5% 12.7% 1.7% 0.0% 0.0% skip: 1.1%
[libx264 @ 0x2815de0] 8x8 transform intra:63.6% inter:85.4%
[libx264 @ 0x2815de0] coded y,uvDC,uvAC intra: 52.5% 66.3% 15.3% inter: 52.4% 55.6% 0.9%
[libx264 @ 0x2815de0] i16 v,h,dc,p: 4% 75% 5% 17%
[libx264 @ 0x2815de0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 8% 64% 11% 2% 2% 1% 4% 1% 6%
[libx264 @ 0x2815de0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 3% 83% 5% 1% 1% 1% 3% 0% 4%
[libx264 @ 0x2815de0] i8c dc,h,v,p: 44% 45% 8% 3%
[libx264 @ 0x2815de0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x2815de0] ref P L0: 57.7% 19.5% 13.8% 9.0%
[libx264 @ 0x2815de0] kb/s:8990.02

Info on the file:
gajdot@gajdot:~/ffmpeg_test$ ./ffmpeg -v 9 -loglevel 99 -i input.jpg
ffmpeg version N-59158-g745c40a Copyright (c) 2000-2013 the FFmpeg developers

built on Dec 17 2013 05:32:25 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
libavutil 53. 0.100 / 53. 0.100
libavcodec 55. 45.101 / 55. 45.101
libavformat 55. 22.100 / 55. 22.100
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 0.100 / 4. 0.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.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 file with argument 'input.jpg'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input file input.jpg.
Successfully parsed a group of options.
Opening an input file: input.jpg.
[AVIOContext @ 0x26a5d20] Statistics: 267936 bytes read, 0 seeks
[mjpeg @ 0x26a3ba0] marker=d8 avail_size_in_buf=267934
[mjpeg @ 0x26a3ba0] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x26a3ba0] marker=e1 avail_size_in_buf=267932
[mjpeg @ 0x26a3ba0] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x26a3ba0] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[mjpeg @ 0x26a3ba0] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x26a3ba0] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[mjpeg @ 0x26a3ba0] marker parser used 7826 bytes (62608 bits)
[mjpeg @ 0x26a3ba0] marker=db avail_size_in_buf=260103
[mjpeg @ 0x26a3ba0] index=0
[mjpeg @ 0x26a3ba0] qscale[0]: 1
[mjpeg @ 0x26a3ba0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x26a3ba0] marker=db avail_size_in_buf=260034
[mjpeg @ 0x26a3ba0] index=1
[mjpeg @ 0x26a3ba0] qscale[1]: 2
[mjpeg @ 0x26a3ba0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x26a3ba0] marker=c4 avail_size_in_buf=259965
[mjpeg @ 0x26a3ba0] class=0 index=0 nb_codes=12
[mjpeg @ 0x26a3ba0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0x26a3ba0] marker=c4 avail_size_in_buf=259932
[mjpeg @ 0x26a3ba0] class=1 index=0 nb_codes=251
[mjpeg @ 0x26a3ba0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0x26a3ba0] marker=c4 avail_size_in_buf=259749
[mjpeg @ 0x26a3ba0] class=0 index=1 nb_codes=12
[mjpeg @ 0x26a3ba0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0x26a3ba0] marker=c4 avail_size_in_buf=259716
[mjpeg @ 0x26a3ba0] class=1 index=1 nb_codes=251
[mjpeg @ 0x26a3ba0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0x26a3ba0] marker=dd avail_size_in_buf=259533
[mjpeg @ 0x26a3ba0] restart interval: 2400
[mjpeg @ 0x26a3ba0] marker parser used 4 bytes (32 bits)
[mjpeg @ 0x26a3ba0] marker=c0 avail_size_in_buf=259527
[mjpeg @ 0x26a3ba0] sof0: picture: 1280x960
[mjpeg @ 0x26a3ba0] component 0 2:2 id: 0 quant:0
[mjpeg @ 0x26a3ba0] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x26a3ba0] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x26a3ba0] pix fmt id 22111100
[mjpeg @ 0x26a3ba0] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x26a3ba0] escaping removed 597 bytes
[mjpeg @ 0x26a3ba0] marker=da avail_size_in_buf=259508
[mjpeg @ 0x26a3ba0] component: 0
[mjpeg @ 0x26a3ba0] component: 1
[mjpeg @ 0x26a3ba0] component: 2
[mjpeg @ 0x26a3ba0] marker parser used 258907 bytes (2071253 bits)
[mjpeg @ 0x26a3ba0] decode frame unused 0 bytes
Input #0, image2, from 'input.jpg':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #0:0, 1, 1/25: Video: mjpeg, yuvj420p(pc), 1280x960, 1/25, 25 tbr, 25 tbn, 25 tbc

Successfully opened the file.

The file it self: https://www.dropbox.com/s/nat0eyagy76tq06/input.jpg

Attachments (1)

input.jpg (261.7 KB ) - added by Thilo Borgmann 10 years ago.

Download all attachments as: .zip

Change History (11)

in reply to:  description comment:1 by Thilo Borgmann, 10 years ago

Replying to gajdot:

Summary of the bug: I have a problem that ffmpeg can't recognize an images made by an android tablet. When I try to run the command it warns me that tiff tag 0 is not found. The command will render, but it will just leave the image out of the final render.

The warning about the type of the TIFF tag should not be related to the problem of the image is not in the final render.

For the TIFF tag, type == 0 is not specified. There are two tags with type == 0 && id == 0 in the file, where according to the spec, for id == 0, type == 1 (BYTE) is required. Thus I think its some vendor specific nonsense for the TIFF tag side of the problem.

comment:2 by gajdot, 10 years ago

Well for every other type of image which wasn't created with this tablet it works and renders the video. Only with pictures from this tablet won't show up on the final render and create the error I posted. Anyway is there a way to force ffmpeg to render the output correctly?

comment:3 by Thilo Borgmann, 10 years ago

The TIFF tag is not your problem.

Showing the image using ffplay hangs.
Image magick complains:

display: Premature end of JPEG file `input.jpg' @ jpeg.c/EmitMessage/227.
display: Corrupt JPEG data: 1 extraneous bytes before marker 0xd9 `input.jpg' @ jpeg.c/EmitMessage/227.

Someone with knowledge about JPEG should have a look at this. (I do not have any)

comment:4 by Thilo Borgmann, 10 years ago

Reproduced by developer: set
Summary: TIFF tag type (0) is not implementedCorrupted JPEG cannot be processed (was: TIFF tag type (0) is not implemented)
Version: unspecifiedgit-master

by Thilo Borgmann, 10 years ago

Attachment: input.jpg added

comment:5 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavcodec
Keywords: mjpeg regression added
Priority: normalimportant
Status: newopen

Regression since b6c04b68 related to ticket #471

$ ffmpeg -i input.jpg -f null -
ffmpeg version N-59832-gb821def Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan 14 2014 17:25:00 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 48.101 / 55. 48.101
  libavformat    55. 23.103 / 55. 23.103
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  1.100 /  4.  1.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[mjpeg @ 0x280d860] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x280d860] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[mjpeg @ 0x280d860] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x280d860] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
Input #0, image2, from 'input.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc), 1280x960, 25 tbr, 25 tbn, 25 tbc
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf55.23.103
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuvj420p, 1280x960, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> rawvideo)
Press [q] to stop, [?] for help
[mjpeg @ 0x280d860] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x280d860] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[mjpeg @ 0x280d860] TIFF tag type (0) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mjpeg @ 0x280d860] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
frame=    0 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead -inf%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

in reply to:  3 comment:6 by Carl Eugen Hoyos, 10 years ago

Replying to thilo.borgmann:

Image magick complains:

display: Premature end of JPEG file `input.jpg' @ jpeg.c/EmitMessage/227.
display: Corrupt JPEG data: 1 extraneous bytes before marker 0xd9 `input.jpg' @ jpeg.c/EmitMessage/227.

How can I reproduce this?
ImageMagick 6.7.6 does not complain here.

comment:7 by Thilo Borgmann, 10 years ago

I reloaded the image from Trac to be sure:

nue066:tmp Thilo$ display input.jpg
display: Premature end of JPEG file `input.jpg' @ jpeg.c/EmitMessage/227.
display: Corrupt JPEG data: 1 extraneous bytes before marker 0xd9 `input.jpg' @ >jpeg.c/EmitMessage/227.
nue066:tmp Thilo$ display --version
Version: ImageMagick 6.5.8-0 2010-02-09 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Features: OpenMP

nue066:tmp Thilo$ md5 input.jpg
MD5 (input.jpg) = 8ff0a951a314326b96983ae5d1260938
nue066:tmp Thilo$

comment:8 by Carl Eugen Hoyos, 10 years ago

My version looks newer...

But since I haven't found a program yet that does not decode the image (except current FFmpeg), I don't think it matters.

comment:10 by Michael Niedermayer, 10 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.