X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffilempeg.C;h=49dfedeac79d720c5b5d7c84011aa656e3dfb4d6;hp=986ac9289ee9ff93debcd54394d18430d8bb1ede;hb=refs%2Fheads%2Fmaster;hpb=0df48ad2d876409c5beeae2e21933a728ea76c33 diff --git a/cinelerra-5.1/cinelerra/filempeg.C b/cinelerra-5.1/cinelerra/filempeg.C index 986ac928..49dfedea 100644 --- a/cinelerra-5.1/cinelerra/filempeg.C +++ b/cinelerra-5.1/cinelerra/filempeg.C @@ -501,10 +501,6 @@ int FileMPEG::open_file(int rd, int wr) { append_vcommand_line("-a"); // Square pixels - if(EQUIV((double)asset->width / asset->height, - asset->aspect_ratio)) - append_vcommand_line("1"); - else if(EQUIV(asset->aspect_ratio, 1.333)) append_vcommand_line("2"); else @@ -513,6 +509,10 @@ int FileMPEG::open_file(int rd, int wr) else if(EQUIV(asset->aspect_ratio, 2.11)) append_vcommand_line("4"); + else + if(EQUIV((double)asset->width / asset->height, + asset->aspect_ratio)) + append_vcommand_line("1"); } append_vcommand_line(asset->vmpeg_derivative == 1 ? "-1" : ""); @@ -622,9 +622,38 @@ int FileMPEG::open_file(int rd, int wr) sprintf(string, " -F %d", frame_rate_code); strncat(mjpeg_command, string, sizeof(mjpeg_command)); + sprintf(string, " -H"); /* Maximize high-frequency resolution */ + strncat(mjpeg_command, string, sizeof(mjpeg_command)); - - + if(asset->vmpeg_preset == 3) /* no constrains for mpeg2 generic */ + { + sprintf(string, " --no-constraints"); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + sprintf(string, " -V 500"); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + } + + if(asset->vmpeg_preset == 13) /* set high profile for 1080 */ + { + sprintf(string, " -l high"); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + } + + if(asset->vmpeg_preset == 6) /* set -T for vcd */ + { + sprintf(string, " -T 35"); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + } + + if(asset->vmpeg_preset == 7) /* set -T for svcd */ + { + sprintf(string, " -T 120"); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + } + + sprintf(string, " -c"); /* set closed gop */ + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + strncat(mjpeg_command, asset->vmpeg_progressive ? " -I 0" : " -I 1", @@ -1720,6 +1749,8 @@ MPEGConfigAudio::MPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset) { this->parent_window = parent_window; this->asset = asset; +// *** CONTEXT_HELP *** + context_help_set_keyword("Single File Rendering"); } MPEGConfigAudio::~MPEGConfigAudio() @@ -1874,6 +1905,8 @@ MPEGConfigVideo::MPEGConfigVideo(BC_WindowBase *parent_window, this->parent_window = parent_window; this->asset = asset; reset_cmodel(); +// *** CONTEXT_HELP *** + context_help_set_keyword("Single File Rendering"); } MPEGConfigVideo::~MPEGConfigVideo() @@ -1898,6 +1931,8 @@ void MPEGConfigVideo::create_objects() add_subwindow(cmodel = new MPEGColorModel(x1, y, this)); cmodel->create_objects(); y += yS(30); + add_subwindow(derivative = new MPEGDerivative(x1, y, this)); + derivative->create_objects(); update_cmodel_objs(); @@ -1916,7 +1951,6 @@ int MPEGConfigVideo::close_event() void MPEGConfigVideo::delete_cmodel_objs() { delete preset; - delete derivative; delete bitrate; delete fixed_bitrate; delete quant; @@ -1934,7 +1968,6 @@ void MPEGConfigVideo::delete_cmodel_objs() void MPEGConfigVideo::reset_cmodel() { preset = 0; - derivative = 0; bitrate = 0; fixed_bitrate = 0; quant = 0; @@ -1969,8 +2002,7 @@ void MPEGConfigVideo::update_cmodel_objs() add_subwindow(title = new BC_Title(x, y + ys5, _("Derivative:"))); titles.append(title); - add_subwindow(derivative = new MPEGDerivative(x1, y, this)); - derivative->create_objects(); + derivative->reposition_window(x1, y); y += ys30; add_subwindow(title = new BC_Title(x, y + ys5, _("Bitrate:"))); @@ -2028,6 +2060,14 @@ void MPEGDerivative::create_objects() int MPEGDerivative::handle_event() { gui->asset->vmpeg_derivative = string_to_derivative(get_text()); + if( gui->asset->vmpeg_derivative == 1 ) { + gui->asset->vmpeg_cmodel = BC_YUV420P; + char *text = MPEGColorModel::cmodel_to_string(gui->asset->vmpeg_cmodel); + gui->cmodel->set_text(text); + } + gui->cmodel->create_objects(); + gui->update_cmodel_objs(); + gui->show_window(1); return 1; }; @@ -2197,8 +2237,10 @@ MPEGColorModel::MPEGColorModel(int x, int y, MPEGConfigVideo *gui) void MPEGColorModel::create_objects() { + while( total_items() > 0 ) del_item(0); add_item(new BC_MenuItem(cmodel_to_string(BC_YUV420P))); - add_item(new BC_MenuItem(cmodel_to_string(BC_YUV422P))); + if( gui->asset->vmpeg_derivative == 2 ) + add_item(new BC_MenuItem(cmodel_to_string(BC_YUV422P))); } int MPEGColorModel::handle_event() @@ -2207,7 +2249,7 @@ int MPEGColorModel::handle_event() gui->update_cmodel_objs(); gui->show_window(1); return 1; -}; +} int MPEGColorModel::string_to_cmodel(char *string) {