From 31dcf588195639485c379434882b98f110063c8e Mon Sep 17 00:00:00 2001 From: Good Guy Date: Thu, 18 Jan 2024 17:06:17 -0700 Subject: [PATCH] Credit Andrew - add additional 16x9 formats for bluray creation; add additional values for DV encoded files; remove unused DV case from filedv.h header file; add comments to bld.sh for variation to configure line --- cinelerra-5.1/bld.sh | 4 ++++ cinelerra-5.1/cinelerra/bdcreate.C | 22 +++++++++++++++++----- cinelerra-5.1/cinelerra/filedv.C | 11 ++++++++--- cinelerra-5.1/cinelerra/filedv.h | 4 ---- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/cinelerra-5.1/bld.sh b/cinelerra-5.1/bld.sh index 7c8837bf..4684fbb0 100755 --- a/cinelerra-5.1/bld.sh +++ b/cinelerra-5.1/bld.sh @@ -1,4 +1,8 @@ #!/bin/bash +# IMPORTANT comments below to change the configure line +# For python version 12, add --without-lv2 +# For newer operating system versions, add --enable-libsvtav1 +# For really old versions, such as ubuntu 16, add --enable-libaom=no ( ./autogen.sh ./configure --with-single-user --with-booby make && make install ) 2>&1 | tee log diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index 2a9de685..7305d4e9 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -80,10 +80,10 @@ static struct bd_format { { "1920x1080 25i", 1920,1080, 25., 1, ILACE_MODE_TOP_FIRST }, { "1920x1080 25p*", 1920,1080, 25., 1, ILACE_MODE_FAKE_INTERLACE }, { "1920x1080 23.976p", 1920,1080, 23.976, 1, ILACE_MODE_NOTINTERLACED }, - { "1440x1080 29.97i", 1440,1080, 29.97, -1, ILACE_MODE_TOP_FIRST }, - { "1440x1080 25i", 1440,1080, 25., -1, ILACE_MODE_TOP_FIRST }, - { "1440x1080 24p", 1440,1080, 24., -1, ILACE_MODE_NOTINTERLACED }, - { "1440x1080 23.976p", 1440,1080, 23.976,-1, ILACE_MODE_NOTINTERLACED }, + { "1440x1080 29.97i", 1440,1080, 29.97, 1, ILACE_MODE_TOP_FIRST }, + { "1440x1080 25i", 1440,1080, 25., 1, ILACE_MODE_TOP_FIRST }, + { "1440x1080 24p", 1440,1080, 24., 1, ILACE_MODE_NOTINTERLACED }, + { "1440x1080 23.976p", 1440,1080, 23.976, 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 59.94p", 1280,720, 59.94, 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 50p", 1280,720, 50., 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 29.97p*", 1280,720, 29.97, 1, ILACE_MODE_NOTINTERLACED }, @@ -92,8 +92,13 @@ static struct bd_format { { "1280x720 23.976p", 1280,720, 23.976, 1, ILACE_MODE_NOTINTERLACED }, { "720x576 25i", 720,576, 25., 0, ILACE_MODE_BOTTOM_FIRST }, { "720x576 25p*", 720,576, 25., 0, ILACE_MODE_NOTINTERLACED }, + { "720x576(w) 25i", 720,576, 25., 1, ILACE_MODE_BOTTOM_FIRST }, + { "720x576(w) 25p*", 720,576, 25., 1, ILACE_MODE_NOTINTERLACED }, { "720x480 29.97i", 720,480, 29.97, 0, ILACE_MODE_BOTTOM_FIRST }, { "720x480 29.97p*", 720,480, 29.97, 0, ILACE_MODE_NOTINTERLACED }, + { "720x480(w) 29.97i", 720,480, 29.97, 1, ILACE_MODE_BOTTOM_FIRST }, + { "720x480(w) 29.97p*", 720,480, 29.97, 1, ILACE_MODE_NOTINTERLACED }, + }; static struct bd_profile { @@ -427,6 +432,13 @@ int CreateBD_Thread::create_bd_jobs(ArrayList *jobs, const char FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec); FFMPEG::load_options(option_path, asset->ff_video_options, sizeof(asset->ff_video_options)); + if(session->aspect_w == 16) { + char aspect_line[100]; + float par = (float)((float)asset->width / (float)asset->height); + sprintf(aspect_line, "aspect=%f\n", asset->aspect_ratio/par); + strcat(asset->ff_video_options, aspect_line); + //printf("Aspect line: %s par: %f width: %i height: %i\n ", aspect_line, par, asset->width, asset->height); + } asset->ff_video_bitrate = vid_bitrate; asset->ff_video_quality = -1; return 0; @@ -1146,7 +1158,7 @@ int CreateBD_FormatItem::handle_event() popup->set_text(text); int n = strlen(text)-1; int not_standard = n >= 0 && text[n] == '*' ? 1 : 0; - popup->gui->non_standard->update(not_standard ? _("* non-standard format") : "", 0); + popup->gui->non_standard->update(not_standard ? _(" * non-standard format") : "", 0); return popup->handle_event(); } diff --git a/cinelerra-5.1/cinelerra/filedv.C b/cinelerra-5.1/cinelerra/filedv.C index cf8bc1bf..14ddbf74 100644 --- a/cinelerra-5.1/cinelerra/filedv.C +++ b/cinelerra-5.1/cinelerra/filedv.C @@ -229,9 +229,9 @@ TRACE("FileDV::open_file 20") encoder->isPAL = isPAL; output_size = (isPAL ? DV1394_PAL_FRAME_SIZE : DV1394_NTSC_FRAME_SIZE); - // Compare to 16 / 8 rather than == 16 / 9 in case of floating point - // rounding errors - encoder->is16x9 = asset->aspect_ratio > 16 / 8; + //printf("filedv aspect- %f \n", asset->aspect_ratio); + if(1.777778 - asset->aspect_ratio < 0.001f) + encoder->is16x9 = 1; } else { @@ -602,6 +602,7 @@ UNTRACE int FileDV::write_frames(VFrame ***frames, int len) { int result = 0; + time_t now = time(NULL); if(stream == 0) return 1; @@ -619,11 +620,15 @@ int FileDV::write_frames(VFrame ***frames, int len) //printf("FileDV::write_frames: 4\n"); dv_encode_full_frame(encoder, temp_frame->get_rows(), e_dv_color_yuv, video_buffer); + dv_encode_metadata(video_buffer, encoder->isPAL, encoder->is16x9, &now, 0); + dv_encode_timecode(video_buffer, encoder->isPAL, 0); break; case BC_RGB888: //printf("FileDV::write_frames: 5\n"); dv_encode_full_frame(encoder, temp_frame->get_rows(), e_dv_color_rgb, video_buffer); + dv_encode_metadata(video_buffer, encoder->isPAL, encoder->is16x9, &now, 0); + dv_encode_timecode(video_buffer, encoder->isPAL, 0); break; default: unsigned char *data = new unsigned char[asset->height * asset->width * 2]; diff --git a/cinelerra-5.1/cinelerra/filedv.h b/cinelerra-5.1/cinelerra/filedv.h index 64e867e9..2ae140e6 100644 --- a/cinelerra-5.1/cinelerra/filedv.h +++ b/cinelerra-5.1/cinelerra/filedv.h @@ -28,10 +28,6 @@ #include "filebase.h" #include "file.inc" -#ifdef DV_USE_FFMPEG -#include -#endif - #include -- 2.26.2