[FFmpeg-trac] #4671(avformat:new): fix reference quicktime movie reading

FFmpeg trac at avcodec.org
Thu Jun 25 09:03:59 CEST 2015


#4671: fix reference quicktime movie reading
----------------------------------+--------------------------------------
             Reporter:  verem     |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avformat  |                  Version:  git-master
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+--------------------------------------
 Hi,

 i noticed that ffmpeg from latest git stop decoding all reference mov
 files:

 {{{
 [root at dev-5 data]# ffmpeg -debug 3 -i BNC123914.mov -y q.mp4
 ffmpeg version N-73128-g5a1f785 Copyright (c) 2000-2015 the FFmpeg
 developers
   built with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
   configuration: --prefix=/usr/local/enctools --enable-debug=3 --extra-
 cflags='-O0 -ggdb -I/usr/local/enctools/include' --extra-
 ldflags=-L/usr/local/enctools/lib --enable-shared --enable-gpl --enable-
 version3 --enable-nonfree --enable-avfilter --enable-pthreads --enable-
 bzlib --enable-zlib --enable-libfaac --enable-libmp3lame --enable-libspeex
 --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid
 --enable-libfreetype --disable-stripping
   libavutil      54. 27.100 / 54. 27.100
   libavcodec     56. 44.101 / 56. 44.101
   libavformat    56. 38.101 / 56. 38.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 18.100 /  5. 18.100
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  2.100 /  1.  2.100
   libpostproc    53.  3.100 / 53.  3.100
  matched as AVOption 'debug' with argument '3'.
 Reading option '-i' ... matched as input file with argument
 'BNC123914.mov'.
 Reading option '-y' ... matched as option 'y' (overwrite output files)
 with argument '1'.
 Reading option 'q.mp4' ... matched as output file.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option y (overwrite output files) with argument 1.
 Successfully parsed a group of options.
 Parsing a group of options: input file BNC123914.mov.
 Successfully parsed a group of options.
 Opening an input file: BNC123914.mov.
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Format mov,mp4,m4a,3gp,3g2,mj2
 probed with size=2048 and score=50
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] volume f, len 1
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] filename BNC123914.dv, len 12
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] nlvl from 1, nlvl to 2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 0, len 9
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] dir media.dir
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 2, len 73
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] path
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 11, len 5
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type -1, len 0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Absolute path
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv
 not tried for security reasons, set demuxer option use_absolute_path to
 allow absolute paths
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] stream 0, error opening alias:
 path='/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv',
 dir='media.dir', filename='BNC123914.dv', volume='f', nlvl_from=1,
 nlvl_to=2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] volume f, len 1
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] filename BNC123914.aiff, len 14
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] nlvl from 1, nlvl to 2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 0, len 9
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] dir media.dir
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 2, len 75
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] path
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 11, len 5
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type -1, len 0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Absolute path
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff
 not tried for security reasons, set demuxer option use_absolute_path to
 allow absolute paths
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] stream 1, error opening alias:
 path='/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff',
 dir='media.dir', filename='BNC123914.aiff', volume='f', nlvl_from=1,
 nlvl_to=2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Before avformat_find_stream_info()
 pos: 14936 bytes read:14936 seeks:0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Could not find codec parameters for
 stream 0 (Video: dvvideo, 1 reference frame (dvcp / 0x70637664),
 none(topleft), 720x576, 1/600, 28800 kb/s): unspecified pixel format
 Consider increasing the value for the 'analyzeduration' and 'probesize'
 options
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] After avformat_find_stream_info()
 pos: 14936 bytes read:14936 seeks:0 frames:0
 Guessed Channel Layout for  Input Stream #0.1 : stereo
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BNC123914.mov':
   Metadata:
     creation_time   : 2015-06-16 12:10:52
     encoder         : Omneon OmMedia.dll 4.7.0 05-18-2007
 18:45:32,ex={0,-1},rng={0,-1,0},trimAu,exPre
     encoder-eng     : Omneon OmMedia.dll 4.7.0 05-18-2007
 18:45:32,ex={0,-1},rng={0,-1,0},trimAu,exPre
   Duration: 00:00:30.00, bitrate: 3 kb/s
     Stream #0:0(eng), 0, 1/600: Video: dvvideo, 1 reference frame (dvcp /
 0x70637664), none(topleft), 720x576, 1/600, 28800 kb/s, 25 fps, 25 tbr,
 600 tbn, 600 tbc (default)
     Metadata:
       creation_time   : 2015-06-16 12:11:12
       handler_name    : Apple Alias Data Handler
       encoder         : DV - PAL
     Stream #0:1(eng), 0, 1/48000: Audio: pcm_s16be (twos / 0x736F7774),
 48000 Hz, 2 channels, s16, 1536 kb/s (default)
     Metadata:
       creation_time   : 2015-06-16 12:11:12
       handler_name    : Apple Alias Data Handler
 Successfully opened the file.
 Parsing a group of options: output file q.mp4.
 Successfully parsed a group of options.
 Opening an output file: q.mp4.
 Successfully opened the file.
 detected 4 logical cores
 [graph 0 input from stream 0:0 @ 0x20a5880] Setting 'video_size' to value
 '720x576'
 [graph 0 input from stream 0:0 @ 0x20a5880] Setting 'pix_fmt' to value
 '-1'
 [buffer @ 0x20b00c0] Unable to parse option value "-1" as pixel format
 [graph 0 input from stream 0:0 @ 0x20a5880] Setting 'time_base' to value
 '1/600'
 [graph 0 input from stream 0:0 @ 0x20a5880] Setting 'pixel_aspect' to
 value '0/1'
 [graph 0 input from stream 0:0 @ 0x20a5880] Setting 'sws_param' to value
 'flags=2'
 [graph 0 input from stream 0:0 @ 0x20a5880] Setting 'frame_rate' to value
 '25/1'
 [buffer @ 0x20b00c0] Unable to parse option value "-1" as pixel format
 [buffer @ 0x20b00c0] Error setting option pix_fmt to value -1.
 [graph 0 input from stream 0:0 @ 0x20a5880] Error applying options to the
 filter.
 Error opening filters!
 [AVIOContext @ 0x20cd5c0] Statistics: 0 seeks, 0 writeouts
 [AVIOContext @ 0x20b9bc0] Statistics: 14936 bytes read, 0 seeks
 }}}

 submitting flag *use_absolute_path* does not help:

 {{{
 [root at dev-5 data]# ffmpeg -debug 3 -use_absolute_path 0 -i BNC123914.mov
 -y q.mp4
 ffmpeg version N-73128-g5a1f785 Copyright (c) 2000-2015 the FFmpeg
 developers
   built with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
   configuration: --prefix=/usr/local/enctools --enable-debug=3 --extra-
 cflags='-O0 -ggdb -I/usr/local/enctools/include' --extra-
 ldflags=-L/usr/local/enctools/lib --enable-shared --enable-gpl --enable-
 version3 --enable-nonfree --enable-avfilter --enable-pthreads --enable-
 bzlib --enable-zlib --enable-libfaac --enable-libmp3lame --enable-libspeex
 --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid
 --enable-libfreetype --disable-stripping
   libavutil      54. 27.100 / 54. 27.100
   libavcodec     56. 44.101 / 56. 44.101
   libavformat    56. 38.101 / 56. 38.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 18.100 /  5. 18.100
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  2.100 /  1.  2.100
   libpostproc    53.  3.100 / 53.  3.100
  matched as AVOption 'debug' with argument '3'.
 Reading option '-use_absolute_path' ... matched as AVOption
 'use_absolute_path' with argument '0'.
 Reading option '-i' ... matched as input file with argument
 'BNC123914.mov'.
 Reading option '-y' ... matched as option 'y' (overwrite output files)
 with argument '1'.
 Reading option 'q.mp4' ... matched as output file.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option y (overwrite output files) with argument 1.
 Successfully parsed a group of options.
 Parsing a group of options: input file BNC123914.mov.
 Successfully parsed a group of options.
 Opening an input file: BNC123914.mov.
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] Format mov,mp4,m4a,3gp,3g2,mj2
 probed with size=2048 and score=50
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] volume f, len 1
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] filename BNC123914.dv, len 12
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] nlvl from 1, nlvl to 2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] type 0, len 9
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] dir media.dir
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] type 2, len 73
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] path
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] type 11, len 5
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] type -1, len 0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] Absolute path
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv
 not tried for security reasons, set demuxer option use_absolute_path to
 allow absolute paths
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] stream 0, error opening alias:
 path='/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv',
 dir='media.dir', filename='BNC123914.dv', volume='f', nlvl_from=1,
 nlvl_to=2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] volume f, len 1
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] filename BNC123914.aiff, len 14
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] nlvl from 1, nlvl to 2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] type 0, len 9
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] dir media.dir
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] type 2, len 75
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] path
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] type 11, len 5
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] type -1, len 0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] Absolute path
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff
 not tried for security reasons, set demuxer option use_absolute_path to
 allow absolute paths
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] stream 1, error opening alias:
 path='/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff',
 dir='media.dir', filename='BNC123914.aiff', volume='f', nlvl_from=1,
 nlvl_to=2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] Before avformat_find_stream_info()
 pos: 14936 bytes read:14936 seeks:0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] Could not find codec parameters for
 stream 0 (Video: dvvideo, 1 reference frame (dvcp / 0x70637664),
 none(topleft), 720x576, 1/600, 28800 kb/s): unspecified pixel format
 Consider increasing the value for the 'analyzeduration' and 'probesize'
 options
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fe92a0] After avformat_find_stream_info()
 pos: 14936 bytes read:14936 seeks:0 frames:0
 Guessed Channel Layout for  Input Stream #0.1 : stereo
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BNC123914.mov':
   Metadata:
     creation_time   : 2015-06-16 12:10:52
     encoder         : Omneon OmMedia.dll 4.7.0 05-18-2007
 18:45:32,ex={0,-1},rng={0,-1,0},trimAu,exPre
     encoder-eng     : Omneon OmMedia.dll 4.7.0 05-18-2007
 18:45:32,ex={0,-1},rng={0,-1,0},trimAu,exPre
   Duration: 00:00:30.00, bitrate: 3 kb/s
     Stream #0:0(eng), 0, 1/600: Video: dvvideo, 1 reference frame (dvcp /
 0x70637664), none(topleft), 720x576, 1/600, 28800 kb/s, 25 fps, 25 tbr,
 600 tbn, 600 tbc (default)
     Metadata:
       creation_time   : 2015-06-16 12:11:12
       handler_name    : Apple Alias Data Handler
       encoder         : DV - PAL
     Stream #0:1(eng), 0, 1/48000: Audio: pcm_s16be (twos / 0x736F7774),
 48000 Hz, 2 channels, s16, 1536 kb/s (default)
     Metadata:
       creation_time   : 2015-06-16 12:11:12
       handler_name    : Apple Alias Data Handler
 Successfully opened the file.
 Parsing a group of options: output file q.mp4.
 Successfully parsed a group of options.
 Opening an output file: q.mp4.
 Successfully opened the file.
 detected 4 logical cores
 [graph 0 input from stream 0:0 @ 0x1fdec40] Setting 'video_size' to value
 '720x576'
 [graph 0 input from stream 0:0 @ 0x1fdec40] Setting 'pix_fmt' to value
 '-1'
 [buffer @ 0x1fdea60] Unable to parse option value "-1" as pixel format
 [graph 0 input from stream 0:0 @ 0x1fdec40] Setting 'time_base' to value
 '1/600'
 [graph 0 input from stream 0:0 @ 0x1fdec40] Setting 'pixel_aspect' to
 value '0/1'
 [graph 0 input from stream 0:0 @ 0x1fdec40] Setting 'sws_param' to value
 'flags=2'
 [graph 0 input from stream 0:0 @ 0x1fdec40] Setting 'frame_rate' to value
 '25/1'
 [buffer @ 0x1fdea60] Unable to parse option value "-1" as pixel format
 [buffer @ 0x1fdea60] Error setting option pix_fmt to value -1.
 [graph 0 input from stream 0:0 @ 0x1fdec40] Error applying options to the
 filter.
 Error opening filters!
 [AVIOContext @ 0x1ffc540] Statistics: 0 seeks, 0 writeouts
 [AVIOContext @ 0x1fe8b20] Statistics: 14936 bytes read, 0 seeks
 }}}

 after investigation of latest patch i found that problem comes from *mov:
 Double-check that alias path is not an absolute path*
 http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=9286de045968ad456d4e752651eec22de5e89060

 *alis* contains all information: absolute path, relative search
 information. and yes, absolute path always contains slash

 simple solution is just drop slash check
 {{{
 rom fe7a4079e19ee2eba66a77c8f5bf03a11a6257a7 Mon Sep 17 00:00:00 2001
 From: Maksym Veremeyenko <verem at m1.tv>
 Date: Wed, 24 Jun 2015 19:57:09 +0300
 Subject: [PATCH] fix reference movie read

 ---
  libavformat/mov.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

 diff --git a/libavformat/mov.c b/libavformat/mov.c
 index 4762816..d1b0366 100644
 --- a/libavformat/mov.c
 +++ b/libavformat/mov.c
 @@ -2707,7 +2707,7 @@ static int mov_open_dref(MOVContext *c, AVIOContext
 **pb, const char *src, MOVDr

      /* try relative path, we do not try the absolute because it can leak
 information about our
         system to an attacker */
 -    if (ref->nlvl_to > 0 && ref->nlvl_from > 0 && ref->path[0] != '/') {
 +    if (ref->nlvl_to > 0 && ref->nlvl_from > 0) {
          char filename[1025];
          const char *src_path;
          int i, l;
 --
 1.7.7.6
 }}}

 moreover, flag *-use_absolute_path 1* is a input format (mov) dependent.
 i.e. if you need a simple thumbnail, you need to check if mov and only
 then submit *-use_absolute_path 1* flag.

 is it normal? i can fix it by setting this flag to 1 by default, but why
 somebodies paranoia prevent ffmpeg from normal behavior?

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4671>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list