Updated patches, this time I tried to import resulting edl into Final Cut
Pro for PPC Mac (mac os 9.2.2 on qemu/andoid 0.o) and they worked at least
cuts show up, and dissolves (there currently no code for handling wipes)

I am not sure if ^z^z tail actually harmless, you can comment writing this
tail in patches if unsure/want to test different NLE

yeah, I missed newline after FCM line, and last line in file..

for my surprize FCP 1.2.5 (from 1999!) uses Windows line endings (seen as
^M in mcedit) - may be they were re-using dos/windows code there?

I simply run 'unix2dos -f' on edl file from patched CinGG and then
optionally set Document/creator attribs (mac-specific, under Macos 7.5.5 in
Basilisk2 emulator, with ResEdit app) to TEXT/KeyG (four symbols for each,
case-sensitive! ) - this allowed FCP to see my edl correctly, but you can
select 'show all files' in import->edl menu under 'file' menu item..




On Monday, June 21, 2021, Andrew Randrianasulu <[email protected]>
wrote:

> I think I enabled _writing_ timecode info into rendered files (tested mxf)
> if you set timecode for your timeline manually - it should be respected.
> If you render selection of your timeline  - timecode will be set at start
> timecode of your render position.
> if you render selection with already altered (via clapping icon) timeline
> - it also should work.
>
> I found you (sometimes?) need to hit 'align timecodes' menu item for
> refreshing asset timecode info.... but such action will mes up timeline if
> some assets had no real timecode info....
>
> Anyway, try to test those patches and told us how useful (or dangerous?)
> they are...
>
> In theory I think this is good idea to get embedded timecodes into
> rendered files (rel. to your working timeline) , but may be you sometimes
> want zeroed tc in output files?
>
>
>
From 18661cc83503e52c7ea32c5654e42034f79b3f6c Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sun, 20 Jun 2021 10:37:20 +0300
Subject: [PATCH 35/43] Try to fix exportedl.c

---
 cinelerra-5.1/cinelerra/exportedl.C | 45 +++++++++++++++++++++++++----
 1 file changed, 39 insertions(+), 6 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C
index f4e3805c..88b740af 100644
--- a/cinelerra-5.1/cinelerra/exportedl.C
+++ b/cinelerra-5.1/cinelerra/exportedl.C
@@ -92,11 +92,12 @@ int ExportEDLAsset::edit_to_timecodes(Edit *edit,
 	double edit_sourceend;
 	double edit_deststart;
 	double edit_destend;
-
+	
+	if(!strcmp(reel_name,""))
 	strcpy(reel_name, "   BL   ");
-	edit_sourcestart = 0;
-	edit_sourceend = track->from_units(edit->length);
-
+	edit_sourcestart = track->from_units(edit->startsource);
+	edit_sourceend = track->from_units(edit->length + edit->startsource);
+	
 	edit_deststart = track->from_units(edit->startproject);
 	edit_destend = track->from_units(edit->startproject + edit->length);
 
@@ -138,8 +139,24 @@ void ExportEDLAsset::export_it()
 	{
 
 		// TODO: Find docs about exact header for CMX3600
-		fprintf(fh, "TITLE: Cinproj   FORMAT: CMX 3600 4-Ch\n");
-
+		// https://xmil.biz/EDL-X/CMX3600.pdf
+		double frame_rate = edl->session->frame_rate;
+		int frame_rate_int = (int)frame_rate;
+		char proj_title[BCTEXTLEN];
+		strcpy(proj_title,basename(mwindow->session->filename));
+		fprintf(fh, "TITLE: %s fps: %f\n", proj_title, frame_rate);
+		switch(frame_rate_int) {
+		case 24:
+		case 25:
+		case 50:
+		case 60:
+		if (frame_rate - frame_rate_int < 0.0001)
+		fprintf(fh, "FCM: NON-DROP FRAME\n"); // fixme: select depending on fps
+		break;
+		default:
+		if ((frame_rate - frame_rate_int > 0.0001) && (frame_rate == 29.97))
+		fprintf(fh, "FCM: DROP FRAME\n");
+		}
 		int colnum = 1;
 
 
@@ -147,6 +164,11 @@ void ExportEDLAsset::export_it()
 			edit;
 			edit = edit->next)
 		{
+		
+		// max number of entries in cmx3600
+		if (colnum > 999)
+		return;
+		
 			char reel_name[BCTEXTLEN];
 			char avselect[5];
 			char edittype[5] = "C   ";
@@ -155,6 +177,12 @@ void ExportEDLAsset::export_it()
 			char sourceoutpoint[12];
 			char destinpoint[12];
 			char destoutpoint[12];
+			
+			if(!edit->asset)
+			strcpy(reel_name,"BL  ");
+			else
+			strcpy(reel_name,"AX  ");
+			
 			if (track->data_type == TRACK_AUDIO)
 				strcpy(avselect, "A   ");
 			else
@@ -187,10 +215,15 @@ void ExportEDLAsset::export_it()
 			} else
 			{
 				edit_to_timecodes(edit, sourceinpoint, sourceoutpoint, destinpoint, destoutpoint, reel_name);
+				char filename[1024];
+				if (edit->asset)
+				strcpy(filename,basename(edit->asset->path));
 				fprintf(fh, "%03d %8s %s %4s %3s", colnum, reel_name, avselect, edittype, cutinfo);
 				fprintf(fh, " %s %s", sourceinpoint, sourceoutpoint);
 				fprintf(fh, " %s %s", destinpoint, destoutpoint);
 				fprintf(fh,"\n");
+				if(edit->asset)
+				fprintf(fh,"* FROM CLIP NAME: %s\n", filename);
 				last_dissolve = 0;
 			}
 
-- 
2.32.0

From 035f52b19a6d92cd6c379b9bb235a74a430f2c46 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sun, 20 Jun 2021 11:24:17 +0300
Subject: [PATCH 36/43] re-enable 'export edl' for testing

---
 cinelerra-5.1/cinelerra/mainmenu.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cinelerra-5.1/cinelerra/mainmenu.C b/cinelerra-5.1/cinelerra/mainmenu.C
index 60d72d5a..e2902b3b 100644
--- a/cinelerra-5.1/cinelerra/mainmenu.C
+++ b/cinelerra-5.1/cinelerra/mainmenu.C
@@ -134,7 +134,7 @@ void MainMenu::create_objects()
 	filemenu->add_item(new SubttlSWin(mwindow));
 
 	filemenu->add_item(render = new RenderItem(mwindow));
-//	filemenu->add_item(new ExportEDLItem(mwindow));
+	filemenu->add_item(new ExportEDLItem(mwindow));
 	filemenu->add_item(new BatchRenderMenuItem(mwindow));
 	filemenu->add_item(new CreateBD_MenuItem(mwindow));
 	filemenu->add_item(new CreateDVD_MenuItem(mwindow));
-- 
2.32.0

From 567b4539c1e6a0dc032671b276bcfe7bb7c6a2c3 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sun, 20 Jun 2021 13:13:43 +0300
Subject: [PATCH 37/43] Autodetect drop frame in exportedl.C ?

---
 cinelerra-5.1/cinelerra/exportedl.C | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C
index 88b740af..aef4d4af 100644
--- a/cinelerra-5.1/cinelerra/exportedl.C
+++ b/cinelerra-5.1/cinelerra/exportedl.C
@@ -150,13 +150,18 @@ void ExportEDLAsset::export_it()
 		case 25:
 		case 50:
 		case 60:
-		if (frame_rate - frame_rate_int < 0.0001)
+		case 30:
+		{
+		if (frame_rate - frame_rate_int < 0.001)
 		fprintf(fh, "FCM: NON-DROP FRAME\n"); // fixme: select depending on fps
 		break;
+		}
 		default:
-		if ((frame_rate - frame_rate_int > 0.0001) && (frame_rate == 29.97))
+		{
+		if ((frame_rate - frame_rate_int) > 0.001)
 		fprintf(fh, "FCM: DROP FRAME\n");
 		}
+		}
 		int colnum = 1;
 
 
-- 
2.32.0

From efe826d665950b5e419181a664c5a82fe3a8d0f5 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sun, 20 Jun 2021 19:43:03 +0300
Subject: [PATCH 38/43] Hopefully fix timecode offset in exportedl

---
 cinelerra-5.1/cinelerra/exportedl.C | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C
index aef4d4af..d938a7be 100644
--- a/cinelerra-5.1/cinelerra/exportedl.C
+++ b/cinelerra-5.1/cinelerra/exportedl.C
@@ -65,7 +65,7 @@ void ExportEDLAsset::double_to_CMX3600(double seconds, double frame_rate, char *
 			TIME_HMSF,
 			0, // sample_rate ... unnecessary
 			frame_rate,
-			0);    // frames per foot
+			0); // frames per foot
 	if ((int)(seconds / 3600) <= 9)
 	{
 		str[0]='0';
@@ -92,6 +92,12 @@ int ExportEDLAsset::edit_to_timecodes(Edit *edit,
 	double edit_sourceend;
 	double edit_deststart;
 	double edit_destend;
+	double timecode_offset;
+	
+	// timecode_offset in seconds
+	timecode_offset = edit->track->edl->session->timecode_offset;
+	//printf("tc offset %f, \n", timecode_offset);
+	
 	
 	if(!strcmp(reel_name,""))
 	strcpy(reel_name, "   BL   ");
@@ -103,8 +109,8 @@ int ExportEDLAsset::edit_to_timecodes(Edit *edit,
 
 	double_to_CMX3600(edit_sourcestart, frame_rate, sourceinpoint);
 	double_to_CMX3600(edit_sourceend, frame_rate, sourceoutpoint);
-	double_to_CMX3600(edit_deststart, frame_rate, destinpoint);
-	double_to_CMX3600(edit_destend, frame_rate, destoutpoint);
+	double_to_CMX3600(edit_deststart + timecode_offset, frame_rate, destinpoint);
+	double_to_CMX3600(edit_destend + timecode_offset, frame_rate, destoutpoint);
 
 	return 0;
 }
-- 
2.32.0

From f63693a9d7cadf4d1e16168bb85888a4491010b3 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 5 Jul 2021 18:44:55 +0300
Subject: [PATCH 42/43] Final cut pro 1.2.5 accept our edl now, after unix2dos
 utility

---
 cinelerra-5.1/cinelerra/exportedl.C | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C
index d938a7be..dc5b75f3 100644
--- a/cinelerra-5.1/cinelerra/exportedl.C
+++ b/cinelerra-5.1/cinelerra/exportedl.C
@@ -168,6 +168,9 @@ void ExportEDLAsset::export_it()
 		fprintf(fh, "FCM: DROP FRAME\n");
 		}
 		}
+		// newline after FCM
+		fprintf(fh, "\n");
+		
 		int colnum = 1;
 
 
@@ -241,6 +244,14 @@ void ExportEDLAsset::export_it()
 			colnum ++;
 
 		}
+		
+		fprintf(fh, "\n");
+		
+		// file end for final cut pro 1.2.5 ?
+		fprintf(fh, "\x0D");
+		fprintf(fh, "\x0A");
+		fprintf(fh, "\x1A");
+		fprintf(fh, "\x1A");
 
 	}
 
-- 
2.32.0

From 2c48aeff2035a48d24e8c854cad6c83fd5b01f42 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 5 Jul 2021 19:34:04 +0300
Subject: [PATCH 43/43] Exportedl.C - two more "* from clip name" cases ..

---
 cinelerra-5.1/cinelerra/exportedl.C | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C
index dc5b75f3..d4d670eb 100644
--- a/cinelerra-5.1/cinelerra/exportedl.C
+++ b/cinelerra-5.1/cinelerra/exportedl.C
@@ -192,6 +192,10 @@ void ExportEDLAsset::export_it()
 			char destinpoint[12];
 			char destoutpoint[12];
 			
+			char filename[1024];
+			if (edit->asset)
+			strcpy(filename,basename(edit->asset->path));
+			
 			if(!edit->asset)
 			strcpy(reel_name,"BL  ");
 			else
@@ -216,6 +220,8 @@ void ExportEDLAsset::export_it()
 					fprintf(fh, " %s %s", last_sourceout, last_sourceout);
 					fprintf(fh, " %s %s", destinpoint, destinpoint);
 					fprintf(fh,"\n");
+					if(edit->asset)
+					fprintf(fh,"* FROM CLIP NAME: %s\n", filename);
 				} else
 				{
 					colnum --;
@@ -225,13 +231,12 @@ void ExportEDLAsset::export_it()
 				fprintf(fh, " %s %s", sourceinpoint, sourceoutpoint);
 				fprintf(fh, " %s %s", destinpoint, destoutpoint);
 				fprintf(fh,"\n");
+				if(edit->asset)
+				fprintf(fh,"* FROM CLIP NAME: %s\n", filename);
 				last_dissolve = 1;
 			} else
 			{
 				edit_to_timecodes(edit, sourceinpoint, sourceoutpoint, destinpoint, destoutpoint, reel_name);
-				char filename[1024];
-				if (edit->asset)
-				strcpy(filename,basename(edit->asset->path));
 				fprintf(fh, "%03d %8s %s %4s %3s", colnum, reel_name, avselect, edittype, cutinfo);
 				fprintf(fh, " %s %s", sourceinpoint, sourceoutpoint);
 				fprintf(fh, " %s %s", destinpoint, destoutpoint);
-- 
2.32.0

-- 
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to