Opened 9 years ago

Closed 9 years ago

#4671 closed defect (fixed)

fix reference quicktime movie reading

Reported by: verem Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mov regression
Cc: Michael Niedermayer Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Hi,

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

[root@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@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@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?

Change History (8)

comment:1 by Carl Eugen Hoyos, 9 years ago

Keywords: mov added
Resolution: wontfix
Status: newclosed

You describe the expected behaviour, sorry. To change it, a discussion on the development mailing list is necessary, not here.

Feel free to provide your reference input file though, that would help.

comment:2 by verem, 9 years ago

that was working for years...

approx at 2009-10-04 i introduced a patch that support reading of reference quicktime movies, but somebody broke it two months ago

anyway, it also posted to https://ffmpeg.org/pipermail/ffmpeg-devel/2015-June/174578.html

comment:3 by Michael Niedermayer, 9 years ago

where can i find/download/obtain the failing mov file(s) ?

comment:4 by Michael Niedermayer, 9 years ago

Cc: Michael Niedermayer added

comment:5 by verem, 9 years ago

reference MOV files created some years ago for testing and implementing reference movie reading could be downloaded at http://downloads.m1stereo.tv/052e79aaa1e304c103b966f267f06bd1/dir1.tar.bz2

the question is: where are a movies with undocumented type==18 was mentioned in https://patches.libav.org/patch/57253/

they (people that break this functionality) also thinking about reverting that patch:
https://lists.libav.org/pipermail/libav-devel/2015-July/070575.html

comment:6 by Carl Eugen Hoyos, 9 years ago

Keywords: regression added
Priority: normalimportant
Reproduced by developer: set
Resolution: wontfixfixed

comment:7 by Carl Eugen Hoyos, 9 years ago

Resolution: fixed
Status: closedreopened

Sorry, the files movie5.mov, movie5a.mov, movie6.mov and movie7.mov still fail.

comment:8 by Michael Niedermayer, 9 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.