[Ffmpeg-devel] I want to know what data set to AVCodecContext for H.264

Chang Min Jeon jcm1981
Thu Jun 23 19:09:07 CEST 2005


No, I have not problems during program's running.
 I did set to AVCodecContext following line.
  AVCodecContext *c = NULL;
...
c->pix_fmt = PIX_FMT_YUV420P;
c->bit_rate = 400000;

c->width = 352;
c->height = 288;

c->time_base = (AVRational) {1,25};
c->gop_size = 10; /* emit one intra frame every ten frames */
c->max_b_frames=1;

...

for( i = 0; i < 2; i++ )
out_size = avcodec_encode_video( c, outbuf, outbuf_size, picture );
printf( "encoding frame %3d (size=%5d)\n", i, out_size );
fwrite(outbuf, 1, out_size, f);
...
 Console messages.
 encoding frame 2 (size= 2053)
Video encoding
352, 288
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
encoding frame 2 (size= 2035)
Video encoding
352, 288
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
encoding frame 2 (size= 2075)
Video encoding
352, 288
encoding frame 2 (size= 2110)
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
Video encoding
352, 288
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
encoding frame 2 (size= 2123)
Video encoding
352, 288
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
encoding frame 2 (size= 2099)
Video encoding
352, 288
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
encoding frame 2 (size= 2121)
Video encoding
352, 288
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
encoding frame 2 (size= 2092)
Video encoding
352, 288
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
encoding frame 2 (size= 2121)
Video encoding
352, 288
[h264 @ 0x82dd274]using cpu capabilities MMX MMXEXT SSE SSE2 
encoding frame 2 (size= 2107)
write frame 2 (size= 0)
[h264 @ 0x82dd274]slice I:1 Avg QP:23.00 Avg size: 1948 PSNR Mean Y:49.67 U:
52.96 V:48.31 Avg:49.79 Global:49.79
[h264 @ 0x82dd274]slice I Avg I4x4:2.3% I8x8:0.0% I16x16:97.7%
[h264 @ 0x82dd274]PSNR Mean Y:49.67 U:52.96 V:48.31 Avg:49.79 Global:49.79kb/s:
389.6
 But mplayer can't play movie that I encode to h.264 to file (e.g : test.mp4
)
 mplayer has compiled with x264 So it can play h264 movie.




More information about the ffmpeg-devel mailing list