[FFmpeg-user] Error when creating jpeg from video frame in ffmpeg 0.8.5

Anderw Gora master at io.ua
Sun Nov 6 18:24:57 CET 2011


ffmpeg 0.8.5 cant create jpeg from SOME videos (2-3% of total).
Just black frames.
All other videos are OK
Also, ffmpeg 0.5 is OK too with all videos.

There are two erors|warnings while jpeg creating:
1.Estimating duration from bitrate, this may be inaccurate
2.Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting format 'yuvj420p'

Seems, we are not alone with this issue:
http://stackoverflow.com/questions/7677398/ffmpeg-generating-screenshots-drop-frames

Would you please clarify the situation? Thanks a lot!


OK:

/usr/local/bin/ffmpeg -ss 6 -i video.flv -vframes 1 -an -s 720x400 -f image2 -vcodec mjpeg -y pic.jpg
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-shared --enable-pthreads --enable-libamr-nb --enable-libamr-wb --enable-nonfree --enable-gpl --enable-libmp3lame --enable-libxvid
--enable-libfaad --enable-libfaac --enable-libvorbis --enable-libx264 --enable-avfilter --enable-postproc
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libpostproc   51. 2. 0 / 51. 2. 0
  built on May 18 2009 14:07:19, gcc: 4.1.2 20071124 (Red Hat 4.1.2-42)
Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (25/1)
Input #0, flv, from 'video.flv':
  Duration: 00:28:06.88, start: 0.040000, bitrate: 384 kb/s
    Stream #0.0: Video: h264, yuv420p, 720x400 [PAR 1:1 DAR 9:5], 320 kb/s, 25 tbr, 1k tbn, 50 tbc
    Stream #0.1: Audio: mp3, 44100 Hz, mono, s16, 64 kb/s
Output #0, image2, to 'pic.jpg':
    Stream #0.0: Video: mjpeg, yuvj420p, 720x400 [PAR 1:1 DAR 9:5], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=    1 fps=  1 q=5.0 Lsize=      -0kB time=0.04 bitrate=  -4.4kbits/s
video:23kB audio:0kB global headers:0kB muxing overhead -100.094971%

ERROR:

/usr/local/ffmpeg-0.8.5/bin/ffmpeg -ss 6 -i video.flv -vframes 1 -an -s 720x400 -f image2 -vcodec mjpeg -y pic.jpg
ffmpeg version 0.8.5, Copyright (c) 2000-2011 the FFmpeg developers
  built on Oct 17 2011 15:54:16 with gcc 4.4.4 20100726 (Red Hat 4.4.4-13)
  configuration: --prefix=/usr/local/ffmpeg-0.8.5 --enable-shared --enable-pthreads --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree
--enable-gpl --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libfaac --enable-libx264 --enable-avfilter --enable-postproc --enable-version3
  libavutil    51.  9. 1 / 51.  9. 1
  libavcodec   53.  7. 0 / 53.  7. 0
  libavformat  53.  4. 0 / 53.  4. 0
  libavdevice  53.  1. 1 / 53.  1. 1
  libavfilter   2. 23. 0 /  2. 23. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[flv @ 0x152c400] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'video.flv':
  Metadata:
    audiodatarate   : 63
    audiosize       : 14270641
    audiocodecid    : 2
    audiosamplerate : 3
    height          : 400
    hasMetadata     : true
    duration        : 1687
    canSeekToEnd    : true
    stereo          : false
    videosize       : 68095165
    hasVideo        : true
    hasCuePoints    : false
    metadatacreator : Yet Another Metadata Injector for FLV - Version 1.8
    hasAudio        : true
    hasKeyframes    : true
    width           : 720
    lastkeyframetimestamp: 1687
    lasttimestamp   : 1687
    filesize        : 82810085
    videocodecid    : 7
    audiosamplesize : 1
    totalframes     : 42175
    videodatarate   : 313
    framerate       : 25
    datasize        : 82792822
    lastkeyframelocation: 82810065
  Duration: 00:28:06.88, start: 0.040000, bitrate: 384 kb/s
    Stream #0.0: Video: h264 (High), yuv420p, 720x400 [PAR 1:1 DAR 9:5], 320 kb/s, 25 tbr, 1k tbn, 50 tbc
    Stream #0.1: Audio: mp3, 44100 Hz, mono, s16, 64 kb/s
Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting format 'yuvj420p'
[buffer @ 0x152c320] w:720 h:400 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[buffersink @ 0x1531120] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x153e760] w:720 h:400 fmt:yuv420p -> w:720 h:400 fmt:yuvj420p flags:0x4
Output #0, image2, to 'pic.jpg':
  Metadata:
    audiodatarate   : 63
    audiosize       : 14270641
    audiocodecid    : 2
    audiosamplerate : 3
    height          : 400
    hasMetadata     : true
    duration        : 1687
    canSeekToEnd    : true
    stereo          : false
    videosize       : 68095165
    hasVideo        : true
    hasCuePoints    : false
    metadatacreator : Yet Another Metadata Injector for FLV - Version 1.8
    hasAudio        : true
    hasKeyframes    : true
    width           : 720
    lastkeyframetimestamp: 1687
    lasttimestamp   : 1687
    filesize        : 82810085
    videocodecid    : 7
    audiosamplesize : 1
    totalframes     : 42175
    videodatarate   : 313
    framerate       : 25
    datasize        : 82792822
    lastkeyframelocation: 82810065
    encoder         : Lavf53.4.0
    Stream #0.0: Video: mjpeg, yuvj420p, 720x400 [PAR 1:1 DAR 9:5], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
frame=    0 fps=  0 q=0.0 Lsize=      -0kB time=00:00:00.00 bitrate=   0.0kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead -inf%



More information about the ffmpeg-user mailing list