comparison yuv4mpeg.c @ 743:af4e24d6310c libavformat

switch to native time bases
author michael
date Sat, 30 Apr 2005 21:43:59 +0000
parents db0a5e0f4db5
children c5077fdab490
comparison
equal deleted inserted replaced
742:21c1ae78f041 743:af4e24d6310c
34 34
35 st = s->streams[0]; 35 st = s->streams[0];
36 width = st->codec.width; 36 width = st->codec.width;
37 height = st->codec.height; 37 height = st->codec.height;
38 38
39 av_reduce(&raten, &rated, st->codec.frame_rate, st->codec.frame_rate_base, (1UL<<31)-1); 39 av_reduce(&raten, &rated, st->codec.time_base.den, st->codec.time_base.num, (1UL<<31)-1);
40 40
41 aspectn = st->codec.sample_aspect_ratio.num; 41 aspectn = st->codec.sample_aspect_ratio.num;
42 aspectd = st->codec.sample_aspect_ratio.den; 42 aspectd = st->codec.sample_aspect_ratio.den;
43 43
44 if ( aspectn == 0 && aspectd == 1 ) aspectd = 0; // 0:0 means unknown 44 if ( aspectn == 0 && aspectd == 1 ) aspectd = 0; // 0:0 means unknown
321 st = av_new_stream(s, 0); 321 st = av_new_stream(s, 0);
322 st = s->streams[0]; 322 st = s->streams[0];
323 st->codec.width = width; 323 st->codec.width = width;
324 st->codec.height = height; 324 st->codec.height = height;
325 av_reduce(&raten, &rated, raten, rated, (1UL<<31)-1); 325 av_reduce(&raten, &rated, raten, rated, (1UL<<31)-1);
326 st->codec.frame_rate = raten; 326 av_set_pts_info(st, 64, rated, raten);
327 st->codec.frame_rate_base = rated;
328 st->codec.pix_fmt = pix_fmt; 327 st->codec.pix_fmt = pix_fmt;
329 st->codec.codec_type = CODEC_TYPE_VIDEO; 328 st->codec.codec_type = CODEC_TYPE_VIDEO;
330 st->codec.codec_id = CODEC_ID_RAWVIDEO; 329 st->codec.codec_id = CODEC_ID_RAWVIDEO;
331 st->codec.sample_aspect_ratio= (AVRational){aspectn, aspectd}; 330 st->codec.sample_aspect_ratio= (AVRational){aspectn, aspectd};
332 331