c->bit_rate_tolerance = mlt_properties_get_int( properties, "video_bit_rate_tolerance" );
c->width = mlt_properties_get_int( properties, "width" );
c->height = mlt_properties_get_int( properties, "height" );
- c->time_base.den = mlt_properties_get_double( properties, "fps" );
- c->time_base.num = mlt_properties_get_double( properties, "frame_rate_base" );
- c->time_base.num = 1;
+ c->time_base.den = mlt_properties_get_int( properties, "frame_rate_den" );
+ c->time_base.num = mlt_properties_get_int( properties, "frame_rate_num" );
c->gop_size = mlt_properties_get_int( properties, "gop_size" );
c->pix_fmt = PIX_FMT_YUV420P;
}
// Allocate picture
- output = alloc_picture( video_st->codec.pix_fmt, width, height );
+ if ( video_st )
+ output = alloc_picture( video_st->codec.pix_fmt, width, height );
// Last check - need at least one stream
if ( audio_st == NULL && video_st == NULL )
url_fclose(&oc->pb);
// Clean up input and output frames
- av_free( output->data[0] );
+ if ( output )
+ av_free( output->data[0] );
av_free( output );
av_free( input->data[0] );
av_free( input );