comparison mencoder.c @ 3702:e16996f5497d

supporting -ofps by lavc, using avcodec_find_encoder_by_name (latest libavcodec cvs)
author alex
date Mon, 24 Dec 2001 10:54:11 +0000
parents 470d75f1e087
children d846a89e609a
comparison
equal deleted inserted replaced
3701:a33d0351630e 3702:e16996f5497d
805 avcodec_init(); 805 avcodec_init();
806 avcodec_register_all(); 806 avcodec_register_all();
807 avcodec_inited=1; 807 avcodec_inited=1;
808 } 808 }
809 809
810 #if 1 810 #if 0
811 { 811 {
812 extern AVCodec *first_avcodec; 812 extern AVCodec *first_avcodec;
813 AVCodec *p = first_avcodec; 813 AVCodec *p = first_avcodec;
814 814
815 lavc_venc_codec = NULL; 815 lavc_venc_codec = NULL;
834 834
835 memset(&lavc_venc_context, 0, sizeof(lavc_venc_context)); 835 memset(&lavc_venc_context, 0, sizeof(lavc_venc_context));
836 836
837 // lavc_venc_context.width = mux_v->bih->biWidth; 837 // lavc_venc_context.width = mux_v->bih->biWidth;
838 // lavc_venc_context.height = mux_v->bih->biHeight; 838 // lavc_venc_context.height = mux_v->bih->biHeight;
839 /* scaling only for YV12 (and lavc supports only YV12 ;) */
839 lavc_venc_context.width = vo_w; 840 lavc_venc_context.width = vo_w;
840 lavc_venc_context.height = vo_h; 841 lavc_venc_context.height = vo_h;
841 if (lavc_param_vbitrate >= 0) /* != -1 */ 842 if (lavc_param_vbitrate >= 0) /* != -1 */
842 lavc_venc_context.bit_rate = lavc_param_vbitrate; 843 lavc_venc_context.bit_rate = lavc_param_vbitrate;
843 else 844 else
844 lavc_venc_context.bit_rate = 800000; /* default */ 845 lavc_venc_context.bit_rate = 800000; /* default */
845 lavc_venc_context.frame_rate = sh_video->fps * FRAME_RATE_BASE; 846 lavc_venc_context.frame_rate = (float)(force_ofps?force_ofps:sh_video->fps) * FRAME_RATE_BASE;
846 /* keyframe interval */ 847 /* keyframe interval */
847 if (lavc_param_keyint >= 0) /* != -1 */ 848 if (lavc_param_keyint >= 0) /* != -1 */
848 lavc_venc_context.gop_size = lavc_param_keyint; 849 lavc_venc_context.gop_size = lavc_param_keyint;
849 else 850 else
850 lavc_venc_context.gop_size = 250; /* default */ 851 lavc_venc_context.gop_size = 250; /* default */