comparison dv.c @ 1221:867d8f0bede6 libavcodec

* fixing NTSC frame rate for DV streams * let ffmpeg preserve 'aspect_ratio' for recoding. Do we want to make it tweakable from the command line ?
author romansh
date Tue, 29 Apr 2003 01:51:38 +0000
parents 327c5a36dfe7
children adcc6f345202
comparison
equal deleted inserted replaced
1220:78a51075aacb 1221:867d8f0bede6
536 536
537 /* init size */ 537 /* init size */
538 width = 720; 538 width = 720;
539 if (dsf) { 539 if (dsf) {
540 avctx->frame_rate = 25; 540 avctx->frame_rate = 25;
541 avctx->frame_rate_base = 1;
541 packet_size = PAL_FRAME_SIZE; 542 packet_size = PAL_FRAME_SIZE;
542 height = 576; 543 height = 576;
543 nb_dif_segs = 12; 544 nb_dif_segs = 12;
544 } else { 545 } else {
545 avctx->frame_rate = 30; 546 avctx->frame_rate = 30000;
547 avctx->frame_rate_base = 1001;
546 packet_size = NTSC_FRAME_SIZE; 548 packet_size = NTSC_FRAME_SIZE;
547 height = 480; 549 height = 480;
548 nb_dif_segs = 10; 550 nb_dif_segs = 10;
549 } 551 }
550 avctx->frame_rate_base= 1;
551 /* NOTE: we only accept several full frames */ 552 /* NOTE: we only accept several full frames */
552 if (buf_size < packet_size) 553 if (buf_size < packet_size)
553 return -1; 554 return -1;
554 555
555 /* NTSC[dsf == 0] is always 720x480, 4:1:1 556 /* NTSC[dsf == 0] is always 720x480, 4:1:1
721 if (quant > 1) 722 if (quant > 1)
722 return -1; /* Unsupported quantization */ 723 return -1; /* Unsupported quantization */
723 724
724 avctx->sample_rate = dv_audio_frequency[freq]; 725 avctx->sample_rate = dv_audio_frequency[freq];
725 avctx->channels = 2; 726 avctx->channels = 2;
727 avctx->bit_rate = avctx->channels * avctx->sample_rate * 16;
726 // What about: 728 // What about:
727 // avctx->bit_rate =
728 // avctx->frame_size = 729 // avctx->frame_size =
729 730
730 *data_size = (dv_audio_min_samples[sys][freq] + smpls) * 731 *data_size = (dv_audio_min_samples[sys][freq] + smpls) *
731 avctx->channels * 2; 732 avctx->channels * 2;
732 733