Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write color decision list to ale #1283

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
32 changes: 32 additions & 0 deletions contrib/opentimelineio_contrib/adapters/ale.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ def write_to_string(input_otio, columns=None, fps=None, video_format=None):
if key not in columns:
columns.append(key)

# If otio contains CDL data add ASC_SOP and/or ASC_SAT columns
cdl = clip.metadata.get('cdl', None)
if cdl is not None:
if cdl.get('asc_sop') and 'ASC_SOP' not in columns:
columns.append('ASC_SOP')
if cdl.get('asc_sat') and 'ASC_SAT' not in columns:
columns.append('ASC_SAT')

# Always output these
for c in ["Duration", "End", "Start", "Name", "Source File"]:
if c not in columns:
Expand Down Expand Up @@ -340,6 +348,30 @@ def val_for_column(column, clip):
return otio.opentime.to_timecode(
clip.source_range.end_time_exclusive(), fps
)
elif column == "ASC_SOP":
asc_sop = clip.metadata.get("cdl", {}).get("asc_sop", {})
slope = asc_sop.get("slope", None)
offset = asc_sop.get("offset", None)
power = asc_sop.get("power", None)
asc_sop_arr = [slope, offset, power]
if None in asc_sop_arr:
return clip.metadata.get("ALE", {}).get(column)
asc_sop = ""
try:
for i in range(3):
asc_sop += "("
asc_sop += str(asc_sop_arr[i][0]) + " "
asc_sop += str(asc_sop_arr[i][1]) + " "
asc_sop += str(asc_sop_arr[i][2]) + ")"
except IndexError:
return clip.metadata.get("ALE", {}).get(column, "")
return asc_sop
elif column == "ASC_SAT":
asc_sat = clip.metadata.get("cdl", {}).get("asc_sat", None)
if asc_sat is not None:
return asc_sat
else:
return clip.metadata.get("ALE", {}).get(column)
else:
return clip.metadata.get("ALE", {}).get(column)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Column
Color Name Creation Date Duration Drive IN-OUT Mark IN Mark OUT Tracks Frame Auxiliary TC2 Auxiliary TC5 Auxiliary TC3 Film TC FPS Perf KN End KN Start Ink Number KN IN-OUT KN Dur KN Mark OUT End KN Mark IN Auxiliary Ink Offline Pullin Auxiliary TC4 Pullout Project Sound TC VITC Scene Lock CFPS Soundroll Take Camroll Reel Slip Shoot Date Camera Reel # Labroll KN Film Vendor Invoice ID Vendor Original Master VFX Reel TC 25 S3D Alignment Audio Bit Depth TC 24 Start Ink Film AuxInk Edge AuxInk End Frame Count End Format Ink Dur VFX Ink End Vendor Asset ID S3D Eye Order Cadence Aux TC 24 DPX Vendor Asset Name AuxInk Film Vendor Asset Description Frame Count Start Video File Format Ink Edge Frame Count Duration Image Size TC 30 AuxInk Dur Raster Dimension S3D InversionR LUT Master Dur Master Edge Master End Master Film TC 25PD Master Start S3D Inversion Vendor URL UNC Path Transfer TC 30NP Vendor Asset Status Disk Label S3D Clip Name Journalist Production Vendor Asset Price IDataLink ASC_SOP Image Framing ASC_SAT S3D Group Name Auxiliary TC1 Vendor Name AFD Field Motion Track Formats S3D Channel Color Space Image Aspect Ratio Pixel Aspect Ratio S3D Leading Eye Reformat Vendor Asset Keywords Source File Vendor Asset Rights S3D Contributors Marker Ancillary Data Color Transformation Source Path Modified Date Audio Format Vendor Download Master Tape Video Plug-in TapeID Audio SR Comments

Data
test_017056 7/28/17 10:49:11 AM 00:00:04:03 Tools_Media [VSD] V 24.00 6+03 01:00:04:03 zzz 24.00 NONE 01:00:00:00 98 1080p/24 NORM 0 MXF 99 1920 x 1080 1920x1080p /Users/zzz/Desktop/test_017056.aaf Progressive MONO YCbCr REC709 [video levels] 16:9 1.000 Stretch test_017056.aaf /Users/zzz/Desktop/ 7/28/17 10:49:43 AM DNxHD 36 (HD1080p)
test_017057 7/25/17 5:39:38 PM 00:00:04:04 Tools_Media [VSD] V 24.00 6+03 01:00:04:04 zzz 24.00 NONE 01:00:00:00 98 1080p/24 NORM 0 MXF 99 1920 x 1080 1920x1080p /Users/zzz/Desktop/test_017057.aaf Progressive MONO YCbCr REC709 [full range] 16:9 1.000 Stretch test_017057.aaf /Users/zzz/Desktop/ 7/25/17 5:39:59 PM DNxHD 36 (HD1080p)
test_017058 7/25/17 5:28:44 PM 00:00:04:05 Tools_Media [VSD] V 24.00 6+03 01:00:04:05 zzz 24.00 NONE 01:00:00:00 98 1080p/24 NORM 0 MXF 99 1920 x 1080 1920x1080p /Users/zzz/Desktop/test_017058.aaf Progressive MONO YCbCr REC709 [full range] 16:9 1.000 Stretch test_017058.aaf /Users/zzz/Desktop/ 7/25/17 5:29:24 PM DNxHD 36 (HD1080p)
Something 7/25/17 4:34:21 PM 00:00:04:06 Tools_Media [VSD] V 24.00 6+03 01:00:04:06 zzz 24.00 NONE 01:00:00:00 98 1080p/24 NORM 0 MXF 99 1920 x 1080 1920x1080p /Users/zzz/Desktop/output.aaf Progressive MONO YCbCr REC709 [video levels] 16:9 1.000 Stretch output.aaf /Users/zzz/Desktop/ 7/25/17 4:35:02 PM DNxHD 36 (HD1080p)
test_017056 7/28/17 10:49:11 AM 00:00:04:03 Tools_Media [VSD] V 24.00 6+03 01:00:04:03 zzz 24.00 NONE 01:00:00:00 98 1080p/24 NORM 0 MXF 99 1920 x 1080 1920x1080p /Users/zzz/Desktop/test_017056.aaf (0.8714 0.9334 0.9947)(-0.087 -0.0922 -0.0808)(0.9988 1.0218 1.0101) 0.9 Progressive MONO YCbCr REC709 [video levels] 16:9 1.000 Stretch test_017056.aaf /Users/zzz/Desktop/ 7/28/17 10:49:43 AM DNxHD 36 (HD1080p)
test_017057 7/25/17 5:39:38 PM 00:00:04:04 Tools_Media [VSD] V 24.00 6+03 01:00:04:04 zzz 24.00 NONE 01:00:00:00 98 1080p/24 NORM 0 MXF 99 1920 x 1080 1920x1080p /Users/zzz/Desktop/test_017057.aaf (0.8714 0.9334 0.9947)(-0.087 -0.0922 -0.0808)(0.9988 1.0218 1.0101) 0.9 Progressive MONO YCbCr REC709 [full range] 16:9 1.000 Stretch test_017057.aaf /Users/zzz/Desktop/ 7/25/17 5:39:59 PM DNxHD 36 (HD1080p)
test_017058 7/25/17 5:28:44 PM 00:00:04:05 Tools_Media [VSD] V 24.00 6+03 01:00:04:05 zzz 24.00 NONE 01:00:00:00 98 1080p/24 NORM 0 MXF 99 1920 x 1080 1920x1080p /Users/zzz/Desktop/test_017058.aaf (0.8604 0.9252 0.9755)(-0.0735 -0.0813 -0.0737)(0.9988 1.0218 1.0101) 0.9 Progressive MONO YCbCr REC709 [full range] 16:9 1.000 Stretch test_017058.aaf /Users/zzz/Desktop/ 7/25/17 5:29:24 PM DNxHD 36 (HD1080p)
Something 7/25/17 4:34:21 PM 00:00:04:06 Tools_Media [VSD] V 24.00 6+03 01:00:04:06 zzz 24.00 NONE 01:00:00:00 98 1080p/24 NORM 0 MXF 99 1920 x 1080 1920x1080p /Users/zzz/Desktop/output.aaf (0.8604 0.9252 0.9755)(-0.0735 -0.0813 -0.0737)(0.9988 1.0218 1.0101) 0.9 Progressive MONO YCbCr REC709 [video levels] 16:9 1.000 Stretch output.aaf /Users/zzz/Desktop/ 7/25/17 4:35:02 PM DNxHD 36 (HD1080p)
Loading