Opened 3 years ago

Closed 3 years ago

#4849 closed defect (fixed)

FFmpeg performs 3 HTTP GET requests to convert single remote JPG image

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

Description

FFmpeg performs 3 HTTP GET requests to convert single remote image.

$ ./ffmpeg -y -loglevel trace -i http://i.wp.pl/a/f/film/033/47/13/0251347.jpg -f mjpeg /dev/null
ffmpeg version N-75278-ga8bedd5 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
  configuration: --prefix=/home/pszemus/ffmpeg-2.8/build --enable-pic --enable-pthreads --enable-libmp3lame --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-gpl --enable-nonfree --enable-libvpx --enable-libvorbis --enable-libx264 --pkg-config-flags=--static --enable-protocol=https --enable-openssl --extra-cflags=-I/opt/WP/common.libs/inc --extra-ldflags='-L/opt/WP/common.libs/lib -ldl'
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  1.100 / 57.  1.100
  libavformat    57.  0.100 / 57.  0.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  3.100 /  6.  3.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Reading option '-i' ... matched as input file with argument 'http://i.wp.pl/a/f/film/033/47/13/0251347.jpg'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mjpeg'.
Reading option '/dev/null' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input file http://i.wp.pl/a/f/film/033/47/13/0251347.jpg.
Successfully parsed a group of options.
Opening an input file: http://i.wp.pl/a/f/film/033/47/13/0251347.jpg.
[http @ 0x23b0c80] request: GET /a/f/film/033/47/13/0251347.jpg HTTP/1.1
User-Agent: Lavf/57.0.100
Accept: */*
Range: bytes=0-
Connection: close
Host: i.wp.pl
Icy-MetaData: 1


[http @ 0x23b0c80] header='HTTP/1.1 206 Partial Content'
[http @ 0x23b0c80] http_code=206
[http @ 0x23b0c80] header='Server: nginx'
[http @ 0x23b0c80] header='Date: Mon, 14 Sep 2015 13:26:24 GMT'
[http @ 0x23b0c80] header='Content-Type: image/jpeg'
[http @ 0x23b0c80] header='Content-Length: 46347'
[http @ 0x23b0c80] header='Connection: close'
[http @ 0x23b0c80] header='Last-Modified: Tue, 26 Oct 2010 09:39:27 GMT'
[http @ 0x23b0c80] header='Vary: Accept-Encoding'
[http @ 0x23b0c80] header='ETag: "4cc6a1cf-b50b"'
[http @ 0x23b0c80] header='Expires: Mon, 21 Sep 2015 13:26:24 GMT'
[http @ 0x23b0c80] header='Cache-Control: max-age=604800'
[http @ 0x23b0c80] header='Access-Control-Allow-Origin: *'
[http @ 0x23b0c80] header='Cache-Control: public'
[http @ 0x23b0c80] header='Content-Range: bytes 0-46346/46347'
[http @ 0x23b0c80] header=''
Probing image2 score:50 size:2048
Probing mp3 score:1 size:2048
Probing jpeg_pipe score:6 size:2048
[image2 @ 0x23b0380] Format image2 probed with size=2048 and score=50
[http @ 0x23b47c0] request: GET /a/f/film/033/47/13/0251347.jpg HTTP/1.1
User-Agent: Lavf/57.0.100
Accept: */*
Range: bytes=0-
Connection: close
Host: i.wp.pl
Icy-MetaData: 1


[http @ 0x23b47c0] header='HTTP/1.1 206 Partial Content'
[http @ 0x23b47c0] http_code=206
[http @ 0x23b47c0] header='Server: nginx'
[http @ 0x23b47c0] header='Date: Mon, 14 Sep 2015 13:26:24 GMT'
[http @ 0x23b47c0] header='Content-Type: image/jpeg'
[http @ 0x23b47c0] header='Content-Length: 46347'
[http @ 0x23b47c0] header='Connection: close'
[http @ 0x23b47c0] header='Last-Modified: Tue, 26 Oct 2010 09:39:27 GMT'
[http @ 0x23b47c0] header='Vary: Accept-Encoding'
[http @ 0x23b47c0] header='ETag: "4cc6a1cf-b50b"'
[http @ 0x23b47c0] header='Expires: Mon, 21 Sep 2015 13:26:24 GMT'
[http @ 0x23b47c0] header='Cache-Control: max-age=604800'
[http @ 0x23b47c0] header='Access-Control-Allow-Origin: *'
[http @ 0x23b47c0] header='Cache-Control: public'
[http @ 0x23b47c0] header='Content-Range: bytes 0-46346/46347'
[http @ 0x23b47c0] header=''
[image2 @ 0x23b0380] Before avformat_find_stream_info() pos: 0 bytes read:6834 seeks:0
[http @ 0x23b55c0] request: GET /a/f/film/033/47/13/0251347.jpg HTTP/1.1
User-Agent: Lavf/57.0.100
Accept: */*
Range: bytes=0-
Connection: close
Host: i.wp.pl
Icy-MetaData: 1


[http @ 0x23b55c0] header='HTTP/1.1 206 Partial Content'
[http @ 0x23b55c0] http_code=206
[http @ 0x23b55c0] header='Server: nginx'
[http @ 0x23b55c0] header='Date: Mon, 14 Sep 2015 13:26:24 GMT'
[http @ 0x23b55c0] header='Content-Type: image/jpeg'
[http @ 0x23b55c0] header='Content-Length: 46347'
[http @ 0x23b55c0] header='Connection: close'
[http @ 0x23b55c0] header='Last-Modified: Tue, 26 Oct 2010 09:39:27 GMT'
[http @ 0x23b55c0] header='Vary: Accept-Encoding'
[http @ 0x23b55c0] header='ETag: "4cc6a1cf-b50b"'
[http @ 0x23b55c0] header='Expires: Mon, 21 Sep 2015 13:26:24 GMT'
[http @ 0x23b55c0] header='Cache-Control: max-age=604800'
[http @ 0x23b55c0] header='Access-Control-Allow-Origin: *'
[http @ 0x23b55c0] header='Cache-Control: public'
[http @ 0x23b55c0] header='Content-Range: bytes 0-46346/46347'
[http @ 0x23b55c0] header=''
[AVIOContext @ 0x23b4800] Statistics: 46347 bytes read, 0 seeks
[mjpeg @ 0x23b4ee0] marker=d8 avail_size_in_buf=46345
[mjpeg @ 0x23b4ee0] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x23b4ee0] marker=e0 avail_size_in_buf=46343
[mjpeg @ 0x23b4ee0] marker parser used 16 bytes (128 bits)
[mjpeg @ 0x23b4ee0] marker=ed avail_size_in_buf=46325
[mjpeg @ 0x23b4ee0] marker parser used 5401 bytes (43208 bits)
[mjpeg @ 0x23b4ee0] marker=e1 avail_size_in_buf=40921
[mjpeg @ 0x23b4ee0] marker parser used 5806 bytes (46448 bits)
[mjpeg @ 0x23b4ee0] marker=db avail_size_in_buf=35112
[mjpeg @ 0x23b4ee0] index=0
[mjpeg @ 0x23b4ee0] qscale[0]: 2
[mjpeg @ 0x23b4ee0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x23b4ee0] marker=db avail_size_in_buf=35043
[mjpeg @ 0x23b4ee0] index=1
[mjpeg @ 0x23b4ee0] qscale[1]: 5
[mjpeg @ 0x23b4ee0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x23b4ee0] marker=c0 avail_size_in_buf=34974
[mjpeg @ 0x23b4ee0] sof0: picture: 386x600
[mjpeg @ 0x23b4ee0] component 0 2:2 id: 0 quant:0
[mjpeg @ 0x23b4ee0] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x23b4ee0] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x23b4ee0] pix fmt id 22111100
[mjpeg @ 0x23b4ee0] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x23b4ee0] marker=c4 avail_size_in_buf=34955
[mjpeg @ 0x23b4ee0] class=0 index=0 nb_codes=10
[mjpeg @ 0x23b4ee0] marker parser used 29 bytes (232 bits)
[mjpeg @ 0x23b4ee0] marker=c4 avail_size_in_buf=34924
[mjpeg @ 0x23b4ee0] class=1 index=0 nb_codes=242
[mjpeg @ 0x23b4ee0] marker parser used 71 bytes (568 bits)
[mjpeg @ 0x23b4ee0] marker=c4 avail_size_in_buf=34851
[mjpeg @ 0x23b4ee0] class=0 index=1 nb_codes=7
[mjpeg @ 0x23b4ee0] marker parser used 26 bytes (208 bits)
[mjpeg @ 0x23b4ee0] marker=c4 avail_size_in_buf=34823
[mjpeg @ 0x23b4ee0] class=1 index=1 nb_codes=114
[mjpeg @ 0x23b4ee0] marker parser used 40 bytes (320 bits)
[mjpeg @ 0x23b4ee0] escaping removed 111 bytes
[mjpeg @ 0x23b4ee0] marker=da avail_size_in_buf=34781
[mjpeg @ 0x23b4ee0] component: 0
[mjpeg @ 0x23b4ee0] component: 1
[mjpeg @ 0x23b4ee0] component: 2
[mjpeg @ 0x23b4ee0] marker parser used 34669 bytes (277350 bits)
[mjpeg @ 0x23b4ee0] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x23b4ee0] decode frame unused 0 bytes
[image2 @ 0x23b0380] 0: start_time: 0.000 duration: 0.000
[image2 @ 0x23b0380] stream: start_time: 0.000 duration: 0.040 bitrate=9269 kb/s
[image2 @ 0x23b0380] After avformat_find_stream_info() pos: 0 bytes read:6834 seeks:0 frames:1
Input #0, image2, from 'http://i.wp.pl/a/f/film/033/47/13/0251347.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 9269 kb/s
    Stream #0:0, 1, 1/25: Video: mjpeg, 1 reference frame, yuvj420p(pc, bt470bg/unknown/unknown, center), 386x600 [SAR 476:476 DAR 193:300], 1/25, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file /dev/null.
Applying option f (force format) with argument mjpeg.
Successfully parsed a group of options.
Opening an output file: /dev/null.
Successfully opened the file.
detected 2 logical cores
[graph 0 input from stream 0:0 @ 0x23bb4c0] Setting 'video_size' to value '386x600'
[graph 0 input from stream 0:0 @ 0x23bb4c0] Setting 'pix_fmt' to value '12'
[graph 0 input from stream 0:0 @ 0x23bb4c0] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x23bb4c0] Setting 'pixel_aspect' to value '476/476'
[graph 0 input from stream 0:0 @ 0x23bb4c0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x23bb4c0] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x23bb4c0] w:386 h:600 pixfmt:yuvj420p tb:1/25 fr:25/1 sar:476/476 sws_param:flags=2
[format @ 0x23bb800] compat: called with args=[yuvj420p|yuvj422p|yuvj444p]
[format @ 0x23bb800] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p'
[AVFilterGraph @ 0x23ba960] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[mjpeg @ 0x23b7840] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores
[mjpeg @ 0x23b7840] intra_quant_bias = 96 inter_quant_bias = 0
Output #0, mjpeg, to '/dev/null':
  Metadata:
    encoder         : Lavf57.0.100
    Stream #0:0, 0, 1/25: Video: mjpeg, 1 reference frame, yuvj420p(pc, center), 386x600 [SAR 476:476 DAR 193:300], 1/25, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.1.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[mjpeg @ 0x23b5920] marker=d8 avail_size_in_buf=46345
[mjpeg @ 0x23b5920] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x23b5920] marker=e0 avail_size_in_buf=46343
[mjpeg @ 0x23b5920] marker parser used 16 bytes (128 bits)
[mjpeg @ 0x23b5920] marker=ed avail_size_in_buf=46325
[mjpeg @ 0x23b5920] marker parser used 5401 bytes (43208 bits)
[mjpeg @ 0x23b5920] marker=e1 avail_size_in_buf=40921
[mjpeg @ 0x23b5920] marker parser used 5806 bytes (46448 bits)
[mjpeg @ 0x23b5920] marker=db avail_size_in_buf=35112
[mjpeg @ 0x23b5920] index=0
[mjpeg @ 0x23b5920] qscale[0]: 2
[mjpeg @ 0x23b5920] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x23b5920] marker=db avail_size_in_buf=35043
[mjpeg @ 0x23b5920] index=1
[mjpeg @ 0x23b5920] qscale[1]: 5
[mjpeg @ 0x23b5920] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x23b5920] marker=c0 avail_size_in_buf=34974
[mjpeg @ 0x23b5920] sof0: picture: 386x600
[mjpeg @ 0x23b5920] component 0 2:2 id: 0 quant:0
[mjpeg @ 0x23b5920] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x23b5920] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x23b5920] pix fmt id 22111100
[mjpeg @ 0x23b5920] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x23b5920] marker=c4 avail_size_in_buf=34955
[mjpeg @ 0x23b5920] class=0 index=0 nb_codes=10
[mjpeg @ 0x23b5920] marker parser used 29 bytes (232 bits)
[mjpeg @ 0x23b5920] marker=c4 avail_size_in_buf=34924
[mjpeg @ 0x23b5920] class=1 index=0 nb_codes=242
[mjpeg @ 0x23b5920] marker parser used 71 bytes (568 bits)
[mjpeg @ 0x23b5920] marker=c4 avail_size_in_buf=34851
[mjpeg @ 0x23b5920] class=0 index=1 nb_codes=7
[mjpeg @ 0x23b5920] marker parser used 26 bytes (208 bits)
[mjpeg @ 0x23b5920] marker=c4 avail_size_in_buf=34823
[mjpeg @ 0x23b5920] class=1 index=1 nb_codes=114
[mjpeg @ 0x23b5920] marker parser used 40 bytes (320 bits)
[mjpeg @ 0x23b5920] escaping removed 111 bytes
[mjpeg @ 0x23b5920] marker=da avail_size_in_buf=34781
[mjpeg @ 0x23b5920] component: 0
[mjpeg @ 0x23b5920] component: 1
[mjpeg @ 0x23b5920] component: 2
[mjpeg @ 0x23b5920] marker parser used 34669 bytes (277350 bits)
[mjpeg @ 0x23b5920] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x23b5920] decode frame unused 0 bytes
Cliping frame in rate conversion by 0.000008
[output stream 0:0 @ 0x23bba60] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
frame=    1 fps=0.0 q=5.8 Lsize=      23kB time=00:00:00.04 bitrate=4647.0kbits/s
video:23kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (http://i.wp.pl/a/f/film/033/47/13/0251347.jpg):
  Input stream #0:0 (video): 1 packets read (46347 bytes); 1 frames decoded;
  Total: 1 packets (46347 bytes) demuxed
Output file #0 (/dev/null):
  Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (23235 bytes);
  Total: 1 packets (23235 bytes) muxed
1 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x23b47e0] Statistics: 0 seeks, 1 writeouts
[AVIOContext @ 0x23bc360] Statistics: 6834 bytes read, 0 seeks

At the same time, if the remote image is redirected (HTTP 302) only one GET request is performed (apart from the one beeing redirected):

$ ./ffmpeg -y -loglevel trace -i http://film.wp.pl/i,251347,e,jpg,galleryphoto -f mjpeg /dev/null
ffmpeg version N-75278-ga8bedd5 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
  configuration: --prefix=/home/pszemus/ffmpeg-2.8/build --enable-pic --enable-pthreads --enable-libmp3lame --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-gpl --enable-nonfree --enable-libvpx --enable-libvorbis --enable-libx264 --pkg-config-flags=--static --enable-protocol=https --enable-openssl --extra-cflags=-I/opt/WP/common.libs/inc --extra-ldflags='-L/opt/WP/common.libs/lib -ldl'
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  1.100 / 57.  1.100
  libavformat    57.  0.100 / 57.  0.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  3.100 /  6.  3.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Reading option '-i' ... matched as input file with argument 'http://film.wp.pl/i,251347,e,jpg,galleryphoto'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mjpeg'.
Reading option '/dev/null' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input file http://film.wp.pl/i,251347,e,jpg,galleryphoto.
Successfully parsed a group of options.
Opening an input file: http://film.wp.pl/i,251347,e,jpg,galleryphoto.
[http @ 0x2756c80] request: GET /i,251347,e,jpg,galleryphoto HTTP/1.1
User-Agent: Lavf/57.0.100
Accept: */*
Range: bytes=0-
Connection: close
Host: film.wp.pl
Icy-MetaData: 1


[http @ 0x2756c80] header='HTTP/1.1 301 Moved Permanently'
[http @ 0x2756c80] http_code=301
[http @ 0x2756c80] header='Server: aris'
[http @ 0x2756c80] header='Set-Cookie: _lastUsedServices=globals%2Cphp2javaTiming%2CdatasourceFactory%2Cphpinfo; expires=Wed, 14-Oct-2015 13:27:59 GMT'
[http @ 0x2756c80] header='Location: http://i.wp.pl/a/f/film/033/47/13/0251347.jpg'
[http @ 0x2756c80] header='Content-type: text/html'
[http @ 0x2756c80] header='Set-Cookie: statid=212.77.105.136.12479:1442237279:2650552094:v1; path=/; expires=Thu, 13-Sep-18 13:27:59 GMT'
[http @ 0x2756c80] header='Set-Cookie: statid=212.77.105.136.12479:1442237279:2650552094:v1; domain=.wp.pl; path=/; expires=Thu, 13-Sep-18 13:27:59 GMT'
[http @ 0x2756c80] header='Content-Length: 12279'
[http @ 0x2756c80] header='Connection: close'
[http @ 0x2756c80] header=''
[http @ 0x2756d20] Invalid cookie found, no value, path or domain specified
[http @ 0x2756c80] request: GET /a/f/film/033/47/13/0251347.jpg HTTP/1.1
User-Agent: Lavf/57.0.100
Accept: */*
Range: bytes=0-
Connection: close
Host: i.wp.pl
Cookie: statid=212.77.105.136.12479:1442237279:2650552094:v1
Icy-MetaData: 1


[http @ 0x2756c80] header='HTTP/1.1 206 Partial Content'
[http @ 0x2756c80] http_code=206
[http @ 0x2756c80] header='Server: nginx'
[http @ 0x2756c80] header='Date: Mon, 14 Sep 2015 13:27:59 GMT'
[http @ 0x2756c80] header='Content-Type: image/jpeg'
[http @ 0x2756c80] header='Content-Length: 46347'
[http @ 0x2756c80] header='Connection: close'
[http @ 0x2756c80] header='Last-Modified: Tue, 26 Oct 2010 09:39:27 GMT'
[http @ 0x2756c80] header='Vary: Accept-Encoding'
[http @ 0x2756c80] header='ETag: "4cc6a1cf-b50b"'
[http @ 0x2756c80] header='Expires: Mon, 21 Sep 2015 13:26:24 GMT'
[http @ 0x2756c80] header='Cache-Control: max-age=604800'
[http @ 0x2756c80] header='Access-Control-Allow-Origin: *'
[http @ 0x2756c80] header='Cache-Control: public'
[http @ 0x2756c80] header='Content-Range: bytes 0-46346/46347'
[http @ 0x2756c80] header=''
Probing mp3 score:1 size:2048
Probing jpeg_pipe score:6 size:2048
Probing mp3 score:1 size:4096
Probing jpeg_pipe score:6 size:4096
Probing mp3 score:1 size:8192
Probing jpeg_pipe score:6 size:8192
Probing mp3 score:1 size:16384
Probing jpeg_pipe score:6 size:16384
Probing jpeg_pipe score:6 size:32768
Probing jpeg_pipe score:51 size:46347
[jpeg_pipe @ 0x2756380] Format jpeg_pipe probed with size=65536 and score=51
[jpeg_pipe @ 0x2756380] Before avformat_find_stream_info() pos: 0 bytes read:46347 seeks:0
[mjpeg @ 0x275b420] marker=d8 avail_size_in_buf=46345
[mjpeg @ 0x275b420] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x275b420] marker=e0 avail_size_in_buf=46343
[mjpeg @ 0x275b420] marker parser used 16 bytes (128 bits)
[mjpeg @ 0x275b420] marker=ed avail_size_in_buf=46325
[mjpeg @ 0x275b420] marker parser used 5401 bytes (43208 bits)
[mjpeg @ 0x275b420] marker=e1 avail_size_in_buf=40921
[mjpeg @ 0x275b420] marker parser used 5806 bytes (46448 bits)
[mjpeg @ 0x275b420] marker=db avail_size_in_buf=35112
[mjpeg @ 0x275b420] index=0
[mjpeg @ 0x275b420] qscale[0]: 2
[mjpeg @ 0x275b420] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x275b420] marker=db avail_size_in_buf=35043
[mjpeg @ 0x275b420] index=1
[mjpeg @ 0x275b420] qscale[1]: 5
[mjpeg @ 0x275b420] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x275b420] marker=c0 avail_size_in_buf=34974
[mjpeg @ 0x275b420] sof0: picture: 386x600
[mjpeg @ 0x275b420] component 0 2:2 id: 0 quant:0
[mjpeg @ 0x275b420] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x275b420] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x275b420] pix fmt id 22111100
[mjpeg @ 0x275b420] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x275b420] marker=c4 avail_size_in_buf=34955
[mjpeg @ 0x275b420] class=0 index=0 nb_codes=10
[mjpeg @ 0x275b420] marker parser used 29 bytes (232 bits)
[mjpeg @ 0x275b420] marker=c4 avail_size_in_buf=34924
[mjpeg @ 0x275b420] class=1 index=0 nb_codes=242
[mjpeg @ 0x275b420] marker parser used 71 bytes (568 bits)
[mjpeg @ 0x275b420] marker=c4 avail_size_in_buf=34851
[mjpeg @ 0x275b420] class=0 index=1 nb_codes=7
[mjpeg @ 0x275b420] marker parser used 26 bytes (208 bits)
[mjpeg @ 0x275b420] marker=c4 avail_size_in_buf=34823
[mjpeg @ 0x275b420] class=1 index=1 nb_codes=114
[mjpeg @ 0x275b420] marker parser used 40 bytes (320 bits)
[mjpeg @ 0x275b420] escaping removed 111 bytes
[mjpeg @ 0x275b420] marker=da avail_size_in_buf=34781
[mjpeg @ 0x275b420] component: 0
[mjpeg @ 0x275b420] component: 1
[mjpeg @ 0x275b420] component: 2
[mjpeg @ 0x275b420] marker parser used 34669 bytes (277350 bits)
[mjpeg @ 0x275b420] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x275b420] decode frame unused 0 bytes
[jpeg_pipe @ 0x2756380] 0: start_time: -9223372036854.775 duration: -9223372036854.775
[jpeg_pipe @ 0x2756380] stream: start_time: -9223372036854.775 duration: -9223372036854.775 bitrate=0 kb/s
[jpeg_pipe @ 0x2756380] After avformat_find_stream_info() pos: 46347 bytes read:46347 seeks:0 frames:1
Input #0, jpeg_pipe, from 'http://film.wp.pl/i,251347,e,jpg,galleryphoto':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 1, 1/25: Video: mjpeg, 1 reference frame, yuvj420p(pc, bt470bg/unknown/unknown, center), 386x600 [SAR 476:476 DAR 193:300], 1/25, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file /dev/null.
Applying option f (force format) with argument mjpeg.
Successfully parsed a group of options.
Opening an output file: /dev/null.
Successfully opened the file.
detected 2 logical cores
[graph 0 input from stream 0:0 @ 0x2761700] Setting 'video_size' to value '386x600'
[graph 0 input from stream 0:0 @ 0x2761700] Setting 'pix_fmt' to value '12'
[graph 0 input from stream 0:0 @ 0x2761700] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x2761700] Setting 'pixel_aspect' to value '476/476'
[graph 0 input from stream 0:0 @ 0x2761700] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x2761700] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x2761700] w:386 h:600 pixfmt:yuvj420p tb:1/25 fr:25/1 sar:476/476 sws_param:flags=2
[format @ 0x2761860] compat: called with args=[yuvj420p|yuvj422p|yuvj444p]
[format @ 0x2761860] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p'
[AVFilterGraph @ 0x2760b20] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[mjpeg @ 0x275d9c0] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores
[mjpeg @ 0x275d9c0] intra_quant_bias = 96 inter_quant_bias = 0
Output #0, mjpeg, to '/dev/null':
  Metadata:
    encoder         : Lavf57.0.100
    Stream #0:0, 0, 1/25: Video: mjpeg, 1 reference frame, yuvj420p(pc, center), 386x600 [SAR 476:476 DAR 193:300], 1/25, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.1.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[mjpeg @ 0x275b940] marker=d8 avail_size_in_buf=46345
[mjpeg @ 0x275b940] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x275b940] marker=e0 avail_size_in_buf=46343
[mjpeg @ 0x275b940] marker parser used 16 bytes (128 bits)
[mjpeg @ 0x275b940] marker=ed avail_size_in_buf=46325
[mjpeg @ 0x275b940] marker parser used 5401 bytes (43208 bits)
[mjpeg @ 0x275b940] marker=e1 avail_size_in_buf=40921
[mjpeg @ 0x275b940] marker parser used 5806 bytes (46448 bits)
[mjpeg @ 0x275b940] marker=db avail_size_in_buf=35112
[mjpeg @ 0x275b940] index=0
[mjpeg @ 0x275b940] qscale[0]: 2
[mjpeg @ 0x275b940] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x275b940] marker=db avail_size_in_buf=35043
[mjpeg @ 0x275b940] index=1
[mjpeg @ 0x275b940] qscale[1]: 5
[mjpeg @ 0x275b940] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x275b940] marker=c0 avail_size_in_buf=34974
[mjpeg @ 0x275b940] sof0: picture: 386x600
[mjpeg @ 0x275b940] component 0 2:2 id: 0 quant:0
[mjpeg @ 0x275b940] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x275b940] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x275b940] pix fmt id 22111100
[mjpeg @ 0x275b940] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x275b940] marker=c4 avail_size_in_buf=34955
[mjpeg @ 0x275b940] class=0 index=0 nb_codes=10
[mjpeg @ 0x275b940] marker parser used 29 bytes (232 bits)
[mjpeg @ 0x275b940] marker=c4 avail_size_in_buf=34924
[mjpeg @ 0x275b940] class=1 index=0 nb_codes=242
[mjpeg @ 0x275b940] marker parser used 71 bytes (568 bits)
[mjpeg @ 0x275b940] marker=c4 avail_size_in_buf=34851
[mjpeg @ 0x275b940] class=0 index=1 nb_codes=7
[mjpeg @ 0x275b940] marker parser used 26 bytes (208 bits)
[mjpeg @ 0x275b940] marker=c4 avail_size_in_buf=34823
[mjpeg @ 0x275b940] class=1 index=1 nb_codes=114
[mjpeg @ 0x275b940] marker parser used 40 bytes (320 bits)
[mjpeg @ 0x275b940] escaping removed 111 bytes
[mjpeg @ 0x275b940] marker=da avail_size_in_buf=34781
[mjpeg @ 0x275b940] component: 0
[mjpeg @ 0x275b940] component: 1
[mjpeg @ 0x275b940] component: 2
[mjpeg @ 0x275b940] marker parser used 34669 bytes (277350 bits)
[mjpeg @ 0x275b940] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x275b940] decode frame unused 0 bytes
Cliping frame in rate conversion by 0.000008
[output stream 0:0 @ 0x2761ee0] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
frame=    1 fps=0.0 q=5.8 Lsize=      23kB time=00:00:00.04 bitrate=4647.0kbits/s
video:23kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (http://film.wp.pl/i,251347,e,jpg,galleryphoto):
  Input stream #0:0 (video): 1 packets read (46347 bytes); 1 frames decoded;
  Total: 1 packets (46347 bytes) demuxed
Output file #0 (/dev/null):
  Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (23235 bytes);
  Total: 1 packets (23235 bytes) muxed
1 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x275c4c0] Statistics: 0 seeks, 1 writeouts
[AVIOContext @ 0x275a2a0] Statistics: 46347 bytes read, 0 seeks

Same happens - only 1 GET request - when remote file extension isn't available:

$  ./ffmpeg -y -loglevel trace -i http://api.pudelek.pl.sds.o2.pl/98c520fa7cc46cf556f21dcf8067ea5a3acd2f90.jpg_apiv4_1082_748 -f mjpeg /dev/null -f mjpeg /dev/null
ffmpeg version N-75278-ga8bedd5 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
  configuration: --prefix=/home/pszemus/ffmpeg-2.8/build --enable-pic --enable-pthreads --enable-libmp3lame --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-gpl --enable-nonfree --enable-libvpx --enable-libvorbis --enable-libx264 --pkg-config-flags=--static --enable-protocol=https --enable-openssl --extra-cflags=-I/opt/WP/common.libs/inc --extra-ldflags='-L/opt/WP/common.libs/lib -ldl'
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  1.100 / 57.  1.100
  libavformat    57.  0.100 / 57.  0.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  3.100 /  6.  3.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Reading option '-i' ... matched as input file with argument 'http://api.pudelek.pl.sds.o2.pl/98c520fa7cc46cf556f21dcf8067ea5a3acd2f90.jpg_apiv4_1082_748'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mjpeg'.
Reading option '/dev/null' ... matched as output file.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mjpeg'.
Reading option '/dev/null' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input file http://api.pudelek.pl.sds.o2.pl/98c520fa7cc46cf556f21dcf8067ea5a3acd2f90.jpg_apiv4_1082_748.
Successfully parsed a group of options.
Opening an input file: http://api.pudelek.pl.sds.o2.pl/98c520fa7cc46cf556f21dcf8067ea5a3acd2f90.jpg_apiv4_1082_748.
[http @ 0x2b09d60] request: GET /98c520fa7cc46cf556f21dcf8067ea5a3acd2f90.jpg_apiv4_1082_748 HTTP/1.1
User-Agent: Lavf/57.0.100
Accept: */*
Range: bytes=0-
Connection: close
Host: api.pudelek.pl.sds.o2.pl
Icy-MetaData: 1


[http @ 0x2b09d60] header='HTTP/1.1 200 Ok'
[http @ 0x2b09d60] http_code=200
[http @ 0x2b09d60] header='Date: Mon, 14 Sep 2015 13:40:05 GMT'
[http @ 0x2b09d60] header='x-sds-request-id: 10431C12'
[http @ 0x2b09d60] header='Connection: close'
[http @ 0x2b09d60] header='x-sds-rp: fc24px:2/bc18'
[http @ 0x2b09d60] header='ETag: "486e2d7091df665fa094987f5a6c3001"'
[http @ 0x2b09d60] header='Accept-Ranges: bytes'
[http @ 0x2b09d60] header='Last-Modified: Wed, 09 Sep 2015 20:04:01 GMT'
[http @ 0x2b09d60] header='Content-Type: image/jpeg'
[http @ 0x2b09d60] header='Content-Length: 38042'
[http @ 0x2b09d60] header='Server: sds 1.3'
[http @ 0x2b09d60] header=''
Probing jpeg_pipe score:6 size:2048
Probing jpeg_pipe score:6 size:4096
Probing jpeg_pipe score:6 size:8192
Probing jpeg_pipe score:6 size:16384
Probing jpeg_pipe score:6 size:32768
Probing jpeg_pipe score:51 size:38042
[jpeg_pipe @ 0x2b09540] Format jpeg_pipe probed with size=65536 and score=51
[jpeg_pipe @ 0x2b09540] Before avformat_find_stream_info() pos: 0 bytes read:38042 seeks:0
[mjpeg @ 0x2b0e0a0] marker=d8 avail_size_in_buf=38040
[mjpeg @ 0x2b0e0a0] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x2b0e0a0] marker=e0 avail_size_in_buf=38038
[mjpeg @ 0x2b0e0a0] marker parser used 16 bytes (128 bits)
[mjpeg @ 0x2b0e0a0] marker=db avail_size_in_buf=38020
[mjpeg @ 0x2b0e0a0] index=0
[mjpeg @ 0x2b0e0a0] qscale[0]: 3
[mjpeg @ 0x2b0e0a0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x2b0e0a0] marker=db avail_size_in_buf=37951
[mjpeg @ 0x2b0e0a0] index=1
[mjpeg @ 0x2b0e0a0] qscale[1]: 6
[mjpeg @ 0x2b0e0a0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x2b0e0a0] marker=c0 avail_size_in_buf=37882
[mjpeg @ 0x2b0e0a0] sof0: picture: 623x431
[mjpeg @ 0x2b0e0a0] component 0 2:2 id: 0 quant:0
[mjpeg @ 0x2b0e0a0] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x2b0e0a0] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x2b0e0a0] pix fmt id 22111100
[mjpeg @ 0x2b0e0a0] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x2b0e0a0] marker=c4 avail_size_in_buf=37863
[mjpeg @ 0x2b0e0a0] class=0 index=0 nb_codes=12
[mjpeg @ 0x2b0e0a0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0x2b0e0a0] marker=c4 avail_size_in_buf=37830
[mjpeg @ 0x2b0e0a0] class=1 index=0 nb_codes=251
[mjpeg @ 0x2b0e0a0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0x2b0e0a0] marker=c4 avail_size_in_buf=37647
[mjpeg @ 0x2b0e0a0] class=0 index=1 nb_codes=12
[mjpeg @ 0x2b0e0a0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0x2b0e0a0] marker=c4 avail_size_in_buf=37614
[mjpeg @ 0x2b0e0a0] class=1 index=1 nb_codes=251
[mjpeg @ 0x2b0e0a0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0x2b0e0a0] escaping removed 117 bytes
[mjpeg @ 0x2b0e0a0] marker=da avail_size_in_buf=37431
[mjpeg @ 0x2b0e0a0] component: 0
[mjpeg @ 0x2b0e0a0] component: 1
[mjpeg @ 0x2b0e0a0] component: 2
[mjpeg @ 0x2b0e0a0] marker parser used 37313 bytes (298500 bits)
[mjpeg @ 0x2b0e0a0] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x2b0e0a0] decode frame unused 0 bytes
[jpeg_pipe @ 0x2b09540] 0: start_time: -9223372036854.775 duration: -9223372036854.775
[jpeg_pipe @ 0x2b09540] stream: start_time: -9223372036854.775 duration: -9223372036854.775 bitrate=0 kb/s
[jpeg_pipe @ 0x2b09540] After avformat_find_stream_info() pos: 38042 bytes read:38042 seeks:0 frames:1
Input #0, jpeg_pipe, from 'http://api.pudelek.pl.sds.o2.pl/98c520fa7cc46cf556f21dcf8067ea5a3acd2f90.jpg_apiv4_1082_748':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 1, 1/25: Video: mjpeg, 1 reference frame, yuvj420p(pc, bt470bg/unknown/unknown, center), 623x431 [SAR 1:1 DAR 623:431], 1/25, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file /dev/null.
Applying option f (force format) with argument mjpeg.
Successfully parsed a group of options.
Opening an output file: /dev/null.
Successfully opened the file.
Parsing a group of options: output file /dev/null.
Applying option f (force format) with argument mjpeg.
Successfully parsed a group of options.
Opening an output file: /dev/null.
Successfully opened the file.
detected 2 logical cores
[graph 0 input from stream 0:0 @ 0x2b14f60] Setting 'video_size' to value '623x431'
[graph 0 input from stream 0:0 @ 0x2b14f60] Setting 'pix_fmt' to value '12'
[graph 0 input from stream 0:0 @ 0x2b14f60] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x2b14f60] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x2b14f60] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x2b14f60] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x2b14f60] w:623 h:431 pixfmt:yuvj420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[format @ 0x2b29f80] compat: called with args=[yuvj420p|yuvj422p|yuvj444p]
[format @ 0x2b29f80] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p'
[AVFilterGraph @ 0x2b152e0] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[graph 1 input from stream 0:0 @ 0x2b2a300] Setting 'video_size' to value '623x431'
[graph 1 input from stream 0:0 @ 0x2b2a300] Setting 'pix_fmt' to value '12'
[graph 1 input from stream 0:0 @ 0x2b2a300] Setting 'time_base' to value '1/25'
[graph 1 input from stream 0:0 @ 0x2b2a300] Setting 'pixel_aspect' to value '1/1'
[graph 1 input from stream 0:0 @ 0x2b2a300] Setting 'sws_param' to value 'flags=2'
[graph 1 input from stream 0:0 @ 0x2b2a300] Setting 'frame_rate' to value '25/1'
[graph 1 input from stream 0:0 @ 0x2b2a300] w:623 h:431 pixfmt:yuvj420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[format @ 0x2b2b560] compat: called with args=[yuvj420p|yuvj422p|yuvj444p]
[format @ 0x2b2b560] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p'
[AVFilterGraph @ 0x2b2bb60] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[mjpeg @ 0x2b106e0] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores
[mjpeg @ 0x2b106e0] intra_quant_bias = 96 inter_quant_bias = 0
[mjpeg @ 0x2b148e0] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores
[mjpeg @ 0x2b148e0] intra_quant_bias = 96 inter_quant_bias = 0
Output #0, mjpeg, to '/dev/null':
  Metadata:
    encoder         : Lavf57.0.100
    Stream #0:0, 0, 1/25: Video: mjpeg, 1 reference frame, yuvj420p(pc, center), 623x431 [SAR 1:1 DAR 623:431], 1/25, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.1.100 mjpeg
Output #1, mjpeg, to '/dev/null':
  Metadata:
    encoder         : Lavf57.0.100
    Stream #1:0, 0, 1/25: Video: mjpeg, 1 reference frame, yuvj420p(pc, center), 623x431 [SAR 1:1 DAR 623:431], 1/25, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.1.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
  Stream #0:0 -> #1:0 (mjpeg (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[mjpeg @ 0x2b0e9a0] marker=d8 avail_size_in_buf=38040
[mjpeg @ 0x2b0e9a0] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x2b0e9a0] marker=e0 avail_size_in_buf=38038
[mjpeg @ 0x2b0e9a0] marker parser used 16 bytes (128 bits)
[mjpeg @ 0x2b0e9a0] marker=db avail_size_in_buf=38020
[mjpeg @ 0x2b0e9a0] index=0
[mjpeg @ 0x2b0e9a0] qscale[0]: 3
[mjpeg @ 0x2b0e9a0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x2b0e9a0] marker=db avail_size_in_buf=37951
[mjpeg @ 0x2b0e9a0] index=1
[mjpeg @ 0x2b0e9a0] qscale[1]: 6
[mjpeg @ 0x2b0e9a0] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x2b0e9a0] marker=c0 avail_size_in_buf=37882
[mjpeg @ 0x2b0e9a0] sof0: picture: 623x431
[mjpeg @ 0x2b0e9a0] component 0 2:2 id: 0 quant:0
[mjpeg @ 0x2b0e9a0] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x2b0e9a0] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x2b0e9a0] pix fmt id 22111100
[mjpeg @ 0x2b0e9a0] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x2b0e9a0] marker=c4 avail_size_in_buf=37863
[mjpeg @ 0x2b0e9a0] class=0 index=0 nb_codes=12
[mjpeg @ 0x2b0e9a0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0x2b0e9a0] marker=c4 avail_size_in_buf=37830
[mjpeg @ 0x2b0e9a0] class=1 index=0 nb_codes=251
[mjpeg @ 0x2b0e9a0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0x2b0e9a0] marker=c4 avail_size_in_buf=37647
[mjpeg @ 0x2b0e9a0] class=0 index=1 nb_codes=12
[mjpeg @ 0x2b0e9a0] marker parser used 31 bytes (248 bits)
[mjpeg @ 0x2b0e9a0] marker=c4 avail_size_in_buf=37614
[mjpeg @ 0x2b0e9a0] class=1 index=1 nb_codes=251
[mjpeg @ 0x2b0e9a0] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0x2b0e9a0] escaping removed 117 bytes
[mjpeg @ 0x2b0e9a0] marker=da avail_size_in_buf=37431
[mjpeg @ 0x2b0e9a0] component: 0
[mjpeg @ 0x2b0e9a0] component: 1
[mjpeg @ 0x2b0e9a0] component: 2
[mjpeg @ 0x2b0e9a0] marker parser used 37313 bytes (298500 bits)
[mjpeg @ 0x2b0e9a0] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x2b0e9a0] decode frame unused 0 bytes
Cliping frame in rate conversion by 0.000008
    Last message repeated 1 times
[output stream 0:0 @ 0x2b2a400] EOF on sink link output stream 0:0:default.
[output stream 1:0 @ 0x2b2b1a0] EOF on sink link output stream 1:0:default.
No more output streams to write to, finishing.
frame=    1 fps=0.0 q=5.8 Lq=5.8 size=      28kB time=00:00:00.04 bitrate=5662.4kbits/s
video:55kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (http://api.pudelek.pl.sds.o2.pl/98c520fa7cc46cf556f21dcf8067ea5a3acd2f90.jpg_apiv4_1082_748):
  Input stream #0:0 (video): 1 packets read (38042 bytes); 1 frames decoded;
  Total: 1 packets (38042 bytes) demuxed
Output file #0 (/dev/null):
  Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (28312 bytes);
  Total: 1 packets (28312 bytes) muxed
Output file #1 (/dev/null):
  Output stream #1:0 (video): 1 frames encoded; 1 packets muxed (28312 bytes);
  Total: 1 packets (28312 bytes) muxed
1 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x2b13580] Statistics: 0 seeks, 1 writeouts
[AVIOContext @ 0x2b14e40] Statistics: 0 seeks, 1 writeouts
[AVIOContext @ 0x2b15520] Statistics: 38042 bytes read, 0 seeks

Why dows FFmpeg need to perform 3 HTTP GET requests for every JPG image:
http://i.wp.pl/a/f/film/033/47/13/0251347.jpg
http://i2.cdn.turner.com/cnnnext/dam/assets/150914044245-swim-europe-1-exlarge-169.jpg
https://www.yahoo.com/sy/nn/fp/rsz/091415/images/smush/kimdavis-work_635x250_1442234261.jpg

I know that those are Byte-range requests but the file descriptor (nor connection) isn't reused.

Change History (6)

comment:1 Changed 3 years ago by pszemus

I'm just thinking, if fd could be shared between all successive tcp_read invokes then tcp_open could be invoked only once and the recv function could make use of the MSG_PEEK flag.

comment:2 Changed 3 years ago by pszemus

Another thought - if I force jpeg_pipe input format like this:

./ffmpeg -y -loglevel trace -f jpeg_pipe -i http://i.wp.pl/a/f/jpeg/34436/01_wstep.jpeg 2>&1 | grep GET
[http @ 0x2b0aba0] request: GET /a/f/jpeg/34436/01_wstep.jpeg HTTP/1.1

FFmpeg opens only 1 connection and sends only 1 GET request.
If I force image2 input format. It sends 2 GET requests.

comment:3 Changed 3 years ago by pszemus

I've figured it's because the image2 demuxer has AVFMT_NOFILE flag set. Because of that, the remote jpg file is requested again (the if clause is true in libavformat/img2dec.c:226).
I would suspect that remote jpg files are requested only once. To accomplish this I'm thinking about removing the AVFMT_NOFILE flag from the image2 demuxer for my use case.

Another solution for me would be to increase jpeg_pipe demuxer's score to be higher than AVPROBE_SCORE_EXTENSION.

Last edited 3 years ago by pszemus (previous) (diff)

comment:4 Changed 3 years ago by pszemus

But all of the above still brakes down to one thing: FFmpeg doesn't reuse the data it got earlier (vide: 3 GET requests).

Last edited 3 years ago by pszemus (previous) (diff)

comment:5 Changed 3 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords http image2 added
  • Version changed from unspecified to git-master

comment:6 Changed 3 years ago by michael

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.