Lines 682-688
XImageToFFMPEG (FILE *fp, XImage *image,
Link Here
|
682 |
exit (1); |
682 |
exit (1); |
683 |
} |
683 |
} |
684 |
|
684 |
|
685 |
c = &out_st->codec; |
685 |
c = out_st->codec; |
686 |
c->codec_id = transCodec; |
686 |
c->codec_id = transCodec; |
687 |
c->codec_type = CODEC_TYPE_VIDEO; |
687 |
c->codec_type = CODEC_TYPE_VIDEO; |
688 |
|
688 |
|
Lines 696-703
XImageToFFMPEG (FILE *fp, XImage *image,
Link Here
|
696 |
#endif /* DEBUG */ |
696 |
#endif /* DEBUG */ |
697 |
|
697 |
|
698 |
/* frames per second */ |
698 |
/* frames per second */ |
699 |
c->frame_rate = job->fps; |
699 |
c->time_base.den = job->fps * 1000; |
700 |
c->frame_rate_base = 1; |
700 |
c->time_base.num = 1000; |
701 |
c->gop_size = 250; /* emit one intra frame every 10 frames */ |
701 |
c->gop_size = 250; /* emit one intra frame every 10 frames */ |
702 |
// c->me_method = ME_EPZS; |
702 |
// c->me_method = ME_EPZS; |
703 |
// c->debug = 0x00000FFF; |
703 |
// c->debug = 0x00000FFF; |
Lines 707-716
XImageToFFMPEG (FILE *fp, XImage *image,
Link Here
|
707 |
*/ |
707 |
*/ |
708 |
memset (p_fParams, 0, sizeof(*p_fParams)); |
708 |
memset (p_fParams, 0, sizeof(*p_fParams)); |
709 |
p_fParams->image_format = image_format; |
709 |
p_fParams->image_format = image_format; |
710 |
p_fParams->frame_rate = out_st->codec.frame_rate; |
710 |
p_fParams->time_base = out_st->codec->time_base; |
711 |
p_fParams->frame_rate_base = out_st->codec.frame_rate_base; |
711 |
p_fParams->width = out_st->codec->width; |
712 |
p_fParams->width = out_st->codec.width; |
712 |
p_fParams->height = out_st->codec->height; |
713 |
p_fParams->height = out_st->codec.height; |
|
|
714 |
if (av_set_parameters (output_file, p_fParams) < 0) { |
713 |
if (av_set_parameters (output_file, p_fParams) < 0) { |
715 |
// if (av_set_parameters(output_file, NULL) < 0) { |
714 |
// if (av_set_parameters(output_file, NULL) < 0) { |
716 |
fprintf (stderr, "xtoffmpeg.XImageToFFMPEG(): Invalid encoding parameters ... aborting\n"); |
715 |
fprintf (stderr, "xtoffmpeg.XImageToFFMPEG(): Invalid encoding parameters ... aborting\n"); |
Lines 720-726
XImageToFFMPEG (FILE *fp, XImage *image,
Link Here
|
720 |
/* |
719 |
/* |
721 |
* open codec |
720 |
* open codec |
722 |
*/ |
721 |
*/ |
723 |
c = &out_st->codec; |
722 |
c = out_st->codec; |
724 |
|
723 |
|
725 |
/* find the video encoder */ |
724 |
/* find the video encoder */ |
726 |
codec = avcodec_find_encoder (c->codec_id); |
725 |
codec = avcodec_find_encoder (c->codec_id); |
Lines 1159-1165
FFMPEGClean (Job *job) {
Link Here
|
1159 |
#endif // HAVE_FFMPEG_AUDIO |
1158 |
#endif // HAVE_FFMPEG_AUDIO |
1160 |
|
1159 |
|
1161 |
if (out_st) { |
1160 |
if (out_st) { |
1162 |
avcodec_close (&out_st->codec); |
1161 |
avcodec_close (out_st->codec); |
1163 |
out_st = NULL; |
1162 |
out_st = NULL; |
1164 |
} |
1163 |
} |
1165 |
|
1164 |
|