Opened 12 years ago

Closed 12 years ago

#956 closed defect (worksforme)

ffmpeg V0.10 cannot convert to a jpg file, but ffmpeg v0.9 can

Reported by: Tom.Chen Owned by:
Priority: normal Component: ffmpeg
Version: 0.10 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hi, All.

When I convert a mp4 file to capture a jpg file, it can not convert successfuly(The output file was not generated).

Execute command: ffmpeg_g -ss 20 -t 0.001 -vframes 1 -i input.mp4 -y -f image2 -s 350x240 outfile.jpg
OS: Win7+MinGW32
The log file information: (It looks like lack of parameters, but I have supported parameters: "ss, t, vframes")
2012/01/30-10:25: ffmpeg version 0.10
2012/01/30-10:25: Copyright (c) 2000-2012 the FFmpeg developers
2012/01/30-10:25: built on Jan 29 2012 17:50:46 with gcc 4.5.2
2012/01/30-10:25: configuration: --prefix=/ffmpeg/release10 --enable-debug --disable-static --enable-shared --enable-gpl --enable-version3 --enable-avfilter --enable-memalign-hack --enable-avisynth --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac --enable-nonfree --enable-libspeex --enable-libopenjpeg --enable-libxavs --enable-libvpx --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libschroedinger --enable-libcelt --enable-frei0r --enable-libdirac --disable-decoder=libdirac --extra-cflags=-I/ffmpeg/olibs9/include --extra-ldflags=-L/ffmpeg/olibs9/lib --extra-libs=/mingw/lib/libdl.a
2012/01/30-10:25: libavutil 51. 34.101 / 51. 34.101
2012/01/30-10:25: libavcodec 53. 60.100 / 53. 60.100
2012/01/30-10:25: libavformat 53. 31.100 / 53. 31.100
2012/01/30-10:25: libavdevice 53. 4.100 / 53. 4.100
2012/01/30-10:25: libavfilter 2. 60.100 / 2. 60.100
2012/01/30-10:25: libswscale 2. 1.100 / 2. 1.100
2012/01/30-10:25: libswresample 0. 6.100 / 0. 6.100
2012/01/30-10:25: libpostproc 52. 0.100 / 52. 0.100
2012/01/30-10:25: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
2012/01/30-10:25: Metadata:
2012/01/30-10:25: major_brand : isom
2012/01/30-10:25: minor_version : 512
2012/01/30-10:25: compatible_brands: isomiso2avc1mp41
2012/01/30-10:25: creation_time : 1970-01-01 00:00:00
2012/01/30-10:25: encoder : Lavf52.16.0
2012/01/30-10:25: comment : FlixEngineLinux_8.0.16.0 (www.on2.com)
2012/01/30-10:25: Duration:
2012/01/30-10:25: 00:00:59.15
2012/01/30-10:25: start:
2012/01/30-10:25: 0.000000
2012/01/30-10:25: bitrate:
2012/01/30-10:25: 432 kb/s
2012/01/30-10:25: Stream #0:0
2012/01/30-10:25: (und)
2012/01/30-10:25: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 540x360 [SAR 1:1 DAR 3:2], 363 kb/s
2012/01/30-10:25: 23.98 fps
2012/01/30-10:25: 23.98 tbr
2012/01/30-10:25: 1k tbn
2012/01/30-10:25: 2k tbc
2012/01/30-10:25: Metadata:
2012/01/30-10:25: creation_time : 1970-01-01 00:00:00
2012/01/30-10:25: handler_name : VideoHandler
2012/01/30-10:25: Stream #0:1
2012/01/30-10:25: (und)
2012/01/30-10:25: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 64 kb/s
2012/01/30-10:25: Metadata:
2012/01/30-10:25: creation_time : 1970-01-01 00:00:00
2012/01/30-10:25: handler_name :
2012/01/30-10:25: Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting format 'yuvj420p'
2012/01/30-10:25: [buffer @ 014aefa0] w:540 h:360 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
2012/01/30-10:25: [scale @ 026088a0] w:540 h:360 fmt:yuv420p -> w:350 h:240 fmt:yuvj420p flags:0x4
2012/01/30-10:25: Output #0, image2, to 'outfile.jpg':
2012/01/30-10:25: Metadata:
2012/01/30-10:25: major_brand : isom
2012/01/30-10:25: minor_version : 512
2012/01/30-10:25: compatible_brands: isomiso2avc1mp41
2012/01/30-10:25: creation_time : 1970-01-01 00:00:00
2012/01/30-10:25: comment : FlixEngineLinux_8.0.16.0 (www.on2.com)
2012/01/30-10:25: encoder : Lavf53.31.100
2012/01/30-10:25: Stream #0:0
2012/01/30-10:25: (und)
2012/01/30-10:25: Video: mjpeg, yuvj420p, 350x240 [SAR 36:35 DAR 3:2], q=2-31, 200 kb/s
2012/01/30-10:25: 90k tbn
2012/01/30-10:25: 23.98 tbc
2012/01/30-10:25: Metadata:
2012/01/30-10:25: creation_time : 1970-01-01 00:00:00
2012/01/30-10:25: handler_name : VideoHandler
2012/01/30-10:25: Stream mapping:
2012/01/30-10:25: Stream #0:0 -> #0:0
2012/01/30-10:25: (h264 -> mjpeg)
2012/01/30-10:25: Press [q] to stop, ? for help
2012/01/30-10:25: frame= 0 fps= 0 q=0.0 Lsize= 0kB time=00:00:00.00 bitrate= 0.0kbits/s
2012/01/30-10:25: video:0kB audio:0kB global headers:0kB muxing overhead nan%
2012/01/30-10:25: Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

But When I execute the same file in ffmpeg v0.9 (the same OS), it is ok.
Could you help me please? Thank you in advance.

Tom.Chen

Attachments (1)

input.mp4 (2.2 MB ) - added by Tom.Chen 12 years ago.
convert input video file

Change History (2)

by Tom.Chen, 12 years ago

Attachment: input.mp4 added

convert input video file

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: convert jpg file Error removed
Reproduced by developer: unset
Resolution: worksforme
Status: newclosed

Unrelated to your problem that I cannot reproduce:
"-f image2" is superfluous, -vframes is an output option, it has no effect when used before "-i".

$ md5sum input.mp4
7ab621d46e9ec4b6d0d2bbd0c697539a  input.mp4
$ ffmpeg -ss 20 -vframes 1 -t 0.001 -i input.mp4 -y -f image2 -s 350x240 outfile.jpg
ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan 30 2012 09:47:43 with gcc 4.5.3
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc
  libavutil      51. 34.101 / 51. 34.101
  libavcodec     53. 60.100 / 53. 60.100
  libavformat    53. 31.100 / 53. 31.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 60.100 /  2. 60.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf53.31.100
    comment         : FlixEngineLinux_8.0.16.0 (www.on2.com)
  Duration: 00:00:35.03, start: 0.000000, bitrate: 517 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 540x360 [SAR 1:1 DAR 3:2], 383 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 128 kb/s
    Metadata:
      handler_name    :
Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting format 'yuvj420p'
[buffer @ 0x13dab40] w:540 h:360 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[scale @ 0x13db1a0] w:540 h:360 fmt:yuv420p -> w:350 h:240 fmt:yuvj420p flags:0x4
Output #0, image2, to 'outfile.jpg':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    comment         : FlixEngineLinux_8.0.16.0 (www.on2.com)
    encoder         : Lavf53.31.100
    Stream #0:0(und): Video: mjpeg, yuvj420p, 350x240 [SAR 36:35 DAR 3:2], q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
[image2 @ 0x13ee3c0] Could not get frame filename number 2 from pattern 'outfile.jpg'
av_interleaved_write_frame(): Invalid argument
$ file outfile.jpg
outfile.jpg: JPEG image data, JFIF standard 1.02, comment: "Lavc53.60.100"

The error in my output ("Could not get frame filename number 2") can be avoided with "-vframes 1" after "-i input.mp4", the output file outfile.jpg is created in any case.

Note: See TracTickets for help on using tickets.