Revision fcee0164 ffmpeg.c

View differences:

ffmpeg.c
2744 2744
            } else {
2745 2745
                char *p;
2746 2746
                int i;
2747
                AVCodec *codec;
2747 2748
            
2748 2749
                codec_id = file_oformat->video_codec;
2749 2750
                if (video_codec_id != CODEC_ID_NONE)
......
2759 2760
                video_enc->width = frame_width + frame_padright + frame_padleft;
2760 2761
                video_enc->height = frame_height + frame_padtop + frame_padbottom;
2761 2762
		video_enc->sample_aspect_ratio = av_d2q(frame_aspect_ratio*frame_height/frame_width, 255);
2762
		video_enc->pix_fmt = frame_pix_fmt;
2763
                video_enc->pix_fmt = frame_pix_fmt;
2764

  
2765
                codec = avcodec_find_encoder(codec_id);
2766
                if(codec && codec->pix_fmts){
2767
                    const enum PixelFormat *p= codec->pix_fmts;
2768
                    for(; *p!=-1; p++){
2769
                        if(*p == video_enc->pix_fmt)
2770
                            break;
2771
                    }
2772
                    if(*p == -1)
2773
                        video_enc->pix_fmt = codec->pix_fmts[0];
2774
                }
2763 2775

  
2764 2776
                if (!intra_only)
2765 2777
                    video_enc->gop_size = gop_size;

Also available in: Unified diff