[FFmpeg-user] Unable to read from stdin for certain .MOV files

Jesse Gordon tojesseg at gmail.com
Thu Nov 8 09:01:29 CET 2012


Good Day,

I seem unable to read with ffmpeg from stdin for .MOV files from my
Canon EOS T2I. It used to work in the past I know, but with recent
versions it hasn't.
(I tried reading another FLV file via -i - on stdin and that worked great.)
Reading the mov file with -i filename.mov works great.

I've tried today's git and I've tried -i - and -i pipe: and -i pipe:0
and all fail the same.

Am I doing something wrong, or is it broken?

Here's troublesome source file, right from my camera (under 4megs):

wget http://jesseg.nikola.com/cat.mov

(I've tried several different .MOV files from my camera and all have
same problem.)

(As a side note, ffplay only plays that cat.mov as a named file but
not as stdin, but it plays the created flv either way.)

(The reason I need to read from a pipe is because I'm intending to
convert user-uploaded video - which could theoretically buffer overrun
and exploit ffmpeg -- so I want to run ffmpeg as a user that has
neither read nor write permissions on the system to limit damage if
someone uploads a video that turns ffmpeg into a backdoor. I had it
working previously, but then I upgraded my server and put a new ffmpeg
on it and now it's not working.)

And here's my command and their result. Thanks very much for any suggestions!

~Jesse Gordon

root at videoflier:/var/www/videoserver/scripts# cat cat.mov|ffmpeg -i -
-r 25 -ar 44100 -ab 128k -vb 2500k -f flv  - > cat.flv
ffmpeg version N-46523-g78e08fd Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov  7 2012 23:15:10 with gcc 4.5.2 (GCC)
  configuration: --prefix=/usr
  libavutil      52.  5.100 / 52.  5.100
  libavcodec     54. 71.100 / 54. 71.100
  libavformat    54. 36.100 / 54. 36.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 21.106 /  3. 21.106
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14a8240] stream 1, offset 0x20: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14a8240] Could not find codec parameters
for stream 0 (Video: h264 (avc1 / 0x31637661), 640x480, 20480 kb/s):
unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:':
  Metadata:
    major_brand     : qt
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    creation_time   : 2012-11-07 23:38:53
  Duration: 00:00:01.38, bitrate: N/A
    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), 640x480, 20480
kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 120k tbc
    Metadata:
      creation_time   : 2012-11-07 23:38:53
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2012-11-07 23:38:53
[buffer @ 0x14ad900] Unable to parse option value "-1" as pixel format
Error opening filters!
root at videoflier:/var/www/videoserver/scripts#



Or, with -i pipe:0 instead:

root at videoflier:/var/www/videoserver/scripts# cat cat.mov|ffmpeg -i
pipe:0 -r 25 -ar 44100 -ab 128k -vb 2500k -f flv  - > cat.flv
ffmpeg version N-46523-g78e08fd Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov  7 2012 23:15:10 with gcc 4.5.2 (GCC)
  configuration: --prefix=/usr
  libavutil      52.  5.100 / 52.  5.100
  libavcodec     54. 71.100 / 54. 71.100
  libavformat    54. 36.100 / 54. 36.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 21.106 /  3. 21.106
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14a8240] stream 1, offset 0x20: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14a8240] Could not find codec parameters
for stream 0 (Video: h264 (avc1 / 0x31637661), 640x480, 20480 kb/s):
unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
  Metadata:
    major_brand     : qt
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    creation_time   : 2012-11-07 23:38:53
  Duration: 00:00:01.38, bitrate: N/A
    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), 640x480, 20480
kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 120k tbc
    Metadata:
      creation_time   : 2012-11-07 23:38:53
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2012-11-07 23:38:53
[buffer @ 0x14ad900] Unable to parse option value "-1" as pixel format
Error opening filters!
root at videoflier:/var/www/videoserver/scripts#


However, if I specify the name explicitly, then it works happily:

root at videoflier:/var/www/videoserver/scripts# ffmpeg -i cat.mov -r 25
-ar 44100 -ab 128k -vb 2500k -f flv  - > cat.flv
ffmpeg version N-46523-g78e08fd Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov  7 2012 23:15:10 with gcc 4.5.2 (GCC)
  configuration: --prefix=/usr
  libavutil      52.  5.100 / 52.  5.100
  libavcodec     54. 71.100 / 54. 71.100
  libavformat    54. 36.100 / 54. 36.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 21.106 /  3. 21.106
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cat.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    creation_time   : 2012-11-07 23:38:53
  Duration: 00:00:01.38, start: 0.000000, bitrate: 22030 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuvj420p, 640x480, 20480 kb/s, 59.94 fps, 59.94 tbr, 60k
tbn, 120k tbc
    Metadata:
      creation_time   : 2012-11-07 23:38:53
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2012-11-07 23:38:53
Output #0, flv, to 'pipe:':
  Metadata:
    major_brand     : qt
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    encoder         : Lavf54.36.100
    Stream #0:0(eng): Video: flv1 ([2][0][0][0] / 0x0002), yuv420p,
640x480, q=2-31, 2500 kb/s, 1k tbn, 25 tbc
    Metadata:
      creation_time   : 2012-11-07 23:38:53
    Stream #0:1(eng): Audio: adpcm_swf ([1][0][0][0] / 0x0001), 44100
Hz, stereo, s16, 352 kb/s
    Metadata:
      creation_time   : 2012-11-07 23:38:53
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> flv)
  Stream #0:1 -> #0:1 (pcm_s16le -> adpcm_swf)
Press [q] to stop, [?] for help
frame=   36 fps=0.0 q=5.0 Lsize=     654kB time=00:00:01.44
bitrate=3723.0kbits/s dup=0 drop=47
video:593kB audio:60kB subtitle:0 global headers:0kB muxing overhead 0.220139%
root at videoflier:/var/www/videoserver/scripts#


More information about the ffmpeg-user mailing list