1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-15 08:51:38 +02:00

* 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 ?

Originally committed as revision 1827 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Roman Shaposhnik 2003-04-29 01:51:38 +00:00
parent cfcff63685
commit 880e8ba730
2 changed files with 7 additions and 3 deletions

View File

@ -88,6 +88,7 @@ static AVOutputFormat *file_oformat;
static AVImageFormat *image_format;
static int frame_width = 160;
static int frame_height = 128;
static float frame_aspect_ratio = 0;
static int frame_topBand = 0;
static int frame_bottomBand = 0;
static int frame_leftBand = 0;
@ -2015,6 +2016,7 @@ static void opt_input_file(const char *filename)
case CODEC_TYPE_VIDEO:
frame_height = enc->height;
frame_width = enc->width;
frame_aspect_ratio = enc->aspect_ratio;
rfps = ic->streams[i]->r_frame_rate;
rfps_base = ic->streams[i]->r_frame_rate_base;
enc->workaround_bugs = workaround_bugs;
@ -2171,6 +2173,7 @@ static void opt_output_file(const char *filename)
video_enc->width = frame_width;
video_enc->height = frame_height;
video_enc->aspect_ratio = frame_aspect_ratio;
if (!intra_only)
video_enc->gop_size = gop_size;

View File

@ -538,16 +538,17 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
width = 720;
if (dsf) {
avctx->frame_rate = 25;
avctx->frame_rate_base = 1;
packet_size = PAL_FRAME_SIZE;
height = 576;
nb_dif_segs = 12;
} else {
avctx->frame_rate = 30;
avctx->frame_rate = 30000;
avctx->frame_rate_base = 1001;
packet_size = NTSC_FRAME_SIZE;
height = 480;
nb_dif_segs = 10;
}
avctx->frame_rate_base= 1;
/* NOTE: we only accept several full frames */
if (buf_size < packet_size)
return -1;
@ -723,8 +724,8 @@ static int dvaudio_decode_frame(AVCodecContext *avctx,
avctx->sample_rate = dv_audio_frequency[freq];
avctx->channels = 2;
avctx->bit_rate = avctx->channels * avctx->sample_rate * 16;
// What about:
// avctx->bit_rate =
// avctx->frame_size =
*data_size = (dv_audio_min_samples[sys][freq] + smpls) *