From: Good Guy Date: Mon, 14 Jun 2021 23:29:39 +0000 (-0600) Subject: Andrew rates additions X-Git-Tag: 2021-06~5 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=071118a29f7a9b123cd313fca29bdc65368613ca;p=goodguy%2Fcinelerra.git Andrew rates additions --- diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index df39763c..90e4a851 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -1853,12 +1853,15 @@ int FFMPEG::check_sample_rate(AVCodec *codec, int sample_rate) return 0; } +// check_frame_rate and std_frame_rate needed for 23.976 +// and 59.94 fps mpeg2 static inline AVRational std_frame_rate(int i) { static const int m1 = 1001*12, m2 = 1000*12; static const int freqs[] = { 40*m1, 48*m1, 50*m1, 60*m1, 80*m1,120*m1, 240*m1, - 24*m2, 30*m2, 60*m2, 12*m2, 15*m2, 48*m2, 0, + 24*m2, 30*m2, 60*m2, 12*m2, 15*m2, 48*m2, 90*m2, + 100*m2, 120*m2, 144*m2, 72*m2, 0, }; int freq = i<30*12 ? (i+1)*1001 : freqs[i-30*12]; return (AVRational) { freq, 1001*12 }; @@ -2914,7 +2917,12 @@ int FFMPEG::open_encoder(const char *type, const char *spec) int mask_h = (1<log2_chroma_h)-1; ctx->height = (vid->height+mask_h) & ~mask_h; ctx->sample_aspect_ratio = to_sample_aspect_ratio(asset); - AVRational frame_rate = check_frame_rate(codec->supported_framerates, vid->frame_rate); + AVRational frame_rate; + if (ctx->codec->id == AV_CODEC_ID_MPEG1VIDEO || + ctx->codec->id == AV_CODEC_ID_MPEG2VIDEO) + frame_rate = check_frame_rate(codec->supported_framerates, vid->frame_rate); + else + frame_rate = av_d2q(vid->frame_rate, INT_MAX); if( !frame_rate.num || !frame_rate.den ) { eprintf(_("check_frame_rate failed %s\n"), filename); ret = 1; diff --git a/cinelerra-5.1/cinelerra/theme.C b/cinelerra-5.1/cinelerra/theme.C index ab22ec8e..0c364f73 100644 --- a/cinelerra-5.1/cinelerra/theme.C +++ b/cinelerra-5.1/cinelerra/theme.C @@ -286,6 +286,7 @@ void Theme::build_menus() frame_sizes.append(new BC_ListBoxItem("160x120 ")); frame_sizes.append(new BC_ListBoxItem("240x160 HQVGA")); frame_sizes.append(new BC_ListBoxItem("320x240 ")); + frame_sizes.append(new BC_ListBoxItem("352x288 ")); frame_sizes.append(new BC_ListBoxItem("360x240 ")); frame_sizes.append(new BC_ListBoxItem("384x288 CIF")); frame_sizes.append(new BC_ListBoxItem("400x300 qSVGA")); @@ -337,12 +338,15 @@ void Theme::build_menus() frame_sizes.append(new BC_ListBoxItem("7680x4320 8K UHD")); sample_rates.append(new BC_ListBoxItem("8000")); + sample_rates.append(new BC_ListBoxItem("11025")); sample_rates.append(new BC_ListBoxItem("16000")); sample_rates.append(new BC_ListBoxItem("22050")); sample_rates.append(new BC_ListBoxItem("32000")); sample_rates.append(new BC_ListBoxItem("44100")); sample_rates.append(new BC_ListBoxItem("48000")); + sample_rates.append(new BC_ListBoxItem("88000")); sample_rates.append(new BC_ListBoxItem("96000")); + sample_rates.append(new BC_ListBoxItem("176400")); sample_rates.append(new BC_ListBoxItem("192000")); frame_rates.append(new BC_ListBoxItem("0.25")); @@ -359,8 +363,12 @@ void Theme::build_menus() frame_rates.append(new BC_ListBoxItem("50")); frame_rates.append(new BC_ListBoxItem("59.94")); frame_rates.append(new BC_ListBoxItem("60")); + frame_rates.append(new BC_ListBoxItem("72")); + frame_rates.append(new BC_ListBoxItem("85")); + frame_rates.append(new BC_ListBoxItem("90")); frame_rates.append(new BC_ListBoxItem("100")); frame_rates.append(new BC_ListBoxItem("120")); + frame_rates.append(new BC_ListBoxItem("144")); frame_rates.append(new BC_ListBoxItem("1000")); char string[BCTEXTLEN];