[FFmpeg-user] warning: first frame is no keyframe

Shaily Athghara shaily.athghara at gmail.com
Wed Apr 11 08:14:58 CEST 2012


Hi,
 I am having this warning when encoding some videos to flv. Every time this
warning appears, the first frames of the flv video seems to be wrong.

The first frames of my flv becomes gray every time I get this warning.

I am converting .raw and .wav file to generate the flv file.

The command we are using is :

  ./ffmpeg -r 6.5 -i 1.raw -i 4.wav -y -f flv -ar 11025 output.flv

FFmpeg version SVN-r16573, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration:
  libavutil     49.12. 0 / 49.12. 0
  libavcodec    52.10. 0 / 52.10. 0
  libavformat   52.23. 1 / 52.23. 1
  libavdevice   52. 1. 0 / 52. 1. 0
  built on Apr  3 2012 07:10:11, gcc: 4.1.2 20080704 (Red Hat 4.1.2-44)
[h263 @ 0x164a5820]warning: first frame is no keyframe

Seems stream 0 codec frame rate differs from container frame rate: 29.97
(30000/1001) -> 6.50 (13/2)
Input #0, h263, from '1.raw':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: h263, yuv420p, 352x288 [PAR 12:11 DAR 4:3],  6.50
tb(r)
Input #1, wav, from '4.wav':
  Duration: 00:00:13.68, bitrate: 64 kb/s
    Stream #1.0: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Output #0, flv, to 'output.flv':
    Stream #0.0: Video: flv, yuv420p, 352x288 [PAR 12:11 DAR 4:3], q=2-31,
200 kb/s,  6.50 tb(c)
    Stream #0.1: Audio: adpcm_swf, 11025 Hz, mono, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #1.0 -> #0.1
Press [q] to stop encoding
[h263 @ 0x164a5820]warning: first frame is no keyframe
[h263 @ 0x164a5820]concealing 308 DC, 308 AC, 308 MV errors
frame=  189 fps=  0 q=3.4 Lsize=     916kB time=13.65 bitrate= 549.5kbits/s
video:834kB audio:74kB global headers:0kB muxing overhead 0.860411%



The video and audio all are in sysnc the only problem we are getting is the
initial framed is not clear, and.After investigating it further,got to know
that later version of ffmpeg has fixed this issue, So I have installed
ffmpeg-0.10.2 and execute the same command



./ffmpeg  -r 6.5 -i 1.raw -i 4.wav -y -f flv -ar 11025 output.flv

ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers

  built on Apr  9 2012 12:55:03 with gcc 4.1.2 20080704 (Red Hat 4.1.2-44)

  configuration:

  libavutil      51. 35.100 / 51. 35.100

  libavcodec     53. 61.100 / 53. 61.100

  libavformat    53. 32.100 / 53. 32.100

  libavdevice    53.  4.100 / 53.  4.100

  libavfilter     2. 61.100 /  2. 61.100

  libswscale      2.  1.100 /  2.  1.100

  libswresample   0.  6.100 /  0.  6.100

[rawvideo @ 0xe6eaf40] Pixel format was not specified and cannot be detected

    Last message repeated 2 times

[image2 @ 0xe6e4420] decoding for stream 0 failed

[image2 @ 0xe6e4420] Could not find codec parameters (Video: rawvideo)

1.raw: could not find codec parameters

The same command didn’t work in the ffmpeg 0.10.2 version, so execute the
following command



./ffmpeg -s cif -r 30 -pix_fmt yuv420p -i 1.raw -vcodec flv  -f flv
output.flv

ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers

  built on Apr  9 2012 12:55:03 with gcc 4.1.2 20080704 (Red Hat 4.1.2-44)

  configuration:

  libavutil      51. 35.100 / 51. 35.100

  libavcodec     53. 61.100 / 53. 61.100

  libavformat    53. 32.100 / 53. 32.100

  libavdevice    53.  4.100 / 53.  4.100

  libavfilter     2. 61.100 /  2. 61.100

  libswscale      2.  1.100 /  2.  1.100

  libswresample   0.  6.100 /  0.  6.100

Input #0, image2, from '1.raw':

  Duration: 00:00:00.03, start: 0.000000, bitrate: N/A

    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 352x288, 30
tbr, 30 tbn, 30 tbc

[buffer @ 0x154eff80] w:352 h:288 pixfmt:yuv420p tb:1/1000000 sar:0/1
sws_param:

Output #0, flv, to 'output.flv':

  Metadata:

    encoder         : Lavf53.32.100

    Stream #0:0: Video: flv1 ([2][0][0][0] / 0x0002), yuv420p, 352x288,
q=2-31, 200 kb/s, 1k tbn, 30 tbc

Stream mapping:

  Stream #0:0 -> #0:0 (rawvideo -> flv)

Press [q] to stop, [?] for help

frame=    1 fps=  0 q=7.6 Lsize=     125kB time=00:00:00.03
bitrate=31104.2kbits/s

video:125kB audio:0kB global headers:0kB muxing overhead 0.178018%



The command didn’t throw any exception but we didn’t get the desired video
and audio.The video didn’t display any thing.Please suggest what I am doing
wrong here. One more thing,  in the above command “frame = 1” where as when
we execute the command using ffmpeg SVN-r16573 frame count is frame=
189.Please
help me in solving this issue.



Thanks,

Shaily.


More information about the ffmpeg-user mailing list