X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fproxy.C;h=fd1ba562cb725aaebee1b41fce341f0710483d87;hp=4394120d916f1f77006a6dfac7ff656dfc154674;hb=c905fabd0678fcc8ab9e32e4443ad8709adafefd;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/cinelerra/proxy.C b/cinelerra-5.1/cinelerra/proxy.C index 4394120d..fd1ba562 100644 --- a/cinelerra-5.1/cinelerra/proxy.C +++ b/cinelerra-5.1/cinelerra/proxy.C @@ -82,6 +82,13 @@ ProxyDialog::ProxyDialog(MWindow *mwindow) this->mwindow = mwindow; gui = 0; asset = new Asset; + +// quicker than some, not as good as others + asset->format = FILE_FFMPEG; + strcpy(asset->fformat, "mpeg"); + strcpy(asset->vcodec, "mpeg.mpeg"); + asset->ff_video_bitrate = 2000000; + bzero(size_text, sizeof(char*) * MAX_SIZES); bzero(size_factors, sizeof(int) * MAX_SIZES); size_text[0] = cstrdup(_("Original size")); @@ -130,9 +137,6 @@ void ProxyDialog::calculate_sizes() } total_sizes = 1; - int orig_w = mwindow->edl->session->output_w * orig_scale; - int orig_h = mwindow->edl->session->output_h * orig_scale; - if( !use_scaler ) { // w,h should stay even for yuv int ow = orig_w, oh = orig_h; @@ -333,7 +337,7 @@ int ProxyRender::create_needed_proxies(int new_scale) ProxyFarm engine(mwindow, this, &needed_idxbls, &needed_proxies); engine.process_packages(); -printf("failed=%d canceled=%d\n", failed, progress->is_cancelled()); +printf("proxy: failed=%d canceled=%d\n", failed, progress->is_cancelled()); // stop progress bar canceled = progress->is_cancelled(); @@ -374,6 +378,12 @@ void ProxyWindow::create_objects() dialog->auto_scale = mwindow->edl->session->proxy_auto_scale; dialog->beep = mwindow->edl->session->proxy_beep; dialog->new_scale = dialog->orig_scale; + dialog->orig_w = mwindow->edl->session->output_w; + dialog->orig_h = mwindow->edl->session->output_h; + if( !dialog->use_scaler ) { + dialog->orig_w *= dialog->orig_scale; + dialog->orig_h *= dialog->orig_scale; + } int x = margin; int y = margin+10; @@ -384,7 +394,7 @@ void ProxyWindow::create_objects() add_subwindow(text = new BC_Title(x, y, _("Scale factor:"))); x += text->get_w() + margin; - int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])); + int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+15); add_subwindow(scale_factor = new ProxyMenu(mwindow, this, x, y, popupmenu_w, "")); scale_factor->update_sizes(); x += scale_factor->get_w() + margin; @@ -439,11 +449,9 @@ void ProxyFormatTools::update_format() void ProxyWindow::update() { char string[BCSTRLEN]; - int orig_w = mwindow->edl->session->output_w * dialog->orig_scale; - int orig_h = mwindow->edl->session->output_h * dialog->orig_scale; - int new_w = orig_w / dialog->new_scale; + int new_w = dialog->orig_w / dialog->new_scale; if( new_w & 1 ) ++new_w; - int new_h = orig_h / dialog->new_scale; + int new_h = dialog->orig_h / dialog->new_scale; if( new_h & 1 ) ++new_h; sprintf(string, "%dx%d", new_w, new_h); new_dimensions->update(string); @@ -543,7 +551,6 @@ int ProxyMenu::handle_event() for( int i = 0; i < dialog->total_sizes; i++ ) { if( !strcmp(get_text(), pwindow->dialog->size_text[i]) ) { dialog->new_scale = pwindow->dialog->size_factors[i]; - if( dialog->new_scale == 1 ) dialog->use_scaler = 0; pwindow->update(); break; } @@ -630,6 +637,11 @@ void ProxyClient::process_package(LoadPackage *ptr) int jobs = proxy_render->needed_proxies.size(); int processors = preferences->project_smp / jobs + 1, result = 0; +// each cpu should process at least about 1 MB, or it thrashes + int size = edl->session->output_w * edl->session->output_h * 4; + int cpus = size / 0x100000 + 1; + if( processors > cpus ) processors = cpus; + if( orig->is_asset ) { src_file = new File; src_file->set_processors(processors);