From 047485402c380ee034045712121c649ddf89eda4 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Thu, 11 Jan 2018 15:15:46 -0700 Subject: [PATCH] rework batchrender, renderfarm improvements, ffmpeg audio quality, a few fixes --- cinelerra-5.1/cinelerra/asset.C | 9 +- cinelerra-5.1/cinelerra/asset.h | 1 + cinelerra-5.1/cinelerra/batchrender.C | 471 ++++++++------------ cinelerra-5.1/cinelerra/batchrender.h | 35 +- cinelerra-5.1/cinelerra/bdcreate.C | 4 +- cinelerra-5.1/cinelerra/dcraw.C | 2 +- cinelerra-5.1/cinelerra/dvdcreate.C | 20 +- cinelerra-5.1/cinelerra/ffmpeg.C | 13 + cinelerra-5.1/cinelerra/file.C | 38 +- cinelerra-5.1/cinelerra/file.h | 8 +- cinelerra-5.1/cinelerra/fileffmpeg.C | 28 +- cinelerra-5.1/cinelerra/fileffmpeg.h | 9 + cinelerra-5.1/cinelerra/fileogg.C | 19 +- cinelerra-5.1/cinelerra/formattools.C | 94 +--- cinelerra-5.1/cinelerra/formattools.h | 47 +- cinelerra-5.1/cinelerra/formattools.inc | 11 + cinelerra-5.1/cinelerra/menueffects.C | 10 +- cinelerra-5.1/cinelerra/menueffects.h | 2 +- cinelerra-5.1/cinelerra/performanceprefs.C | 41 +- cinelerra-5.1/cinelerra/preferences.C | 1 + cinelerra-5.1/cinelerra/preferencesthread.C | 2 +- cinelerra-5.1/cinelerra/recordprefs.C | 2 +- cinelerra-5.1/cinelerra/render.C | 29 +- cinelerra-5.1/cinelerra/render.h | 4 +- cinelerra-5.1/cinelerra/renderprofiles.C | 9 +- cinelerra-5.1/cinelerra/shbtnprefs.C | 2 +- cinelerra-5.1/doc/Makefile | 1 + cinelerra-5.1/doc/RenderMux.sh | 2 + cinelerra-5.1/ffmpeg/video/mp4.dfl | 2 +- 29 files changed, 407 insertions(+), 509 deletions(-) create mode 100755 cinelerra-5.1/doc/RenderMux.sh diff --git a/cinelerra-5.1/cinelerra/asset.C b/cinelerra-5.1/cinelerra/asset.C index bb56d8bf..0993b12f 100644 --- a/cinelerra-5.1/cinelerra/asset.C +++ b/cinelerra-5.1/cinelerra/asset.C @@ -87,6 +87,7 @@ int Asset::init_values() ff_audio_options[0] = 0; ff_video_options[0] = 0; ff_audio_bitrate = 0; + ff_audio_quality = -1; ff_video_bitrate = 0; ff_video_quality = -1; @@ -224,6 +225,7 @@ void Asset::copy_format(Asset *asset, int do_index) strcpy(ff_audio_options, asset->ff_audio_options); strcpy(ff_video_options, asset->ff_video_options); ff_audio_bitrate = asset->ff_audio_bitrate; + ff_audio_quality = asset->ff_audio_quality; ff_video_bitrate = asset->ff_video_bitrate; ff_video_quality = asset->ff_video_quality; @@ -351,8 +353,8 @@ int Asset::equivalent(Asset &asset, int test_audio, int test_video, EDL *edl) !strcmp(acodec, asset.acodec)); if(result && format == FILE_FFMPEG) result = !strcmp(ff_audio_options, asset.ff_audio_options) && - ff_audio_bitrate == asset.ff_audio_bitrate; - + ff_audio_bitrate == asset.ff_audio_bitrate && + ff_audio_quality == asset.ff_audio_quality; } @@ -794,6 +796,7 @@ void Asset::load_defaults(BC_Hash *defaults, GET_DEFAULT("FF_AUDIO_OPTIONS", ff_audio_options); ff_audio_bitrate = GET_DEFAULT("FF_AUDIO_BITRATE", ff_audio_bitrate); + ff_audio_quality = GET_DEFAULT("FF_AUDIO_QUALITY", ff_audio_quality); GET_DEFAULT("FF_VIDEO_OPTIONS", ff_video_options); ff_video_bitrate = GET_DEFAULT("FF_VIDEO_BITRATE", ff_video_bitrate); ff_video_quality = GET_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality); @@ -885,6 +888,7 @@ void Asset::save_defaults(BC_Hash *defaults, UPDATE_DEFAULT("FF_AUDIO_OPTIONS", ff_audio_options); UPDATE_DEFAULT("FF_AUDIO_BITRATE", ff_audio_bitrate); + UPDATE_DEFAULT("FF_AUDIO_QUALITY", ff_audio_quality); UPDATE_DEFAULT("FF_VIDEO_OPTIONS", ff_video_options); UPDATE_DEFAULT("FF_VIDEO_BITRATE", ff_video_bitrate); UPDATE_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality); @@ -985,6 +989,7 @@ int Asset::dump(FILE *fp) fprintf(fp," fformat=\"%s\"\n", fformat); fprintf(fp," ff_audio_options=\"%s\"\n", ff_audio_options); fprintf(fp," ff_audio_bitrate=%d\n", ff_audio_bitrate); + fprintf(fp," ff_audio_quality=%d\n", ff_audio_quality); fprintf(fp," ff_video_options=\"%s\"\n", ff_video_options); fprintf(fp," ff_video_bitrate=%d\n", ff_video_bitrate); fprintf(fp," ff_video_quality=%d\n", ff_video_quality); diff --git a/cinelerra-5.1/cinelerra/asset.h b/cinelerra-5.1/cinelerra/asset.h index 871ab225..b90cacfc 100644 --- a/cinelerra-5.1/cinelerra/asset.h +++ b/cinelerra-5.1/cinelerra/asset.h @@ -211,6 +211,7 @@ public: char ff_audio_options[BCTEXTLEN]; char ff_video_options[BCTEXTLEN]; int ff_audio_bitrate; + int ff_audio_quality; int ff_video_bitrate; int ff_video_quality; diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index 0b0e9d01..8a1bc56f 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -55,21 +55,10 @@ #include "transportque.h" #include "vframe.h" - -static const char *list_titles[] = -{ - _("Enabled"), - _("Output"), - _("EDL"), - _("Elapsed") -}; - -static int list_widths[] = -{ - 50, - 100, - 200, - 100 +// Farmed is not present if not preferences->use_renderfarm +int BatchRenderThread::column_widths[] = { 42, 42, 42, 222, 222, 150 }; +const char *BatchRenderThread::column_titles[] = { + _("Enabled"), _("Labeled"), _("Farmed"), _("Output"), _("EDL"), _("Elapsed") }; BatchRenderMenuItem::BatchRenderMenuItem(MWindow *mwindow) @@ -86,17 +75,11 @@ int BatchRenderMenuItem::handle_event() } - - - - - - -BatchRenderJob::BatchRenderJob(Preferences *preferences, int strategy) +BatchRenderJob::BatchRenderJob(Preferences *preferences, int labeled, int farmed) { this->preferences = preferences; - this->strategy = strategy; - file_per_label = 0; + this->labeled = labeled; + this->farmed = farmed >= 0 ? farmed : preferences->use_renderfarm; asset = new Asset; edl_path[0] = 0; enabled = 1; @@ -110,10 +93,11 @@ BatchRenderJob::~BatchRenderJob() void BatchRenderJob::copy_from(BatchRenderJob *src) { + enabled = src->enabled; + farmed = src->farmed; + labeled = src->labeled; asset->copy_from(src->asset, 0); strcpy(edl_path, src->edl_path); - strategy = src->strategy; - enabled = src->enabled; elapsed = 0; } @@ -121,17 +105,16 @@ void BatchRenderJob::load(FileXML *file) { int result = 0; + enabled = file->tag.get_property("ENABLED", enabled); + farmed = file->tag.get_property("FARMED", farmed); + labeled = file->tag.get_property("STRATEGY", labeled); edl_path[0] = 0; file->tag.get_property("EDL_PATH", edl_path); - strategy = file->tag.get_property("STRATEGY", get_strategy()); - enabled = file->tag.get_property("ENABLED", enabled); elapsed = file->tag.get_property("ELAPSED", elapsed); result = file->read_tag(); - if(!result) - { - if(file->tag.title_is("ASSET")) - { + if( !result ) { + if( file->tag.title_is("ASSET") ) { file->tag.get_property("SRC", asset->path); asset->read(file, 0); // The compression parameters are stored in the defaults to reduce @@ -147,27 +130,20 @@ void BatchRenderJob::load(FileXML *file) void BatchRenderJob::save(FileXML *file) { - file->tag.set_property("EDL_PATH", edl_path); - file->tag.set_property("STRATEGY", get_strategy()); file->tag.set_property("ENABLED", enabled); + file->tag.set_property("FARMED", farmed); + file->tag.set_property("LABELED", labeled); + file->tag.set_property("EDL_PATH", edl_path); file->tag.set_property("ELAPSED", elapsed); file->append_tag(); file->append_newline(); - asset->write(file, - 0, - ""); + asset->write(file, 0, ""); // The compression parameters are stored in the defaults to reduce // coding maintenance. The defaults must now be stuffed into the XML for // unique storage. BC_Hash defaults; - asset->save_defaults(&defaults, - "", - 0, - 1, - 0, - 0, - 0); + asset->save_defaults(&defaults, "", 0, 1, 0, 0, 0); char *string; defaults.save_string(string); file->append_text(string); @@ -179,8 +155,9 @@ void BatchRenderJob::save(FileXML *file) int BatchRenderJob::get_strategy() { - return strategy >= 0 ? strategy : - Render::get_strategy(preferences->use_renderfarm, file_per_label); +// if set, overrides farmed, labeled + int use_renderfarm = farmed && preferences->use_renderfarm ? 1 : 0; + return Render::get_strategy(use_renderfarm, labeled); } @@ -249,12 +226,9 @@ BC_Window* BatchRenderThread::new_gui() default_job = new BatchRenderJob(mwindow->preferences); load_jobs(batch_path, mwindow->preferences); load_defaults(mwindow->defaults); - this->gui = new BatchRenderGUI(mwindow, - this, - mwindow->session->batchrender_x, - mwindow->session->batchrender_y, - mwindow->session->batchrender_w, - mwindow->session->batchrender_h); + this->gui = new BatchRenderGUI(mwindow, this, + mwindow->session->batchrender_x, mwindow->session->batchrender_y, + mwindow->session->batchrender_w, mwindow->session->batchrender_h); this->gui->create_objects(); return this->gui; } @@ -270,18 +244,14 @@ void BatchRenderThread::load_jobs(char *path, Preferences *preferences) if( !path[0] ) create_path(path); file.read_from_file(path); - while(!result) - { - if(!(result = file.read_tag())) - { - if(file.tag.title_is("JOBS")) - { + while( !result ) { + if( !(result = file.read_tag()) ) { + if( file.tag.title_is("JOBS") ) { warn = file.tag.get_property("WARN", 1); } - else if(file.tag.title_is("JOB")) - { - BatchRenderJob *job; - jobs.append(job = new BatchRenderJob(preferences)); + else if( file.tag.title_is("JOB") ) { + BatchRenderJob *job = new BatchRenderJob(preferences); + jobs.append(job); job->load(&file); } } @@ -296,8 +266,7 @@ void BatchRenderThread::save_jobs(char *path) file.append_tag(); file.append_newline(); - for(int i = 0; i < jobs.total; i++) - { + for( int i = 0; i < jobs.total; i++ ) { file.tag.set_title("JOB"); jobs.values[i]->save(&file); } @@ -312,17 +281,15 @@ void BatchRenderThread::save_jobs(char *path) void BatchRenderThread::load_defaults(BC_Hash *defaults) { - if(default_job) - { + if( default_job ) { default_job->asset->load_defaults(defaults, "BATCHRENDER_", 1, 1, 1, 1, 1); } - for(int i = 0; i < BATCHRENDER_COLUMNS; i++) - { + for( int i = 0; i < BATCHRENDER_COLUMNS; i++ ) { char string[BCTEXTLEN]; sprintf(string, "BATCHRENDER_COLUMN%d", i); - column_width[i] = defaults->get(string, list_widths[i]); + list_width[i] = defaults->get(string, column_widths[i]); } } @@ -335,7 +302,7 @@ void BatchRenderThread::save_defaults(BC_Hash *defaults) for( int i=0; iupdate(string, column_width[i]); + defaults->update(string, list_width[i]); } // defaults->update("BATCHRENDER_JOB", current_job); if( mwindow ) @@ -365,10 +332,9 @@ void BatchRenderThread::new_job() void BatchRenderThread::delete_job() { - if(current_job < jobs.total && current_job >= 0) - { + if( current_job < jobs.total && current_job >= 0 ) { jobs.remove_object_number(current_job); - if(current_job > 0) current_job--; + if( current_job > 0 ) current_job--; gui->create_list(1); gui->change_job(); } @@ -402,16 +368,8 @@ void BatchRenderThread::update_selected_edl() BatchRenderJob* BatchRenderThread::get_current_job() { - BatchRenderJob *result; - if(current_job >= jobs.total || current_job < 0) - { - result = default_job; - } - else - { - result = jobs.values[current_job]; - } - return result; + return current_job >= 0 && current_job < jobs.total ? + jobs.values[current_job] : default_job; } @@ -499,11 +457,9 @@ int BatchRenderThread::test_edl_files() void BatchRenderThread::calculate_dest_paths(ArrayList *paths, Preferences *preferences) { - for(int i = 0; i < jobs.total; i++) - { + for( int i = 0; i < jobs.total; i++ ) { BatchRenderJob *job = jobs.values[i]; - if(job->enabled && *job->edl_path != '@') - { + if( job->enabled && *job->edl_path != '@' ) { PackageDispatcher *packages = new PackageDispatcher; // Load EDL @@ -581,7 +537,7 @@ void BatchRenderThread::start_rendering(char *config_path, //PRINT_TRACE // Test EDL files for existence - if(test_edl_files()) return; + if( test_edl_files() ) return; //PRINT_TRACE @@ -594,20 +550,18 @@ void BatchRenderThread::start_rendering(char *config_path, int result = ConfirmSave::test_files(0, &paths); paths.remove_all_objects(); // Abort on any existing file because it's so hard to set this up. - if(result) return; + if( result ) return; //PRINT_TRACE render = new Render(0); //PRINT_TRACE - render->start_batches(&jobs, - boot_defaults, - preferences); + render->start_batches(&jobs, boot_defaults, preferences); //PRINT_TRACE } void BatchRenderThread::start_rendering() { - if(is_rendering) return; + if( is_rendering ) return; is_rendering = 1; save_jobs(batch_path); @@ -615,7 +569,7 @@ void BatchRenderThread::start_rendering() gui->button_disable(); // Test EDL files for existence - if(test_edl_files()) return; + if( test_edl_files() ) return; // Predict all destination paths ArrayList paths; @@ -627,8 +581,7 @@ void BatchRenderThread::start_rendering() paths.remove_all_objects(); // User cancelled - if(result) - { + if( result ) { is_rendering = 0; gui->button_enable(); return; @@ -639,7 +592,7 @@ void BatchRenderThread::start_rendering() void BatchRenderThread::stop_rendering() { - if(!is_rendering) return; + if( !is_rendering ) return; mwindow->render->stop_operation(); is_rendering = 0; } @@ -647,13 +600,11 @@ void BatchRenderThread::stop_rendering() void BatchRenderThread::update_active(int number) { gui->lock_window("BatchRenderThread::update_active"); - if(number >= 0) - { + if( number >= 0 ) { current_job = number; rendering_job = number; } - else - { + else { rendering_job = -1; is_rendering = 0; } @@ -666,15 +617,13 @@ void BatchRenderThread::update_done(int number, double elapsed_time) { gui->lock_window("BatchRenderThread::update_done"); - if(number < 0) - { + if( number < 0 ) { gui->button_enable(); } - else - { + else { jobs.values[number]->enabled = 0; jobs.values[number]->elapsed = elapsed_time; - if(create_list) gui->create_list(1); + if( create_list ) gui->create_list(1); } gui->unlock_window(); } @@ -682,14 +631,13 @@ void BatchRenderThread::update_done(int number, void BatchRenderThread::move_batch(int src, int dst) { BatchRenderJob *src_job = jobs.values[src]; - if(dst < 0) dst = jobs.total - 1; + if( dst < 0 ) dst = jobs.total - 1; - if(dst != src) - { - for(int i = src; i < jobs.total - 1; i++) + if( dst != src ) { + for( int i = src; i < jobs.total - 1; i++ ) jobs.values[i] = jobs.values[i + 1]; -// if(dst > src) dst--; - for(int i = jobs.total - 1; i > dst; i--) +// if( dst > src ) dst--; + for( int i = jobs.total - 1; i > dst; i-- ) jobs.values[i] = jobs.values[i - 1]; jobs.values[dst] = src_job; gui->create_list(1); @@ -718,6 +666,7 @@ BatchRenderGUI::BatchRenderGUI(MWindow *mwindow, { this->mwindow = mwindow; this->thread = thread; + use_renderfarm = 0; } BatchRenderGUI::~BatchRenderGUI() @@ -745,9 +694,15 @@ void BatchRenderGUI::create_objects() format_tools = new BatchFormat(mwindow, this, thread->get_current_asset()); format_tools->set_w(get_w() / 2); + BatchRenderJob *current_job = thread->get_current_job(); format_tools->create_objects(x1, y1, 1, 1, 1, 1, 0, 1, 0, 0, - &thread->get_current_job()->file_per_label, 0); - + ¤t_job->labeled, 0); + if( mwindow->preferences->use_renderfarm ) { + use_renderfarm = new BatchRenderUseFarm(thread, x1, y1, + ¤t_job->farmed); + add_subwindow(use_renderfarm); + y1 += use_renderfarm->get_h() + 10; + } // input EDL add_subwindow(edl_path_title = new BC_Title(x2, y2, _("EDL Path:"))); y2 += edl_path_title->get_h() + mwindow->theme->widget_border; @@ -832,7 +787,8 @@ int BatchRenderGUI::resize_event(int w, int h) output_path_title->reposition_window(x1, y1); y1 += output_path_title->get_h() + mwindow->theme->widget_border; format_tools->reposition_window(x1, y1); - + if( use_renderfarm ) + use_renderfarm->reposition_window(x1, y1); // input EDL x = x2, y = y2; edl_path_title->reposition_window(x, y); @@ -895,79 +851,80 @@ int BatchRenderGUI::close_event() void BatchRenderGUI::create_list(int update_widget) { - for(int i = 0; i < BATCHRENDER_COLUMNS; i++) - { - list_columns[i].remove_all_objects(); + for( int i = 0; i < BATCHRENDER_COLUMNS; i++ ) { + list_items[i].remove_all_objects(); } - for(int i = 0; i < thread->jobs.total; i++) - { + const char **column_titles = BatchRenderThread::column_titles; + list_columns = 0; + list_titles[list_columns] = column_titles[ENABLED_COL]; + list_width[list_columns++] = thread->list_width[ENABLED_COL]; + list_titles[list_columns] = column_titles[LABELED_COL]; + list_width[list_columns++] = thread->list_width[LABELED_COL]; + if( mwindow->preferences->use_renderfarm ) { + list_titles[list_columns] = column_titles[FARMED_COL]; + list_width[list_columns++] = thread->list_width[FARMED_COL]; + } + list_titles[list_columns] = column_titles[OUTPUT_COL]; + list_width[list_columns++] = thread->list_width[OUTPUT_COL]; + list_titles[list_columns] = column_titles[EDL_COL]; + list_width[list_columns++] = thread->list_width[EDL_COL]; + list_titles[list_columns] = column_titles[ELAPSED_COL]; + list_width[list_columns++] = thread->list_width[ELAPSED_COL]; + + for( int i = 0; i < thread->jobs.total; i++ ) { BatchRenderJob *job = thread->jobs.values[i]; char string[BCTEXTLEN]; - BC_ListBoxItem *enabled = new BC_ListBoxItem(job->enabled ? - (char*)"X" : - (char*)" "); - BC_ListBoxItem *item1 = new BC_ListBoxItem(job->asset->path); - BC_ListBoxItem *item2 = new BC_ListBoxItem(job->edl_path); - BC_ListBoxItem *item3; - if(job->elapsed) - item3 = new BC_ListBoxItem( - Units::totext(string, - job->elapsed, - TIME_HMS2)); - else - item3 = new BC_ListBoxItem(_("Unknown")); - list_columns[0].append(enabled); - list_columns[1].append(item1); - list_columns[2].append(item2); - list_columns[3].append(item3); - if(i == thread->current_job) - { + BC_ListBoxItem *enabled = new BC_ListBoxItem(job->enabled ? "X" : " "); + BC_ListBoxItem *labeled = new BC_ListBoxItem(job->labeled ? "X" : " "); + BC_ListBoxItem *farmed = !mwindow->preferences->use_renderfarm ? 0 : + new BC_ListBoxItem(job->farmed ? "X" : " "); + BC_ListBoxItem *out_path = new BC_ListBoxItem(job->asset->path); + BC_ListBoxItem *edl_path = new BC_ListBoxItem(job->edl_path); + BC_ListBoxItem *elapsed = new BC_ListBoxItem(!job->elapsed ? _("Unknown") : + Units::totext(string, job->elapsed, TIME_HMS2)); + int col = 0; + list_items[col++].append(enabled); + list_items[col++].append(labeled); + if( farmed ) list_items[col++].append(farmed); + list_items[col++].append(out_path); + list_items[col++].append(edl_path); + list_items[col].append(elapsed); + if( i == thread->current_job ) { enabled->set_selected(1); - item1->set_selected(1); - item2->set_selected(1); - item3->set_selected(1); + labeled->set_selected(1); + if( farmed ) farmed->set_selected(1); + out_path->set_selected(1); + edl_path->set_selected(1); + elapsed->set_selected(1); } - if(i == thread->rendering_job) - { + if( i == thread->rendering_job ) { enabled->set_color(RED); - item1->set_color(RED); - item2->set_color(RED); - item3->set_color(RED); + labeled->set_color(RED); + if( farmed ) farmed->set_color(RED); + out_path->set_color(RED); + edl_path->set_color(RED); + elapsed->set_color(RED); } } - if(update_widget) - { - batch_list->update(list_columns, - list_titles, - thread->column_width, - BATCHRENDER_COLUMNS, - batch_list->get_xposition(), - batch_list->get_yposition(), - batch_list->get_highlighted_item(), // Flat index of item cursor is over - 1, // set all autoplace flags to 1 - 1); + if( update_widget ) { + batch_list->update(list_items, list_titles, list_width, list_columns, + batch_list->get_xposition(), batch_list->get_yposition(), + batch_list->get_highlighted_item(), 1, 1); } } void BatchRenderGUI::change_job() { BatchRenderJob *job = thread->get_current_job(); - format_tools->update(job->asset, &job->file_per_label); + format_tools->update(job->asset, &job->labeled); + if( use_renderfarm ) use_renderfarm->update(&job->farmed); edl_path_text->update(job->edl_path); } - - - - - - -BatchFormat::BatchFormat(MWindow *mwindow, - BatchRenderGUI *gui, - Asset *asset) +BatchFormat::BatchFormat(MWindow *mwindow, BatchRenderGUI *gui, Asset *asset) : FormatTools(mwindow, gui, asset) { this->gui = gui; @@ -985,26 +942,9 @@ int BatchFormat::handle_event() return 1; } - - - - - - - - - - BatchRenderEDLPath::BatchRenderEDLPath(BatchRenderThread *thread, - int x, - int y, - int w, - char *text) - : BC_TextBox(x, - y, - w, - 1, - text) + int x, int y, int w, char *text) + : BC_TextBox(x, y, w, 1, text) { this->thread = thread; } @@ -1018,11 +958,6 @@ int BatchRenderEDLPath::handle_event() return 1; } - - - - - BatchRenderNew::BatchRenderNew(BatchRenderThread *thread, int x, int y) @@ -1037,9 +972,7 @@ int BatchRenderNew::handle_event() return 1; } -BatchRenderDelete::BatchRenderDelete(BatchRenderThread *thread, - int x, - int y) +BatchRenderDelete::BatchRenderDelete(BatchRenderThread *thread, int x, int y) : BC_GenericButton(x, y, _("Delete")) { this->thread = thread; @@ -1053,9 +986,7 @@ int BatchRenderDelete::handle_event() -BatchRenderSaveList::BatchRenderSaveList(BatchRenderThread *thread, - int x, - int y) +BatchRenderSaveList::BatchRenderSaveList(BatchRenderThread *thread, int x, int y) : BC_GenericButton(x, y, _("Save Jobs")) { this->thread = thread; @@ -1067,8 +998,7 @@ BatchRenderSaveList::BatchRenderSaveList(BatchRenderThread *thread, BatchRenderSaveList::~BatchRenderSaveList() { startup_lock->lock("BatchRenderSaveList::~BrowseButton"); - if(gui) - { + if( gui ) { gui->lock_window(); gui->set_done(1); gui->unlock_window(); @@ -1080,10 +1010,8 @@ BatchRenderSaveList::~BatchRenderSaveList() int BatchRenderSaveList::handle_event() { - if(Thread::running()) - { - if(gui) - { + if( Thread::running() ) { + if( gui ) { gui->lock_window(); gui->raise_window(); gui->unlock_window(); @@ -1111,7 +1039,7 @@ void BatchRenderSaveList::run() filewindow.create_objects(); int result2 = filewindow.run_window(); - if(!result2) { + if( !result2 ) { strcpy(thread->batch_path, filewindow.get_submitted_path()); thread->gui->batch_path->update(thread->batch_path); thread->mwindow->defaults->update("DEFAULT_BATCHLOADPATH", thread->batch_path); @@ -1125,14 +1053,12 @@ void BatchRenderSaveList::run() } int BatchRenderSaveList::keypress_event() { - if (get_keypress() == 's' || - get_keypress() == 'S') return handle_event(); + if( get_keypress() == 's' || + get_keypress() == 'S' ) return handle_event(); return 0; } - - BatchRenderLoadList::BatchRenderLoadList(BatchRenderThread *thread, int x, int y) @@ -1148,7 +1074,7 @@ BatchRenderLoadList::BatchRenderLoadList(BatchRenderThread *thread, BatchRenderLoadList::~BatchRenderLoadList() { startup_lock->lock("BatchRenderLoadList::~BrowseButton"); - if(gui) { + if( gui ) { gui->lock_window(); gui->set_done(1); gui->unlock_window(); @@ -1160,8 +1086,8 @@ BatchRenderLoadList::~BatchRenderLoadList() int BatchRenderLoadList::handle_event() { - if(Thread::running()) { - if(gui) { + if( Thread::running() ) { + if( gui ) { gui->lock_window(); gui->raise_window(); gui->unlock_window(); @@ -1189,7 +1115,7 @@ void BatchRenderLoadList::run() filewindow.create_objects(); int result2 = filewindow.run_window(); - if(!result2) { + if( !result2 ) { strcpy(thread->batch_path, filewindow.get_submitted_path()); thread->gui->batch_path->update(thread->batch_path); thread->mwindow->defaults->update("DEFAULT_BATCHLOADPATH", thread->batch_path); @@ -1206,8 +1132,8 @@ void BatchRenderLoadList::run() } int BatchRenderLoadList::keypress_event() { - if (get_keypress() == 'o' || - get_keypress() == 'O') return handle_event(); + if( get_keypress() == 'o' || + get_keypress() == 'O' ) return handle_event(); return 0; } @@ -1240,27 +1166,11 @@ int BatchRenderUpdateEDL::handle_event() } - - BatchRenderList::BatchRenderList(BatchRenderThread *thread, - int x, - int y, - int w, - int h) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - thread->gui->list_columns, - list_titles, - thread->column_width, - BATCHRENDER_COLUMNS, - 0, - 0, - LISTBOX_SINGLE, - ICON_LEFT, - 1) + int x, int y, int w, int h) + : BC_ListBox(x, y, w, h, LISTBOX_TEXT, thread->gui->list_items, + thread->gui->list_titles, thread->gui->list_width, thread->gui->list_columns, + 0, 0, LISTBOX_SINGLE, ICON_LEFT, 1) { this->thread = thread; dragging_item = 0; @@ -1276,28 +1186,36 @@ int BatchRenderList::selection_changed() { thread->current_job = get_selection_number(0, 0); thread->gui->change_job(); - if(get_cursor_x() < thread->column_width[0]) - { - BatchRenderJob *job = thread->get_current_job(); + int cursor_x = get_cursor_x(); + BatchRenderJob *job = thread->get_current_job(); + int col_x = 0, changed = 1; + if( cursor_x < (col_x += thread->list_width[ENABLED_COL]) ) job->enabled = !job->enabled; + else if( cursor_x < (col_x += thread->list_width[LABELED_COL]) ) + job->labeled = job->edl_path[0] != '@' ? !job->labeled : 0; + else if( thread->gui->use_renderfarm && + cursor_x < (col_x += thread->list_width[FARMED_COL]) ) + job->farmed = job->edl_path[0] != '@' ? !job->farmed : 0; + else + changed = 0; + if( changed ) { thread->gui->create_list(1); + thread->gui->change_job(); } return 1; } int BatchRenderList::column_resize_event() { - for(int i = 0; i < BATCHRENDER_COLUMNS; i++) - { - thread->column_width[i] = get_column_width(i); + for( int i = 0; i < BATCHRENDER_COLUMNS; i++ ) { + thread->list_width[i] = get_column_width(i); } return 1; } int BatchRenderList::drag_start_event() { - if(BC_ListBox::drag_start_event()) - { + if( BC_ListBox::drag_start_event() ) { dragging_item = 1; return 1; } @@ -1307,8 +1225,7 @@ int BatchRenderList::drag_start_event() int BatchRenderList::drag_motion_event() { - if(BC_ListBox::drag_motion_event()) - { + if( BC_ListBox::drag_motion_event() ) { return 1; } return 0; @@ -1316,12 +1233,10 @@ int BatchRenderList::drag_motion_event() int BatchRenderList::drag_stop_event() { - if(dragging_item) - { + if( dragging_item ) { int src = get_selection_number(0, 0); int dst = get_highlighted_item(); - if(src != dst) - { + if( src != dst ) { thread->move_batch(src, dst); } BC_ListBox::drag_stop_event(); @@ -1331,22 +1246,8 @@ int BatchRenderList::drag_stop_event() - - - - - - - - - - -BatchRenderStart::BatchRenderStart(BatchRenderThread *thread, - int x, - int y) - : BC_GenericButton(x, - y, - _("Start")) +BatchRenderStart::BatchRenderStart(BatchRenderThread *thread, int x, int y) + : BC_GenericButton(x, y, _("Start")) { this->thread = thread; } @@ -1357,12 +1258,8 @@ int BatchRenderStart::handle_event() return 1; } -BatchRenderStop::BatchRenderStop(BatchRenderThread *thread, - int x, - int y) - : BC_GenericButton(x, - y, - _("Stop")) +BatchRenderStop::BatchRenderStop(BatchRenderThread *thread, int x, int y) + : BC_GenericButton(x, y, _("Stop")) { this->thread = thread; } @@ -1388,13 +1285,8 @@ int BatchRenderWarning::handle_event() return 1; } - -BatchRenderCancel::BatchRenderCancel(BatchRenderThread *thread, - int x, - int y) - : BC_GenericButton(x, - y, - _("Close")) +BatchRenderCancel::BatchRenderCancel(BatchRenderThread *thread, int x, int y) + : BC_GenericButton(x, y, _("Close")) { this->thread = thread; } @@ -1410,8 +1302,7 @@ int BatchRenderCancel::handle_event() int BatchRenderCancel::keypress_event() { - if(get_keypress() == ESC) - { + if( get_keypress() == ESC ) { unlock_window(); thread->stop_rendering(); lock_window("BatchRenderCancel::keypress_event"); @@ -1421,3 +1312,23 @@ int BatchRenderCancel::keypress_event() return 0; } +BatchRenderUseFarm::BatchRenderUseFarm(BatchRenderThread *thread, int x, int y, int *output) + : BC_CheckBox(x, y, *output, _("Use render farm")) +{ + this->thread = thread; + this->output = output; +} + +int BatchRenderUseFarm::handle_event() +{ + *output = get_value(); + thread->gui->create_list(1); + return 1; +} + +void BatchRenderUseFarm::update(int *output) +{ + this->output = output; + BC_CheckBox::update(*output); +} + diff --git a/cinelerra-5.1/cinelerra/batchrender.h b/cinelerra-5.1/cinelerra/batchrender.h index 6dfcabb4..3350f792 100644 --- a/cinelerra-5.1/cinelerra/batchrender.h +++ b/cinelerra-5.1/cinelerra/batchrender.h @@ -36,10 +36,11 @@ #include "render.inc" #include "timeentry.h" -#define BATCHRENDER_COLUMNS 4 - - - +enum { + ENABLED_COL, LABELED_COL, FARMED_COL, + OUTPUT_COL, EDL_COL, ELAPSED_COL, + BATCHRENDER_COLUMNS +}; class BatchRenderMenuItem : public BC_MenuItem { @@ -54,7 +55,7 @@ public: class BatchRenderJob { public: - BatchRenderJob(Preferences *preferences, int strategy=-1); + BatchRenderJob(Preferences *preferences, int labeled=0, int farmed=-1); ~BatchRenderJob(); void copy_from(BatchRenderJob *src); @@ -66,8 +67,7 @@ public: char edl_path[BCTEXTLEN]; // Destination file for output Asset *asset; - int strategy; - int file_per_label; + int labeled, farmed; int enabled; // Amount of time elapsed in last render operation double elapsed; @@ -131,7 +131,10 @@ public: Preferences *preferences; Render *render; BatchRenderGUI *gui; - int column_width[BATCHRENDER_COLUMNS]; + + static const char *column_titles[BATCHRENDER_COLUMNS]; + static int column_widths[BATCHRENDER_COLUMNS]; + int list_width[BATCHRENDER_COLUMNS]; // job being edited int current_job; // job being rendered @@ -275,6 +278,17 @@ public: MWindow *mwindow; }; +class BatchRenderUseFarm : public BC_CheckBox +{ +public: + BatchRenderUseFarm(BatchRenderThread *thread, int x, int y, int *output); + int handle_event(); + void update(int *output); + + BatchRenderThread *thread; + int *output; +}; + class BatchRenderGUI : public BC_Window { @@ -296,7 +310,9 @@ public: void button_enable(); void button_disable(); - ArrayList list_columns[BATCHRENDER_COLUMNS]; + ArrayList list_items[BATCHRENDER_COLUMNS]; + const char *list_titles[BATCHRENDER_COLUMNS]; + int list_width[BATCHRENDER_COLUMNS], list_columns; MWindow *mwindow; BatchRenderThread *thread; @@ -321,6 +337,7 @@ public: BatchRenderCancel *cancel_button; BatchRenderCurrentEDL *use_current_edl; BatchRenderUpdateEDL *update_selected_edl; + BatchRenderUseFarm *use_renderfarm; }; diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index 57f40ea9..f791ed66 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -286,7 +286,7 @@ int CreateBD_Thread::create_bd_jobs(ArrayList *jobs, const char return 1; } - BatchRenderJob *job = new BatchRenderJob(mwindow->preferences); + BatchRenderJob *job = new BatchRenderJob(mwindow->preferences, use_label_chapters); jobs->append(job); strcpy(&job->edl_path[0], xml_filename); Asset *asset = job->asset; @@ -330,7 +330,7 @@ int CreateBD_Thread::create_bd_jobs(ArrayList *jobs, const char asset->ff_video_bitrate = vid_bitrate; asset->ff_video_quality = -1; - job = new BatchRenderJob(mwindow->preferences); + job = new BatchRenderJob(mwindow->preferences, 0, 0); jobs->append(job); job->edl_path[0] = '@'; strcpy(&job->edl_path[1], script_filename); diff --git a/cinelerra-5.1/cinelerra/dcraw.C b/cinelerra-5.1/cinelerra/dcraw.C index 188ae319..5a6f5421 100644 --- a/cinelerra-5.1/cinelerra/dcraw.C +++ b/cinelerra-5.1/cinelerra/dcraw.C @@ -9898,7 +9898,7 @@ int CLASS main (int argc, const char **argv) reset(); // Globals must be reset #ifndef LOCALTIME - putenv ((char *) "TZ=UTC"); +// putenv ((char *) "TZ=UTC"); #endif #ifdef LOCALEDIR setlocale (LC_CTYPE, ""); diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C index cb8214a9..46990386 100644 --- a/cinelerra-5.1/cinelerra/dvdcreate.C +++ b/cinelerra-5.1/cinelerra/dvdcreate.C @@ -184,11 +184,15 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList *jobs, const ch fprintf(fp,"\n"); const char *exec_path = File::get_cinlib_path(); fprintf(fp,"PATH=$PATH:%s\n",exec_path); - if( mwindow->preferences->use_renderfarm ) - fprintf(fp,"cat > $1/dvd.m2v $1/dvd.m2v0*\n"); - if( !use_ffmpeg ) { - fprintf(fp,"mplex -M -f 8 -o $1/dvd.mpg $1/dvd.m2v $1/dvd.ac3\n"); - fprintf(fp,"\n"); + if( mwindow->preferences->use_renderfarm || + (use_label_chapters && edl->labels ) ) { + if( !use_ffmpeg ) { + fprintf(fp, "cat > $1/dvd.m2v $1/dvd.m2v0*\n"); + fprintf(fp, "mplex -M -f 8 -o $1/dvd.mpg $1/dvd.m2v $1/dvd.ac3\n"); + } + else + fprintf(fp, "ffmpeg -f concat -safe 0 -i <(for f in \"$1/dvd.mpg0\"*; do " + "echo \"file '$f'\"; done) -c copy -y $1/dvd.mpg\n"); } fprintf(fp,"rm -rf $1/iso\n"); fprintf(fp,"mkdir -p $1/iso\n"); @@ -289,7 +293,7 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList *jobs, const ch return 1; } - BatchRenderJob *job = new BatchRenderJob(mwindow->preferences); + BatchRenderJob *job = new BatchRenderJob(mwindow->preferences, use_label_chapters); jobs->append(job); strcpy(&job->edl_path[0], xml_filename); Asset *asset = job->asset; @@ -337,7 +341,7 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList *jobs, const ch asset->vmpeg_preset = 8; asset->vmpeg_field_order = 0; asset->vmpeg_pframe_distance = 0; - job = new BatchRenderJob(mwindow->preferences, SINGLE_PASS); + job = new BatchRenderJob(mwindow->preferences, 0, 0); jobs->append(job); strcpy(&job->edl_path[0], xml_filename); asset = job->asset; @@ -355,7 +359,7 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList *jobs, const ch asset->ac3_bitrate = dvd_kaudio_rate; } - job = new BatchRenderJob(mwindow->preferences); + job = new BatchRenderJob(mwindow->preferences, 0, 0); jobs->append(job); job->edl_path[0] = '@'; strcpy(&job->edl_path[1], script_filename); diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index 3d51c70f..75131dca 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -1913,6 +1913,19 @@ int FFMPEG::open_encoder(const char *type, const char *spec) sprintf(arg, "%d", asset->ff_audio_bitrate); av_dict_set(&sopts, "b", arg, 0); } + else if( asset->ff_audio_quality >= 0 ) { + ctx->global_quality = asset->ff_audio_quality * FF_QP2LAMBDA; + ctx->qmin = ctx->qmax = asset->ff_audio_quality; + ctx->mb_lmin = ctx->qmin * FF_QP2LAMBDA; + ctx->mb_lmax = ctx->qmax * FF_QP2LAMBDA; + ctx->flags |= CODEC_FLAG_QSCALE; + char arg[BCSTRLEN]; + av_dict_set(&sopts, "flags", "+qscale", 0); + sprintf(arg, "%d", asset->ff_audio_quality); + av_dict_set(&sopts, "qscale", arg, 0); + sprintf(arg, "%d", ctx->global_quality); + av_dict_set(&sopts, "global_quality", arg, 0); + } int aidx = ffaudio.size(); int fidx = aidx + ffvideo.size(); FFAudioStream *aud = new FFAudioStream(this, st, aidx, fidx); diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C index 76cb743f..bc1a6290 100644 --- a/cinelerra-5.1/cinelerra/file.C +++ b/cinelerra-5.1/cinelerra/file.C @@ -1578,42 +1578,26 @@ void File::getenv_path(char *result, const char *path) *rp = 0; } -void File::setenv_path(char *result, const char *var, const char *path) +void File::setenv_path(const char *var, const char *path, int overwrite) { - char *env = getenv(var); - if( env ) return; char env_path[BCTEXTLEN]; getenv_path(env_path, path); - sprintf(result, "%s=%s", var, env_path); - putenv(result); + setenv(var, env_path, overwrite); } -char File::cinexe_path[BCTEXTLEN]; -char File::cinpkg_path[BCTEXTLEN]; -char File::cindat_path[BCTEXTLEN]; -char File::cinlib_path[BCTEXTLEN]; -char File::cincfg_path[BCTEXTLEN]; -char File::cinplg_path[BCTEXTLEN]; -char File::cinlad_path[BCTEXTLEN]; -char File::cinlcl_path[BCTEXTLEN]; -char File::cinbwr_path[BCTEXTLEN]; - void File::init_cin_path() { char env_path[BCTEXTLEN], env_pkg[BCTEXTLEN]; // these values are advertised for forks/shell scripts get_exe_path(env_path, env_pkg); - snprintf(cinexe_path, sizeof(cinexe_path), "CIN_PATH=%s", env_path); - putenv(cinexe_path); - snprintf(cinpkg_path, sizeof(cinpkg_path), "CIN_PKG=%s", env_pkg); - putenv(cinpkg_path); - - setenv_path(cindat_path, "CIN_DAT", CINDAT_DIR); - setenv_path(cinlib_path, "CIN_LIB", CINLIB_DIR); - setenv_path(cincfg_path, "CIN_CONFIG", CONFIG_DIR); - setenv_path(cinplg_path, "CIN_PLUGIN", PLUGIN_DIR); - setenv_path(cinlad_path, "CIN_LADSPA", LADSPA_DIR); - setenv_path(cinlcl_path, "CIN_LOCALE", LOCALE_DIR); - setenv_path(cinbwr_path, "CIN_BROWSER", CIN_BROWSER); + setenv_path("CIN_PATH", env_path, 1); + setenv_path("CIN_PKG", env_pkg, 1); + setenv_path("CIN_DAT", CINDAT_DIR, 0); + setenv_path("CIN_LIB", CINLIB_DIR, 0); + setenv_path("CIN_CONFIG", CONFIG_DIR, 0); + setenv_path("CIN_PLUGIN", PLUGIN_DIR, 0); + setenv_path("CIN_LADSPA", LADSPA_DIR, 0); + setenv_path("CIN_LOCALE", LOCALE_DIR, 0); + setenv_path("CIN_BROWSER", CIN_BROWSER, 0); } diff --git a/cinelerra-5.1/cinelerra/file.h b/cinelerra-5.1/cinelerra/file.h index 779b3d1e..bb1a80ef 100644 --- a/cinelerra-5.1/cinelerra/file.h +++ b/cinelerra-5.1/cinelerra/file.h @@ -317,12 +317,7 @@ public: static void init_cin_path(); static void get_exe_path(char *result, char *bnp=0); static void getenv_path(char *result, const char *path); - static void setenv_path(char *result, const char *var, const char *path); - static char cinexe_path[BCTEXTLEN], cinpkg_path[BCTEXTLEN]; - static char cindat_path[BCTEXTLEN], cinlib_path[BCTEXTLEN]; - static char cincfg_path[BCTEXTLEN], cinplg_path[BCTEXTLEN]; - static char cinlad_path[BCTEXTLEN], cinlcl_path[BCTEXTLEN]; - static char cinbwr_path[BCTEXTLEN]; + static void setenv_path(const char *var, const char *path, int overwrite); static const char *get_cin() { return getenv("CIN_PKG"); } static const char *get_cin_path() { return getenv("CIN_PATH"); } static const char *get_cindat_path() { return getenv("CIN_DAT"); } @@ -331,6 +326,7 @@ public: static const char *get_plugin_path() { return getenv("CIN_PLUGIN"); } static const char *get_ladspa_path() { return getenv("CIN_LADSPA"); } static const char *get_locale_path() { return getenv("CIN_LOCALE"); } + static const char *get_render_path() { return getenv("CIN_RENDER"); } static const char *get_browser_path() { return getenv("CIN_BROWSER"); } static const char *default_probes[]; diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C index 1faa7567..cc8a5371 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.C +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C @@ -87,6 +87,22 @@ FFMpegAudioNum::FFMpegAudioNum(BC_Window *window, int FFMpegAudioBitrate::handle_event() { int ret = FFMpegAudioNum::handle_event(); + Asset *asset = window()->asset; + if( asset->ff_audio_bitrate > 0 ) + window()->quality->disable(); + else if( !window()->quality->get_textbox()->is_hidden() ) + window()->quality->enable(); + return ret; +} + +int FFMpegAudioQuality::handle_event() +{ + int ret = FFMpegAudioNum::handle_event(); + Asset *asset = window()->asset; + if( asset->ff_audio_quality >= 0 ) + window()->bitrate->disable(); + else if( !window()->bitrate->get_textbox()->is_hidden() ) + window()->bitrate->enable(); return ret; } @@ -462,8 +478,13 @@ void FFMPEGConfigAudio::create_objects() bitrate->create_objects(); bitrate->set_increment(1000); bitrate->set_boundaries((int64_t)0, (int64_t)INT_MAX); + y += bitrate->get_h() + 5; + quality = new FFMpegAudioQuality(this, x, y, _("Quality:"), &asset->ff_audio_quality); + quality->create_objects(); + quality->set_increment(1); + quality->set_boundaries((int64_t)-1, (int64_t)51); - y += bitrate->get_h() + 10; + y += quality->get_h() + 10; BC_Title *title = new BC_Title(x, y, _("Audio Options:")); add_subwindow(title); @@ -486,6 +507,10 @@ void FFMPEGConfigAudio::create_objects() show_window(1); bitrate->update_param("cin_bitrate", asset->ff_audio_options); + quality->update_param("cin_quality", asset->ff_audio_options); + + if( asset->ff_audio_bitrate > 0 ) quality->disable(); + else if( asset->ff_audio_quality >= 0 ) bitrate->disable(); unlock_window(); } @@ -523,6 +548,7 @@ int FFMPEGConfigAudioPopup::handle_event() popup->audio_options->set_text_row(0); popup->bitrate->update_param("cin_bitrate", asset->ff_audio_options); + popup->quality->update_param("cin_quality", asset->ff_audio_options); return 1; } diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.h b/cinelerra-5.1/cinelerra/fileffmpeg.h index f6328f38..d3e22dd3 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.h +++ b/cinelerra-5.1/cinelerra/fileffmpeg.h @@ -93,6 +93,14 @@ public: int handle_event(); }; +class FFMpegAudioQuality : public FFMpegAudioNum +{ +public: + FFMpegAudioQuality(BC_Window *window, int x, int y, char *title_text, int *output) + : FFMpegAudioNum(window, x, y, title_text, output) {} + int handle_event(); +}; + class FFMpegVideoNum : public FFMpegConfigNum { public: @@ -130,6 +138,7 @@ public: ArrayList presets; FFMPEGConfigAudioPopup *preset_popup; FFMpegAudioBitrate *bitrate; + FFMpegAudioQuality *quality; FFAudioOptions *audio_options; BC_WindowBase *parent_window; Asset *asset; diff --git a/cinelerra-5.1/cinelerra/fileogg.C b/cinelerra-5.1/cinelerra/fileogg.C index a7612a4f..a0fc9b18 100644 --- a/cinelerra-5.1/cinelerra/fileogg.C +++ b/cinelerra-5.1/cinelerra/fileogg.C @@ -2323,7 +2323,7 @@ PackagingEngineOGG::~PackagingEngineOGG() delete [] packages; } if (default_asset) - delete default_asset; + default_asset->remove_user(); } @@ -2490,6 +2490,7 @@ int PackagingEngineOGG::packages_are_done() if (default_asset->audio_data) { audio_asset = new Asset(packages[local_current_package]->path); + audio_asset->format = FILE_OGG; local_current_package++; audio_file_gen = new File(); @@ -2502,6 +2503,7 @@ int PackagingEngineOGG::packages_are_done() if (default_asset->video_data) { video_asset = new Asset(packages[local_current_package]->path); + video_asset->format = FILE_OGG; local_current_package++; video_file_gen = new File(); @@ -2541,8 +2543,9 @@ int PackagingEngineOGG::packages_are_done() ogg_stream_clear(&video_in_stream); video_file_gen->close_file(); delete video_file_gen; - delete video_asset; + if( video_asset ) video_asset->remove_user(); video_asset = new Asset(packages[local_current_package]->path); + video_asset->format = FILE_OGG; local_current_package++; video_file_gen = new File(); @@ -2623,22 +2626,24 @@ int PackagingEngineOGG::packages_are_done() ogg_stream_clear(&audio_in_stream); audio_file_gen->close_file(); delete audio_file_gen; - delete audio_asset; + if( audio_asset ) + audio_asset->remove_user(); } if (default_asset->video_data) { ogg_stream_clear(&video_in_stream); video_file_gen->close_file(); delete video_file_gen; - delete video_asset; + if( video_asset ) + video_asset->remove_user(); } output_file_gen->close_file(); delete output_file_gen; -// Now delete the temp files - for(int i = 0; i < total_packages; i++) - unlink(packages[i]->path); +// don't delete the temp files, for now +// for(int i = 0; i < total_packages; i++) +// unlink(packages[i]->path); return 0; } diff --git a/cinelerra-5.1/cinelerra/formattools.C b/cinelerra-5.1/cinelerra/formattools.C index 71116721..74c4cf09 100644 --- a/cinelerra-5.1/cinelerra/formattools.C +++ b/cinelerra-5.1/cinelerra/formattools.C @@ -52,7 +52,6 @@ FormatTools::FormatTools(MWindow *mwindow, vparams_button = 0; aparams_thread = 0; vparams_thread = 0; - channels_tumbler = 0; audio_switch = 0; video_switch = 0; path_textbox = 0; @@ -63,9 +62,7 @@ FormatTools::FormatTools(MWindow *mwindow, format_text = 0; audio_title = 0; video_title = 0; - channels_title = 0; - channels_button = 0; - multiple_files = 0; + labeled_files = 0; w = window->get_w(); recording = 0; @@ -100,7 +97,6 @@ SET_TRACE SET_TRACE if(vparams_thread) delete vparams_thread; SET_TRACE - if(channels_tumbler) delete channels_tumbler; } void FormatTools::create_objects( @@ -187,18 +183,6 @@ void FormatTools::create_objects( ylev = y; y += aparams_button->get_h() + 10; -// Audio channels only used for recording. -// if(prompt_audio_channels) -// { -// window->add_subwindow(channels_title = new BC_Title(x, y, _("Number of audio channels to record:"))); -// x += 260; -// window->add_subwindow(channels_button = new FormatChannels(x, y, this)); -// x += channels_button->get_w() + 5; -// window->add_subwindow(channels_tumbler = new BC_ITumbler(channels_button, 1, MAXCHANNELS, x, y)); -// y += channels_button->get_h() + 20; -// x = init_x; -// } - //printf("FormatTools::create_objects 6\n"); aparams_thread = new FormatAThread(this); } @@ -237,9 +221,9 @@ void FormatTools::create_objects( x = init_x; if( file_per_label ) { - multiple_files = new FormatMultiple(mwindow, x, y, file_per_label); - window->add_subwindow(multiple_files); - y += multiple_files->get_h() + 10; + labeled_files = new FormatFilePerLabel(this, x, y, file_per_label); + window->add_subwindow(labeled_files); + y += labeled_files->get_h() + 10; } //printf("FormatTools::create_objects 12\n"); @@ -422,7 +406,7 @@ void FormatTools::update(Asset *asset, int *file_per_label) { this->asset = asset; this->file_per_label = file_per_label; - if( file_per_label ) multiple_files->update(file_per_label); + if( file_per_label ) labeled_files->update(file_per_label); if( path_textbox ) path_textbox->update(asset->path); format_text->update(File::formattostr(asset->format)); update_format(); @@ -490,16 +474,6 @@ void FormatTools::reposition_window(int &init_x, int &init_y) x = init_x; y += aparams_button->get_h() + 10; - if(prompt_audio_channels) - { - channels_title->reposition_window(x, y); - x += 260; - channels_button->reposition_window(x, y); - x += channels_button->get_w() + 5; - channels_tumbler->reposition_window(x, y); - y += channels_button->get_h() + 20; - x = init_x; - } } @@ -528,8 +502,8 @@ void FormatTools::reposition_window(int &init_x, int &init_y) } if( file_per_label ) { - multiple_files->reposition_window(x, y); - y += multiple_files->get_h() + 10; + labeled_files->reposition_window(x, y); + y += labeled_files->get_h() + 10; } init_y = y; @@ -591,6 +565,7 @@ FormatAParams::~FormatAParams() int FormatAParams::handle_event() { format->set_audio_options(); + format->handle_event(); return 1; } @@ -612,6 +587,7 @@ FormatVParams::~FormatVParams() int FormatVParams::handle_event() { format->set_video_options(); + format->handle_event(); return 1; } @@ -714,6 +690,7 @@ FormatAudio::~FormatAudio() {} int FormatAudio::handle_event() { format->asset->audio_data = get_value(); + format->handle_event(); return 1; } @@ -731,6 +708,7 @@ FormatVideo::~FormatVideo() {} int FormatVideo::handle_event() { format->asset->video_data = get_value(); + format->handle_event(); return 1; } @@ -768,6 +746,7 @@ int FormatFormat::handle_event() load_items(File::formattostr(format->asset->format)); format->update_format(); } + format->handle_event(); } return 1; } @@ -795,65 +774,32 @@ int FormatFFMPEG::handle_event() format->update_extension(); format->close_format_windows(); format->update_format(); + format->handle_event(); } return 1; } - - -FormatChannels::FormatChannels(int x, int y, FormatTools *format) - : BC_TextBox(x, y, 100, 1, format->asset->channels) -{ - this->format = format; -} - -FormatChannels::~FormatChannels() -{ -} - -int FormatChannels::handle_event() -{ - format->asset->channels = atol(get_text()); - return 1; -} - - -FormatToTracks::FormatToTracks(int x, int y, int *output) - : BC_CheckBox(x, y, *output, _("Overwrite project with output")) -{ - this->output = output; -} - -FormatToTracks::~FormatToTracks() -{ -} - -int FormatToTracks::handle_event() -{ - *output = get_value(); - return 1; -} - - -FormatMultiple::FormatMultiple(MWindow *mwindow, int x, int y, int *output) +FormatFilePerLabel::FormatFilePerLabel(FormatTools *format, + int x, int y, int *output) : BC_CheckBox(x, y, *output, _("Create new file at each label")) { + this->format = format; this->output = output; - this->mwindow = mwindow; } -FormatMultiple::~FormatMultiple() +FormatFilePerLabel::~FormatFilePerLabel() { } -int FormatMultiple::handle_event() +int FormatFilePerLabel::handle_event() { *output = get_value(); + format->handle_event(); return 1; } -void FormatMultiple::update(int *output) +void FormatFilePerLabel::update(int *output) { this->output = output; set_value(*output ? 1 : 0); diff --git a/cinelerra-5.1/cinelerra/formattools.h b/cinelerra-5.1/cinelerra/formattools.h index 9f49c04f..e0946a1f 100644 --- a/cinelerra-5.1/cinelerra/formattools.h +++ b/cinelerra-5.1/cinelerra/formattools.h @@ -30,22 +30,9 @@ #include "file.inc" #include "ffmpeg.h" #include "formatpopup.h" +#include "formattools.inc" #include "mwindow.inc" -class FormatAParams; -class FormatVParams; -class FormatAThread; -class FormatVThread; -class FormatChannels; -class FormatPathButton; -class FormatPathText; -class FormatFormat; -class FormatFFMPEG; -class FFMpegType; -class FormatAudio; -class FormatVideo; -class FormatMultiple; - class FormatTools { public: @@ -104,17 +91,14 @@ public: BC_TextBox *format_text; FormatFFMPEG *format_ffmpeg; FFMpegType *ffmpeg_type; - BC_ITumbler *channels_tumbler; BC_Title *audio_title; - BC_Title *channels_title; - FormatChannels *channels_button; FormatAudio *audio_switch; BC_Title *video_title; FormatVideo *video_switch; - FormatMultiple *multiple_files; + FormatFilePerLabel *labeled_files; ArrayList *plugindb; MWindow *mwindow; @@ -254,33 +238,16 @@ public: }; -class FormatChannels : public BC_TextBox -{ -public: - FormatChannels(int x, int y, FormatTools *format); - ~FormatChannels(); - int handle_event(); - FormatTools *format; -}; - -class FormatToTracks : public BC_CheckBox -{ -public: - FormatToTracks(int x, int y, int *output); - ~FormatToTracks(); - int handle_event(); - int *output; -}; - -class FormatMultiple : public BC_CheckBox +class FormatFilePerLabel : public BC_CheckBox { public: - FormatMultiple(MWindow *mwindow, int x, int y, int *output); - ~FormatMultiple(); + FormatFilePerLabel(FormatTools *format, int x, int y, int *output); + ~FormatFilePerLabel(); int handle_event(); void update(int *output); + + FormatTools *format; int *output; - MWindow *mwindow; }; diff --git a/cinelerra-5.1/cinelerra/formattools.inc b/cinelerra-5.1/cinelerra/formattools.inc index 5654e2fe..1239c063 100644 --- a/cinelerra-5.1/cinelerra/formattools.inc +++ b/cinelerra-5.1/cinelerra/formattools.inc @@ -23,5 +23,16 @@ #define FORMATTOOLS_INC class FormatTools; +class FormatPathText; +class FormatFormat; +class FormatFFMPEG; +class FFMpegType; +class FormatAParams; +class FormatVParams; +class FormatAThread; +class FormatVThread; +class FormatAudio; +class FormatVideo; +class FormatFilePerLabel; #endif diff --git a/cinelerra-5.1/cinelerra/menueffects.C b/cinelerra-5.1/cinelerra/menueffects.C index 34881cf4..9b98c31f 100644 --- a/cinelerra-5.1/cinelerra/menueffects.C +++ b/cinelerra-5.1/cinelerra/menueffects.C @@ -169,7 +169,7 @@ void MenuEffectThread::run() get_derived_attributes(default_asset, defaults); // to_tracks = defaults->get("RENDER_EFFECT_TO_TRACKS", 1); load_mode = defaults->get("RENDER_EFFECT_LOADMODE", LOADMODE_PASTE); - file_per_label = defaults->get("RENDER_FILE_PER_LABEL", 0); + use_labels = defaults->get("RENDER_FILE_PER_LABEL", 0); // get plugin information int need_plugin = !strlen(title) ? 1 : 0; @@ -207,7 +207,7 @@ void MenuEffectThread::run() // save defaults save_derived_attributes(default_asset, defaults); defaults->update("RENDER_EFFECT_LOADMODE", load_mode); - defaults->update("RENDER_EFFECT_FILE_PER_LABEL", file_per_label); + defaults->update("RENDER_EFFECT_FILE_PER_LABEL", use_labels); mwindow->save_defaults(); // get plugin server to use and delete the plugin list @@ -360,7 +360,7 @@ void MenuEffectThread::run() default_asset->height = mwindow->edl->session->output_h; } - int strategy = Render::get_strategy(mwindow->preferences->use_renderfarm, file_per_label); + int strategy = Render::get_strategy(mwindow->preferences->use_renderfarm, use_labels); // Process the total length in fragments ArrayList packets; if(!result) @@ -618,7 +618,7 @@ void MenuEffectWindow::create_objects() add_subwindow(file_title = new BC_Title( mwindow->theme->menueffect_file_x, mwindow->theme->menueffect_file_y, - (char*)(menueffects->file_per_label ? + (char*)(menueffects->use_labels ? _("Select the first file to render to:") : _("Select a file to render to:")))); @@ -628,7 +628,7 @@ void MenuEffectWindow::create_objects() this, asset); format_tools->create_objects(x, y, asset->audio_data, asset->video_data, - 0, 0, 0, 1, 0, 0, &menueffects->file_per_label, 0); + 0, 0, 0, 1, 0, 0, &menueffects->use_labels, 0); loadmode = new LoadMode(mwindow, this, x, y, &menueffects->load_mode, 1); loadmode->create_objects(); diff --git a/cinelerra-5.1/cinelerra/menueffects.h b/cinelerra-5.1/cinelerra/menueffects.h index 6ad0cb92..1316a04d 100644 --- a/cinelerra-5.1/cinelerra/menueffects.h +++ b/cinelerra-5.1/cinelerra/menueffects.h @@ -85,7 +85,7 @@ public: MenuEffects *menu_item; char title[BCTEXTLEN]; int realtime, load_mode; - int file_per_label; + int use_labels; // GUI Plugins to delete ArrayList *dead_plugins; diff --git a/cinelerra-5.1/cinelerra/performanceprefs.C b/cinelerra-5.1/cinelerra/performanceprefs.C index f95f1e81..7adb020b 100644 --- a/cinelerra-5.1/cinelerra/performanceprefs.C +++ b/cinelerra-5.1/cinelerra/performanceprefs.C @@ -28,6 +28,7 @@ #include "mwindow.h" #include "performanceprefs.h" #include "preferences.h" +#include #include #include "theme.h" @@ -153,7 +154,7 @@ void PerformancePrefs::create_objects() 1, 0, // Select compressors to be offered 0, // Prompt for recording options - 0, // prompt for file_per_label + 0, // prompt for use labels 1); // Supply file formats for background rendering x = xmargin1; @@ -547,7 +548,7 @@ int PrefsRenderFarmPort::handle_event() PrefsRenderFarmNodes::PrefsRenderFarmNodes(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) - : BC_ListBox(x, y, 340, 230, LISTBOX_TEXT) + : BC_ListBox(x, y, 340, 230, LISTBOX_TEXT, 0,0,0,1, 0,0, LISTBOX_MULTIPLE) { for( int i=0; ihot_node = get_selection_number(1, 0); subwindow->edit_node->update(get_selection(1, 0)->get_text()); - subwindow->edit_port->update(get_selection(2, 0)->get_text()); + const char *text = get_selection(2, 0)->get_text(); + subwindow->edit_port->update(text); + pwindow->thread->preferences->renderfarm_port = atol(text); if(get_cursor_x() < widths[0]) { pwindow->thread->preferences->renderfarm_enabled.values[subwindow->hot_node] = @@ -627,7 +630,7 @@ int PrefsRenderFarmEditNode::handle_event() PrefsRenderFarmNewNode::PrefsRenderFarmNewNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) - : BC_GenericButton(x, y, _("Add Node")) + : BC_GenericButton(x, y, _("Add Nodes")) { this->pwindow = pwindow; this->subwindow = subwindow; @@ -637,10 +640,17 @@ PrefsRenderFarmNewNode::~PrefsRenderFarmNewNode() } int PrefsRenderFarmNewNode::handle_event() { - pwindow->thread->preferences->add_node(subwindow->edit_node->get_text(), - pwindow->thread->preferences->renderfarm_port, - 1, - 0.0); + const char *name = subwindow->edit_node->get_text(); + char *cp = (char*)subwindow->edit_port->get_text(); + int64_t start_port = strtol(cp, &cp, 0), end_port = start_port; + while( isspace(*cp) ) ++cp; + if( *cp++ == '-' ) + end_port = strtol(cp, &cp, 0); + for( int port=start_port; port<=end_port; ++port ) { + pwindow->thread->preferences->add_node(name, port, 1, 0.0); + } + pwindow->thread->preferences->renderfarm_port = end_port; + subwindow->edit_port->update(end_port); pwindow->thread->preferences->reset_rates(); subwindow->generate_node_list(); subwindow->update_node_list(); @@ -682,7 +692,7 @@ int PrefsRenderFarmReplaceNode::handle_event() PrefsRenderFarmDelNode::PrefsRenderFarmDelNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) - : BC_GenericButton(x, y, _("Delete Node")) + : BC_GenericButton(x, y, _("Delete Nodes")) { this->pwindow = pwindow; this->subwindow = subwindow; @@ -692,13 +702,14 @@ PrefsRenderFarmDelNode::~PrefsRenderFarmDelNode() } int PrefsRenderFarmDelNode::handle_event() { - if( subwindow->hot_node >= 0 ) { - pwindow->thread->preferences->delete_node(subwindow->hot_node); - - subwindow->generate_node_list(); - subwindow->update_node_list(); - subwindow->hot_node = -1; + ArrayList &item_list = subwindow->nodes[0]; + for( int i=item_list.size(); --i>=0; ) { + if( !item_list[i]->get_selected() ) continue; + pwindow->thread->preferences->delete_node(i); } + subwindow->generate_node_list(); + subwindow->update_node_list(); + subwindow->hot_node = -1; return 1; } diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index 029feba5..6f6de774 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -420,6 +420,7 @@ int Preferences::load_defaults(BC_Hash *defaults) shbtn_prefs.append(new ShBtnPref(_("Original Manual"), "$CIN_BROWSER file://$CIN_DAT/doc/cinelerra.html", 0)); shbtn_prefs.append(new ShBtnPref(_("Setting Shell Commands"), "$CIN_BROWSER file://$CIN_DAT/doc/ShellCmds.html", 0)); shbtn_prefs.append(new ShBtnPref(_("Shortcuts"), "$CIN_BROWSER file://$CIN_DAT/doc/shortcuts.html", 0)); + shbtn_prefs.append(new ShBtnPref(_("RenderMux"), "$CIN_DAT/doc/RenderMux.sh",0)); shbtns_total = 0; } for( int i=0; ireset_android_remote(); - int ffmpeg_early_probe = mwindow->preferences->get_file_probe_armed("FFPMEG_Early"); + int ffmpeg_early_probe = mwindow->preferences->get_file_probe_armed("FFMPEG_Early"); mwindow->gui->ffmpeg_toggle->update(ffmpeg_early_probe); mwindow->gui->ffmpeg_toggle->set_tooltip(ffmpeg_early_probe ? FFMPEG_EARLY_TIP : FFMPEG_LATE_TIP); diff --git a/cinelerra-5.1/cinelerra/recordprefs.C b/cinelerra-5.1/cinelerra/recordprefs.C index 8001973b..5a023a22 100644 --- a/cinelerra-5.1/cinelerra/recordprefs.C +++ b/cinelerra-5.1/cinelerra/recordprefs.C @@ -82,7 +82,7 @@ void RecordPrefs::create_objects() 1, 0, // Select compressors to be offered 1, // Prompt for recording options - 0, // prompt for file_per_label + 0, // prompt for use labels 0); // Supply file formats for background rendering realtime_toc = new RecordRealtimeTOC(mwindow, pwindow, diff --git a/cinelerra-5.1/cinelerra/render.C b/cinelerra-5.1/cinelerra/render.C index 4363cd9e..17fd1f89 100644 --- a/cinelerra-5.1/cinelerra/render.C +++ b/cinelerra-5.1/cinelerra/render.C @@ -345,6 +345,7 @@ void Render::handle_done_event(int result) // add to recentlist only on OK render_window->render_format->path_recent-> add_item(File::formattostr(asset->format), asset->path); + setenv("CIN_RENDER", asset->path, 1); } render_window = 0; } @@ -471,15 +472,15 @@ int Render::check_asset(EDL *edl, Asset &asset) return 0; } -int Render::get_strategy(int use_renderfarm, int file_per_label) +int Render::get_strategy(int use_renderfarm, int use_labels) { return use_renderfarm ? - (file_per_label ? FILE_PER_LABEL_FARM : SINGLE_PASS_FARM) : - (file_per_label ? FILE_PER_LABEL : SINGLE_PASS ) ; + (use_labels ? FILE_PER_LABEL_FARM : SINGLE_PASS_FARM) : + (use_labels ? FILE_PER_LABEL : SINGLE_PASS ) ; } int Render::get_strategy() { - return get_strategy(preferences->use_renderfarm, file_per_label); + return get_strategy(preferences->use_renderfarm, use_labels); } void Render::start_progress() @@ -616,7 +617,7 @@ void Render::get_starting_number(char *path, int Render::load_defaults(Asset *asset) { - file_per_label = mwindow->defaults->get("RENDER_FILE_PER_LABEL", 0); + use_labels = mwindow->defaults->get("RENDER_FILE_PER_LABEL", 0); load_mode = mwindow->defaults->get("RENDER_LOADMODE", LOADMODE_NEW_TRACKS); range_type = mwindow->defaults->get("RENDER_RANGE_TYPE", RANGE_PROJECT); @@ -636,7 +637,7 @@ int Render::load_profile(int profile_slot, Asset *asset) { char string_name[100]; sprintf(string_name, "RENDER_%i_FILE_PER_LABEL", profile_slot); - file_per_label = mwindow->defaults->get(string_name, 0); + use_labels = mwindow->defaults->get(string_name, 0); // Load mode is not part of the profile // printf(string_name, "RENDER_%i_LOADMODE", profile_slot); // load_mode = mwindow->defaults->get(string_name, LOADMODE_NEW_TRACKS); @@ -652,7 +653,7 @@ int Render::load_profile(int profile_slot, Asset *asset) int Render::save_defaults(Asset *asset) { - mwindow->defaults->update("RENDER_FILE_PER_LABEL", file_per_label); + mwindow->defaults->update("RENDER_FILE_PER_LABEL", use_labels); mwindow->defaults->update("RENDER_LOADMODE", load_mode); mwindow->defaults->update("RENDER_RANGE_TYPE", range_type); @@ -689,7 +690,6 @@ void RenderThread::render_single(int test_overwrite, Asset *asset, EDL *edl, double total_length; RenderFarmServer *farm_server = 0; FileSystem fs; - //int done = 0; const int debug = 0; render->in_progress = 1; @@ -771,7 +771,6 @@ void RenderThread::render_single(int test_overwrite, Asset *asset, EDL *edl, test_overwrite); } - //done = 0; render->total_rendered = 0; if(!render->result) @@ -863,15 +862,9 @@ void RenderThread::render_single(int test_overwrite, Asset *asset, EDL *edl, // Exit point if(!package) { - //done = 1; break; } - - - Timer timer; - timer.update(); - if(package_renderer.render_package(package)) render->result = 1; @@ -1134,7 +1127,7 @@ void RenderWindow::load_profile(int profile_slot) { render->load_profile(profile_slot, asset); update_range_type(render->range_type); - render_format->update(asset, &render->file_per_label); + render_format->update(asset, &render->use_labels); } @@ -1143,14 +1136,14 @@ void RenderWindow::create_objects() int x = 10, y = 10; lock_window("RenderWindow::create_objects"); add_subwindow(new BC_Title(x, y, - (char*)(render->file_per_label ? + (char*)(render->use_labels ? _("Select the first file to render to:") : _("Select a file to render to:")))); y += 25; render_format = new RenderFormat(mwindow, this, asset); render_format->create_objects(x, y, - 1, 1, 1, 1, 0, 1, 0, 0, &render->file_per_label, 0); + 1, 1, 1, 1, 0, 1, 0, 0, &render->use_labels, 0); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Render range:"))); diff --git a/cinelerra-5.1/cinelerra/render.h b/cinelerra-5.1/cinelerra/render.h index 1e025abc..3b172983 100644 --- a/cinelerra-5.1/cinelerra/render.h +++ b/cinelerra-5.1/cinelerra/render.h @@ -129,7 +129,7 @@ public: // This should be integrated into the Asset Class. static int check_asset(EDL *edl, Asset &asset); // strategy to conform with using renderfarm. - static int get_strategy(int use_renderfarm, int file_per_label); + static int get_strategy(int use_renderfarm, int use_labels); int get_strategy(); // Force filename to have a 0 padded number if rendering to a list. int check_numbering(Asset &asset); @@ -178,7 +178,7 @@ public: PlayableTracks *playable_tracks; PackageDispatcher *packages; Mutex *package_lock, *counter_lock; - int file_per_label; + int use_labels; int range_type; // Total selection to render in seconds double total_start, total_end; diff --git a/cinelerra-5.1/cinelerra/renderprofiles.C b/cinelerra-5.1/cinelerra/renderprofiles.C index 3e7eeb1b..471c7ccd 100644 --- a/cinelerra-5.1/cinelerra/renderprofiles.C +++ b/cinelerra-5.1/cinelerra/renderprofiles.C @@ -220,7 +220,7 @@ int RenderProfile::save_to_slot(int profile_slot, const char *profile_name) sprintf(string_name, "RENDER_%i_FILE_PER_LABEL", profile_slot); mwindow->defaults->update(string_name, - rwindow->render->file_per_label ? FILE_PER_LABEL : SINGLE_PASS); + rwindow->render->use_labels ? FILE_PER_LABEL : SINGLE_PASS); sprintf(string_name, "RENDER_%i_LOADMODE", profile_slot); mwindow->defaults->update(string_name, rwindow->render->load_mode); sprintf(string_name, "RENDER_%i_RANGE_TYPE", profile_slot); @@ -228,12 +228,7 @@ int RenderProfile::save_to_slot(int profile_slot, const char *profile_name) sprintf(string_name, "RENDER_%i_", profile_slot); rwindow->asset->save_defaults(mwindow->defaults, - string_name, - 1, - 1, - 1, - 1, - 1); + string_name, 1, 1, 1, 1, 1); mwindow->save_defaults(); return 0; diff --git a/cinelerra-5.1/cinelerra/shbtnprefs.C b/cinelerra-5.1/cinelerra/shbtnprefs.C index b4ee516a..cad3a6a2 100644 --- a/cinelerra-5.1/cinelerra/shbtnprefs.C +++ b/cinelerra-5.1/cinelerra/shbtnprefs.C @@ -212,7 +212,7 @@ void ShBtnTextWindow::create_objects() add_subwindow(cmd_name); cmd_text = new BC_ScrollTextBox(this, x1, y, get_w()-x1-20, 4, pref->commands); cmd_text->create_objects(); - y += cmd_text->get_h() + 8; + y += cmd_text->get_h() + 16; add_subwindow(st_err_warn = new ShBtnErrWarn(this, x1, y)); y = get_h() - ShBtnTextOK::calculate_h() - 10; add_subwindow(new ShBtnTextOK(this, x, y)); diff --git a/cinelerra-5.1/doc/Makefile b/cinelerra-5.1/doc/Makefile index 6cf33f40..508bc009 100644 --- a/cinelerra-5.1/doc/Makefile +++ b/cinelerra-5.1/doc/Makefile @@ -57,6 +57,7 @@ install: all cp -a cinelerra.html $(TARGET_DIR)/. cp -a Features5.pdf $(TARGET_DIR)/. cp -a shortcuts.html $(TARGET_DIR)/. + cp -a RenderMux.sh $(TARGET_DIR)/. clean: rm -f $(OUTPUT) $(IMAGES) diff --git a/cinelerra-5.1/doc/RenderMux.sh b/cinelerra-5.1/doc/RenderMux.sh new file mode 100755 index 00000000..9c172294 --- /dev/null +++ b/cinelerra-5.1/doc/RenderMux.sh @@ -0,0 +1,2 @@ +# Render output mux-ed into a single file +ffmpeg -f concat -safe 0 -i <(for f in "$CIN_RENDER"0*; do echo "file '$f'"; done) -c copy -y $CIN_RENDER diff --git a/cinelerra-5.1/ffmpeg/video/mp4.dfl b/cinelerra-5.1/ffmpeg/video/mp4.dfl index ca4ccd77..2a9f3437 100644 --- a/cinelerra-5.1/ffmpeg/video/mp4.dfl +++ b/cinelerra-5.1/ffmpeg/video/mp4.dfl @@ -1 +1 @@ -h265.mp4 +h264.mp4 -- 2.26.2