can you try also this patch on top of previous flac patch? in theory it should add flac compression level support in gui
чт, 15 сент. 2022 г., 15:40 Andrea paz <[email protected]>: > Applying the patch and then rendering without touching anything I get > the same result as before: twice as long and 4.7 MB in size. The > default is: compression_level=5. > > Applying the patch and then varying the render parameter > (compression_level=0): > > 0.664 sec > 13711 fps > 44.6 MB > > Good thing to have introduced the render parameters (well explained) > so that the speed/size choice is left to the user. > Thank you. >
From cb34ca6d34abbc990b052cf6b54d10b48c16bd67 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu <[email protected]> Date: Thu, 15 Sep 2022 22:11:13 +0300 Subject: [PATCH] Add flac compression level? --- cinelerra-5.1/cinelerra/asset.C | 2 ++ cinelerra-5.1/cinelerra/asset.h | 5 +++-- cinelerra-5.1/cinelerra/fileflac.C | 28 ++++++++++++++++++++++++++-- cinelerra-5.1/cinelerra/fileflac.h | 10 +++++++++- cinelerra-5.1/cinelerra/fileflac.inc | 2 +- 5 files changed, 41 insertions(+), 6 deletions(-) diff --git a/cinelerra-5.1/cinelerra/asset.C b/cinelerra-5.1/cinelerra/asset.C index c4301af0..d04b9081 100644 --- a/cinelerra-5.1/cinelerra/asset.C +++ b/cinelerra-5.1/cinelerra/asset.C @@ -132,6 +132,8 @@ int Asset::init_values() ac3_bitrate = 128; + flac_compression = 0; + png_use_alpha = 0; png_depth = 8; png_compression = 0; diff --git a/cinelerra-5.1/cinelerra/asset.h b/cinelerra-5.1/cinelerra/asset.h index bb40ed4a..c1ee17c5 100644 --- a/cinelerra-5.1/cinelerra/asset.h +++ b/cinelerra-5.1/cinelerra/asset.h @@ -224,9 +224,10 @@ public: // TIFF video compression. An enumeration from filetiff.h int tiff_cmodel; int tiff_compression; - +// AC3 bitrate int ac3_bitrate; - +// FLAC compression + int flac_compression; // Insert tag for spherical playback int mov_sphere, jpeg_sphere; diff --git a/cinelerra-5.1/cinelerra/fileflac.C b/cinelerra-5.1/cinelerra/fileflac.C index 6a07e22d..1c84a40a 100644 --- a/cinelerra-5.1/cinelerra/fileflac.C +++ b/cinelerra-5.1/cinelerra/fileflac.C @@ -213,7 +213,7 @@ int FileFLAC::open_file(int rd, int wr) FLAC__stream_encoder_set_channels(flac_encode, asset->channels); FLAC__stream_encoder_set_bits_per_sample(flac_encode, asset->bits); FLAC__stream_encoder_set_sample_rate(flac_encode, asset->sample_rate); - FLAC__stream_encoder_set_compression_level(flac_encode, 0); + FLAC__stream_encoder_set_compression_level(flac_encode, asset->flac_compression); FLAC__stream_encoder_init_file(flac_encode, asset->path, 0, 0); } @@ -344,26 +344,50 @@ FLACConfigAudio::FLACConfigAudio(BC_WindowBase *parent_window, { this->parent_window = parent_window; this->asset = asset; + compression = 0; // *** CONTEXT_HELP *** context_help_set_keyword("Single File Rendering"); } FLACConfigAudio::~FLACConfigAudio() { + delete compression; } void FLACConfigAudio::create_objects() { + BC_Title *title; + int xs5 = xS(5), ys5 = yS(5), xs100 = xS(100), ys10 = yS(10); int x = xS(10), y = yS(10); lock_window("FLACConfigAudio::create_objects"); bits_popup = new BitsPopup(this, x, y, &asset->bits, 0, 0, 0, 0, 0); bits_popup->create_objects(); - + y += bits_popup->get_h() + ys5; + add_subwindow(title = new BC_Title(x,y,_("Compression:"))); + int x1 = x + title->get_w() + xs100; + compression = new FLACCompression(this, x1, y); + compression->create_objects(); + y += compression->get_h() + ys5; add_subwindow(new BC_OKButton(this)); show_window(1); unlock_window(); } +FLACCompression::FLACCompression(FLACConfigAudio *gui, int x, int y) +: BC_TumbleTextBox(gui, (int64_t)gui->asset->flac_compression, + (int64_t)0, (int64_t)9, x, y, xS(40)) + +{ + this->gui = gui; +} + +int FLACCompression::handle_event() +{ + gui->asset->flac_compression = atol(get_text()); + return 1; +} + + int FLACConfigAudio::close_event() { set_done(0); diff --git a/cinelerra-5.1/cinelerra/fileflac.h b/cinelerra-5.1/cinelerra/fileflac.h index e85b64cf..5bb87f18 100644 --- a/cinelerra-5.1/cinelerra/fileflac.h +++ b/cinelerra-5.1/cinelerra/fileflac.h @@ -25,6 +25,7 @@ #include "bitspopup.inc" #include "edl.inc" #include "file.inc" +#include "fileflac.inc" #include "filebase.h" class FileFLAC : public FileBase @@ -84,8 +85,15 @@ public: BitsPopup *bits_popup; BC_WindowBase *parent_window; Asset *asset; + FLACCompression *compression; }; - +class FLACCompression : public BC_TumbleTextBox +{ +public: + FLACCompression(FLACConfigAudio *gui, int x, int y); + int handle_event(); + FLACConfigAudio *gui; +}; #endif diff --git a/cinelerra-5.1/cinelerra/fileflac.inc b/cinelerra-5.1/cinelerra/fileflac.inc index 44feed4a..9e5fd31e 100644 --- a/cinelerra-5.1/cinelerra/fileflac.inc +++ b/cinelerra-5.1/cinelerra/fileflac.inc @@ -23,7 +23,7 @@ #define FILEFLAC_INC class FileFLAC; - +class FLACCompression; #endif -- 2.37.3
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin

