Opened 2 years ago

Last modified 2 years ago

#5561 open enhancement

Implement a tiff parser

Reported by: csab6597 Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: TIF
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by cehoyos)

when sending TIFF files to ffmpeg via piped input -> error:

[tiff_pipe @ 0000024d6abdcf40] Could not find codec parameters for stream 0 (Video: tiff, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options

I successfully tested piped input with png and jpg files

ffmpeg started on 2016-05-16 at 00:41:45
Report written to "ffmpeg-20160516-004145.log"
Command line:
ffmpeg -v 9 -framerate 25 -i pipe:0 test.mp4 -y -report < file_1_test.tif
ffmpeg version N-79173-gbe746ae Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 32.100 / 57. 32.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '25'.
Reading option '-i' ... matched as input file with argument 'pipe:0'.
Reading option 'test.mp4' ... matched as output file.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
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.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file pipe:0.
Successfully parsed a group of options.
Opening an input file: pipe:0.
[pipe @ 00000241e664f080] Setting default whitelist 'crypto'
[tiff_pipe @ 00000241e664e0e0] Format tiff_pipe probed with size=2048 and score=51
[tiff_pipe @ 00000241e664e0e0] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0
[tiff_pipe @ 00000241e664e0e0] parser not found for codec tiff, packets or times may be invalid.
[tiff_pipe @ 00000241e664e0e0] Could not find codec parameters for stream 0 (Video: tiff, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[tiff_pipe @ 00000241e664e0e0] After avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 frames:0
pipe:0: could not find codec parameters
Input #0, tiff_pipe, from 'pipe:0':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 0, 1/25: Video: tiff, none, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file test.mp4.
Successfully parsed a group of options.
Opening an output file: test.mp4.
Output #0, mp4, to 'test.mp4':
Output file #0 does not contain any stream
[AVIOContext @ 00000241e6657200] Statistics: 32768 bytes read, 0 seeks

for comparison, here I am using the same TIFF file with the -i option, which works fine:

ffmpeg started on 2016-05-16 at 00:43:15
Report written to "ffmpeg-20160516-004315.log"
Command line:
ffmpeg -v 9 -framerate 25 -i file_1_test.tif test.mp4 -y -report
ffmpeg version N-79173-gbe746ae Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 32.100 / 57. 32.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '25'.
Reading option '-i' ... matched as input file with argument 'file_1_test.tif'.
Reading option 'test.mp4' ... matched as output file.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
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.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file file_1_test.tif.
Successfully parsed a group of options.
Opening an input file: file_1_test.tif.
[file @ 000002bc834af0a0] Setting default whitelist 'file,crypto'
[tiff_pipe @ 000002bc834ae100] Format tiff_pipe probed with size=2048 and score=51
[tiff_pipe @ 000002bc834ae100] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0
[tiff_pipe @ 000002bc834ae100] parser not found for codec tiff, packets or times may be invalid.
[tiff_pipe @ 000002bc834ae100] parser not found for codec tiff, packets or times may be invalid.
[tiff_pipe @ 000002bc834ae100] After avformat_find_stream_info() pos: 548628 bytes read:548628 seeks:0 frames:1
Input #0, tiff_pipe, from 'file_1_test.tif':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 1, 1/25: Video: tiff, rgba, 480x270 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file test.mp4.
Successfully parsed a group of options.
Opening an output file: test.mp4.
[file @ 000002bc83547a40] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 000002bc8354aaa0] Setting 'video_size' to value '480x270'
[graph 0 input from stream 0:0 @ 000002bc8354aaa0] Setting 'pix_fmt' to value '28'
[graph 0 input from stream 0:0 @ 000002bc8354aaa0] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 000002bc8354aaa0] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 000002bc8354aaa0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 000002bc8354aaa0] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 000002bc8354aaa0] w:480 h:270 pixfmt:rgba tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[format @ 000002bc8354b120] compat: called with args=[yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21]
[format @ 000002bc8354b120] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21'
[auto-inserted scaler 0 @ 000002bc8354b1e0] Setting 'flags' to value 'bicubic'
[auto-inserted scaler 0 @ 000002bc8354b1e0] w:iw h:ih flags:'bicubic' interl:0
[format @ 000002bc8354b120] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 000002bc834adb80] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
[auto-inserted scaler 0 @ 000002bc8354b1e0] picking yuv444p out of 8 ref:rgba alpha:1
[auto-inserted scaler 0 @ 000002bc8354b1e0] w:480 h:270 fmt:rgba sar:1/1 -> w:480 h:270 fmt:yuv444p sar:1/1 flags:0x4
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 000002bc83546fe0] using mv_range_thread = 24
[libx264 @ 000002bc83546fe0] using SAR=1/1
[libx264 @ 000002bc83546fe0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 000002bc83546fe0] profile High 4:4:4 Predictive, level 2.1, 4:4:4 8-bit
[libx264 @ 000002bc83546fe0] 264 - core 148 r2665 a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=4 threads=6 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=25 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:
    encoder         : Lavf57.29.101
    Stream #0:0, 0, 1/12800: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 480x270 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.32.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (tiff (native) -> h264 (libx264))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.000008
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[output stream 0:0 @ 000002bc8354ae00] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
[libx264 @ 000002bc83546fe0] frame=   0 QP=15.09 NAL=3 Slice:I Poc:0   I:510  P:0    SKIP:0    size=1209 bytes
frame=    1 fps=0.0 q=28.0 Lsize=       3kB time=00:00:00.04 bitrate= 539.6kbits/s speed=N/A    
video:2kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 42.224564%
Input file #0 (file_1_test.tif):
  Input stream #0:0 (video): 1 packets read (548628 bytes); 1 frames decoded; 
  Total: 1 packets (548628 bytes) demuxed
Output file #0 (test.mp4):
  Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (1897 bytes); 
  Total: 1 packets (1897 bytes) muxed
1 frames successfully decoded, 0 decoding errors
[AVIOContext @ 000002bc83547b20] Statistics: 30 seeks, 24 writeouts
[libx264 @ 000002bc83546fe0] frame I:1     Avg QP:15.09  size:  1209
[libx264 @ 000002bc83546fe0] mb I  I16..4:  0.6% 89.2% 10.2%
[libx264 @ 000002bc83546fe0] 8x8 transform intra:89.2%
[libx264 @ 000002bc83546fe0] coded y,u,v intra: 4.6% 0.0% 0.0%
[libx264 @ 000002bc83546fe0] i16 v,h,dc,p:  0% 33% 67%  0%
[libx264 @ 000002bc83546fe0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  0%  0% 100%  0%  0%  0%  0%  0%  0%
[libx264 @ 000002bc83546fe0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 34% 24%  4%  2%  0%  1%  8%  2%
[libx264 @ 000002bc83546fe0] kb/s:241.80
[AVIOContext @ 000002bc834b7220] Statistics: 548628 bytes read, 0 seeks

Attachments (1)

file_1_test.tif (535.8 KB) - added by csab6597 2 years ago.

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by csab6597

comment:1 Changed 2 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Description modified (diff)
  • Keywords TIF added; TIFF removed
  • Priority changed from normal to wish
  • Reproduced by developer set
  • Status changed from new to open
  • Summary changed from cannot input TIFF files via piped input -> 'Could not find codec parameters...' to Implement a tiff parser
  • Type changed from defect to enhancement
  • Version changed from unspecified to git-master

comment:2 Changed 2 years ago by richardpl

Not possible, tiff parser.

comment:3 Changed 2 years ago by csab6597

I would like to add a wish that there could be a more meaningful message like 'format xxx not supported for pipe input'. At the moment for tiff files, it looks like these files ARE supported because the line above [Input #0, tiff_pipe, from 'pipe:0'] makes the user think the file was identified correctly. This line made me spend quite a while on this matter...

By the way I did some more testing of pipe input of image formats:
bmp: works
gif: works
tga: 'Invalid data found when processing input'
pbm: 'Invalid data found when processing input'
pcx: 'could not find codec parameters...'
jpg: works
png: works
other file formats to test...

comment:4 Changed 2 years ago by cehoyos

It may be faster to run dash configure --list-parsers. Note that it is possible and useful to pipe single images.

Note: See TracTickets for help on using tickets.