Opened 3 years ago

Closed 3 years ago

#4841 closed enhancement (fixed)

Cannot autodetect mjpeg files with unexpected bytes within APP13 tag

Reported by: pszemus Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: mjpeg
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

FFmpeg is unable to detect input format when input is a remote http resource, without file extension, accessed via redirection, e.g. http://film.wp.pl/i,251347,e,jpg,galleryphoto

I think FFmpeg should follow the HTTP response's Location header or use Content-Type header to probe correct input format.

$ ./ffmpeg -loglevel trace -i http://film.wp.pl/i,251347,e,jpg,galleryphoto
ffmpeg version N-75149-gbbc8fca 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/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.  1.100 / 55.  1.100
  libavcodec     57.  1.100 / 57.  1.100
  libavformat    57.  0.100 / 57.  0.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  1.100 /  6.  1.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 '-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'.
Finished splitting the commandline.
Parsing a group of options: global .
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 @ 0x217ab40] 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 @ 0x217ab40] header='HTTP/1.1 301 Moved Permanently'
[http @ 0x217ab40] http_code=301
[http @ 0x217ab40] header='Server: aris'
[http @ 0x217ab40] header='Set-Cookie: _lastUsedServices=globals%2Cphp2javaTiming%2CdatasourceFactory%2Cphpinfo; expires=Sat, 10-Oct-2015 10:01:59 GMT'
[http @ 0x217ab40] header='Location: http://i.wp.pl/a/f/film/033/47/13/0251347.jpg'
[http @ 0x217ab40] header='Content-type: text/html'
[http @ 0x217ab40] header='Set-Cookie: statid=212.77.105.136.10226:1441879319:540538055:v1; path=/; expires=Sun, 09-Sep-18 10:01:59 GMT'
[http @ 0x217ab40] header='Set-Cookie: statid=212.77.105.136.10226:1441879319:540538055:v1; domain=.wp.pl; path=/; expires=Sun, 09-Sep-18 10:01:59 GMT'
[http @ 0x217ab40] header='Content-Length: 12281'
[http @ 0x217ab40] header='Connection: close'
[http @ 0x217ab40] header=''
[http @ 0x217abe0] Invalid cookie found, no value, path or domain specified
[http @ 0x217ab40] 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.10226:1441879319:540538055:v1
Icy-MetaData: 1


[http @ 0x217ab40] header='HTTP/1.1 206 Partial Content'
[http @ 0x217ab40] http_code=206
[http @ 0x217ab40] header='Server: nginx'
[http @ 0x217ab40] header='Date: Thu, 10 Sep 2015 10:01:59 GMT'
[http @ 0x217ab40] header='Content-Type: image/jpeg'
[http @ 0x217ab40] header='Content-Length: 46347'
[http @ 0x217ab40] header='Connection: close'
[http @ 0x217ab40] header='Last-Modified: Tue, 26 Oct 2010 09:39:27 GMT'
[http @ 0x217ab40] header='Vary: Accept-Encoding'
[http @ 0x217ab40] header='ETag: "4cc6a1cf-b50b"'
[http @ 0x217ab40] header='Expires: Thu, 17 Sep 2015 10:01:59 GMT'
[http @ 0x217ab40] header='Cache-Control: max-age=604800'
[http @ 0x217ab40] header='Access-Control-Allow-Origin: *'
[http @ 0x217ab40] header='Cache-Control: public'
[http @ 0x217ab40] header='Content-Range: bytes 0-46346/46347'
[http @ 0x217ab40] header=''
Probing mp3 score:1 size:2048
Probing mp3 score:1 size:4096
Probing mp3 score:1 size:8192
Probing mp3 score:1 size:16384
[AVIOContext @ 0x217e480] Statistics: 46347 bytes read, 0 seeks
http://film.wp.pl/i,251347,e,jpg,galleryphoto: Invalid data found when processing input

Attachments (1)

galleryphoto (45.3 KB) - added by cehoyos 3 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 3 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords mjpeg added
  • Priority changed from normal to wish
  • Reproduced by developer set
  • Status changed from new to open
  • Summary changed from Cannot detect format after http redirection to Cannot autodetect mjpeg files with unexpected bytes within APP13 tag
  • Type changed from defect to enhancement
  • Version changed from unspecified to git-master

Changed 3 years ago by cehoyos

comment:2 Changed 3 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed

Should be fixed in e3e55758dcf6e7801e9402df2cb734c19d0ea314 - thank you for the report!

Note: See TracTickets for help on using tickets.