Opened 4 years ago

Closed 4 years ago

#8574 closed defect (fixed)

Cannot pipe WebP images

Reported by: dsa-t Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: image2
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

When trying to pipe WebP images into ffmpeg, it fails.
Changing analyzeduration and probesize does not help.
Specifying -f webp_pipe does not help

When passing the file to -i directly, this works:

ffmpeg -i 1.webp -y -vcodec libx264 test.mp4

Piping JPEG images instead of WebP also works.

Example image: https://www.gstatic.com/webp/gallery/1.webp

How to reproduce:

cat 1.webp | ffmpeg -loglevel 99 -analyzeduration 10M -probesize 10M -i pipe:0 -y -vcodec libx264 test.mp4

ffmpeg version N-96981-g39fbd06 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/home/alex/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/alex/ffmpeg_build/include --extra-ldflags=-L/home/alex/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/alex/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-libwebp
  libavutil      56. 42.100 / 56. 42.100
  libavcodec     58. 75.100 / 58. 75.100
  libavformat    58. 41.100 / 58. 41.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.100 /  7. 77.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '10M'.
Reading option '-probesize' ... matched as AVOption 'probesize' with argument '10M'.
Reading option '-i' ... matched as input url with argument 'pipe:0'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option 'test.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument 99.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url pipe:0.
Successfully parsed a group of options.
Opening an input file: pipe:0.
[NULL @ 0x55c59fc97b80] Opening 'pipe:0' for reading
[pipe @ 0x55c59fc98b40] Setting default whitelist 'crypto,data'
Probing webp_pipe score:99 size:2048
[webp_pipe @ 0x55c59fc97b80] Format webp_pipe probed with size=2048 and score=99
[webp_pipe @ 0x55c59fc97b80] Before avformat_find_stream_info() pos: 0 bytes read:30320 seeks:0 nb_streams:1
[webp_pipe @ 0x55c59fc97b80] parser not found for codec webp, packets or times may be invalid.
[webp_pipe @ 0x55c59fc97b80] stream 0: start_time: -368934881474191040.000 duration: -368934881474191040.000
[webp_pipe @ 0x55c59fc97b80] format: start_time: -9223372036854.775 duration: -9223372036854.775 (estimate from bit rate) bitrate=0 kb/s
[webp_pipe @ 0x55c59fc97b80] Could not find codec parameters for stream 0 (Video: webp, 1 reference frame, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[webp_pipe @ 0x55c59fc97b80] After avformat_find_stream_info() pos: 0 bytes read:30320 seeks:0 frames:0
Input #0, webp_pipe, from 'pipe:0':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 0, 1/25: Video: webp, 1 reference frame, none, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output url test.mp4.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libx264.
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 @ 0x55c59fc98e80] Statistics: 30320 bytes read, 0 seeks

Change History (2)

comment:1 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavformat
Keywords: image2 added
Reproduced by developer: set
Status: newopen

Piping input only works for formats with available parser, work-around is to use -frame_size 1M.

comment:2 by James, 4 years ago

Resolution: fixed
Status: openclosed

WebP parser implemented in fccd6c2be0aa4feb3fe8050769705459a1990e83

Note: See TracTickets for help on using tickets.