[FFmpeg-user] Problem with multiple image outputs from a video stream

S V lament.trash at gmail.com
Sun Dec 23 15:25:29 CET 2012


Hello,

I have a video stream from which I'd like to take one frame and save it as
two different sized jpegs but I can't figure out the right way to do it.
The procedure works one by one but not if I combine both outputs in one
command as shown in the attached console outputs:

./ffmpeg -i rtsp://10.10.50.49:554/live/ch00_0 -vframes 1 -s 640x360 -f
image2 -vcodec mjpeg test-1.jpg
ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 23 2012 13:47:55 with gcc 4.4.4 (GCC)
  configuration:
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
[rtsp @ 0x9113500] method SETUP failed: 461 Unsupported Transport
[rtsp @ 0x9113500] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://10.10.50.49:554/live/ch00_0':
  Metadata:
    title           : Ubiquiti Live
    comment         : UBNT Streaming Media
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuvj420p, 1280x720, 15 fps, 18.42
tbr, 90k tbn, 30 tbc
Output #0, image2, to 'test-1.jpg':
  Metadata:
    title           : Ubiquiti Live
    comment         : UBNT Streaming Media
    encoder         : Lavf54.29.104
    Stream #0:0: Video: mjpeg, yuvj420p, 640x360, q=2-31, 200 kb/s, 90k
tbn, 18.42 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.05 bitrate=
0.0kbits/s
video:23kB audio:0kB subtitle:0 global headers:0kB muxing overhead
-100.000000%

./ffmpeg -i rtsp://10.10.50.49:554/live/ch00_0 -vframes 1 -s 1280x720 -f
image2 -vcodec mjpeg test-2.jpg
ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 23 2012 13:47:55 with gcc 4.4.4 (GCC)
  configuration:
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
[rtsp @ 0xa46b500] method SETUP failed: 461 Unsupported Transport
[rtsp @ 0xa46b500] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://10.10.50.49:554/live/ch00_0':
  Metadata:
    title           : Ubiquiti Live
    comment         : UBNT Streaming Media
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuvj420p, 1280x720, 15 fps, 18.42
tbr, 90k tbn, 30 tbc
Output #0, image2, to 'test-2.jpg':
  Metadata:
    title           : Ubiquiti Live
    comment         : UBNT Streaming Media
    encoder         : Lavf54.29.104
    Stream #0:0: Video: mjpeg, yuvj420p, 1280x720, q=2-31, 200 kb/s, 90k
tbn, 18.42 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.05 bitrate=
0.0kbits/s
video:69kB audio:0kB subtitle:0 global headers:0kB muxing overhead
-100.000000%


./ffmpeg -i rtsp://10.10.50.49:554/live/ch00_0 -vframes 1 -s 640x360 -f
image2 -vcodec mjpeg test-1.jpg -s 1280x720 -f image2 -vcodec mjpeg
test-2.jpg
ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 23 2012 13:47:55 with gcc 4.4.4 (GCC)
  configuration:
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
[rtsp @ 0x945a500] method SETUP failed: 461 Unsupported Transport
[rtsp @ 0x945a500] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://10.10.50.49:554/live/ch00_0':
  Metadata:
    title           : Ubiquiti Live
    comment         : UBNT Streaming Media
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuvj420p, 1280x720, 15 fps, 18.42
tbr, 90k tbn, 30 tbc
Output #0, image2, to 'test-1.jpg':
  Metadata:
    title           : Ubiquiti Live
    comment         : UBNT Streaming Media
    encoder         : Lavf54.29.104
    Stream #0:0: Video: mjpeg, yuvj420p, 640x360, q=2-31, 200 kb/s, 90k
tbn, 18.42 tbc
Output #1, image2, to 'test-2.jpg':
  Metadata:
    title           : Ubiquiti Live
    comment         : UBNT Streaming Media
    encoder         : Lavf54.29.104
    Stream #1:0: Video: mjpeg, yuvj420p, 1280x720, q=2-31, 200 kb/s, 90k
tbn, 18.42 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
  Stream #0:0 -> #1:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
[image2 @ 0x94682a0] Could not get frame filename number 2 from pattern
'test-2.jpg'
av_interleaved_write_frame(): Invalid argument


Am I doing something wrong or is the problem on the FFmpeg side?

Thanks for your help!


More information about the ffmpeg-user mailing list