Log in

View Full Version : The Ultimate Avisynth DCP (Digital Cinema Package) creation guide


FranceBB
6th December 2022, 23:18
Hi fellas,
it's been a while but I finally found the time to make a guide about DCP creation via Avisynth and to debunk some of the myths around it.
We're gonna have three main cases which we're gonna deal with today:

- Case 1 - BT709 SDR
- Case 2 - BT2020 HDR HLG
- Case 3 - BT2020 HDR PQ

Now, before we jump into any of this, let's start by saying that regardless of your source, a DCP will always always always be one with the very same specifications: DCI P3 D63 gamma 2.6 in XYZ, which means that no matter what you're gonna get as an input, you're always gonna have to convert and of course this is gonna be a piece of cake for Avisynth.


Let's start with the basics:

a DCP is made of the following components:

- ASSETMAP.xml
- CPL.xml
- PKL.xml
- VOLINDEX.xml
- Audio.mxf
- Video.mxf

to create those we're gonna use Avisynth, FFMpeg and OpenDCP.
The idea is therefore to:

- Use Avisynth to handle DCI P3 D63 γ 2.6 XYZ conversion
- FFMpeg to encode the uncompressed XYZ 16bit stream in tiff lossless
- open JPEG encoder to encode the XYZ 16bit tiff into XYZ 12bit .j2k
- open mxf to append and mux the individual .j2k as .mxf


The audio will be the same:

- Avisynth for indexing
- FFMpeg to save each channel as discrete mono PCM 24bit 48'000Hz
- open mxf to interleave the mono PCM and mux the final audio file in .mxf


When everything is done, we'll then use open xml to create the various .xml files that make up the DCP.


Now, in a DCP you can only have 2 resolutions and those are Flat and Scope for either 2K or 4K:

2K:

Flat (1998 × 1080) = 1.85 LB
Scope (2048 × 858) = 2.39 LB

4K:

Flat (3996 × 2160) = 1.85 LB
Scope (4096 × 1716) = 2.39 LB

which means that the very first thing you have to do when you write your Avisynth Script is to resize while keeping the Aspect Ratio.
The second thing you'll need to address is the frame rate.
Historically, only 24p and 25p were supported, however nowadays 30p, 48p, 50p and 60p are officially supported. Keep in mind, though, that NOT all cinemas will accept "high frame rate" (i.e anything above 25p) 'cause perhaps they haven't upgraded yet, so... always check with them.
Anyway, in a nutshell, the following framerates are officially supported as per specs:

- 24p
- 25p
- 30p
- 48p
- 50p
- 60p


Let's start with the BT.709 SDR use case.

### BT709 SDR ###

If you're dealing with BT709 SDR files, you're in luck 'cause it's gonna be the open jpeg encoder that will handle everything for you, which makes it the easiest thing to work with in general. All you need to do in Avisynth is make sure that the Aspect Ratio and framerate are correct and to deliver a 16bit RGB Full Range output stream 0-65280.



AVS Script:


#Indexing
video=LWLibavVideoSource("V:\01_INGEST_MAM\MMA\Test_BT709_SDR.mxf", fpsnum=25000, fpsden=1000)
FL=WAVSource("V:\01_INGEST_MAM\MMA\audio\Italian\01.Test.wav")
FR=WAVSource("V:\01_INGEST_MAM\MMA\audio\Italian\02.Test.wav")
CC=WAVSource("V:\01_INGEST_MAM\MMA\audio\Italian\03.Test.wav")
LFE=WAVSource("V:\01_INGEST_MAM\MMA\audio\Italian\04.Test.wav")
LS=WAVSource("V:\01_INGEST_MAM\MMA\audio\Italian\05.Test.wav")
RS=WAVSource("V:\01_INGEST_MAM\MMA\audio\Italian\06.Test.wav")
audio=MergeChannels(FL, FR, CC, LFE, LS, RS)
AudioDub(video, audio)

#Removing original black bars
Crop(0, 44, -0, -44)

#Resize to 4K Flat 1.85 LB
Spline64ResizeMT(3996, 2160)


#Converting to RGB Planar 16bit Full Range
ConvertBits(16)
ConverttoPlanarRGB(matrix="PC.709")



We can encode it with the following command:

ffmpeg.exe -i "AVS Script.avs" -an -r 25 -pix_fmt rgb48 -vcodec tiff -y "tiff\%%06d.tiff"


pause

this will create a series of RGB48 BT709 SDR full range .tiff into the a folder called "tiff".

At this point, we're gonna encode them into JPEG2000 and the encoder will handle the conversion to DCI P3 XYZ and then dither down to 12bit planar and encode.

opendcp_j2k.exe -i "tiff" -o "j2k" -r 25 -b 250M -p cinema4k -t 1

pause

this will take the tiff frames and encode them all in 250 Mbit/s JPEG2000 Intra with the 4K profile (set the -t parameter to the maximum number of threads in your CPU).

Please note that you can use any bitrate from 1 Mbit/s to 250 Mbit/s, however for 2K you shouldn't exceed 125 Mbit/s, while with 4K you can go up to 250 Mbit/s.

Will something happen if you encode a 2K at 250 Mbit/s?
Well, the answer is: "it depends".
If the cinema you're sending it to supports 4K, then it will almost certainly be able to play it anyway, however if the cinema you're sending it to doesn't support 4K, chances are that it won't play it (or even worse it will fill the buffer over time and it will stutter).
In a nutshell, if you're encoding a 2K, don't risk it and don't exceed 125 Mbit/s, while if you're encoding a 4K, feel free to go all the way up to 250 Mbit/s if you feel like the movie needs it.

Keep in mind that the MJPEG2000 12bit encode will take... a lot 'cause MJPEG2000 uses the Wavelet Transform which is a Trasform that doesn't divide the frames in blocks and macroblocks of 4x4 and 8x8 etc, but rather encodes the whole frame as one. This, of course, prevents blocking and other Discrete Cosine Transform specific artifacts even at lower bitrates, however it will be hugely expensive in terms of encoding (and decoding on playback if you're not using hardware decoding).


Anyway, remember that we're encoding with an Intra profile, which means that all frames are encoded as individual images and there's no motion compensation whatsoever, so you'll have to "append" all those images in a real MJPEG2000 Intra Class stream and mux that into .mxf and to do this you can use:

"opendcp_mxf.exe" -i "j2k" -o "Video.mxf" -r 25

pause

again, always remember to specify the framerate with -r (in this case 25p).


At this point, you'll have a Video.mxf and all is left to do is to handle the audio.
Hopefully, at this point you have already indexed the audio in Avisynth. The audio can be 2.0, 5.1 or 7.1.

If it's stereo 2.0, you'll have only:

- Left Full Mix
- Right Full Mix

"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.0:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\01.left.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.1:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\02.right.wav"


otherwise if it's a 5.1 you'll have:

- FL
- FR
- CC
- LFE
- LS
- RS

"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.0:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\01.left.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.1:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\02.right.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.2:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\03.center.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.3:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\04.lfe.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.4:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\05.leftsur.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.5:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\06.rightsur.wav"

pause

The split comes from the fact that in Avisynth you'll always have 1 stream with all the channels in it, however to mux into mxf you'll need to split and then perform the interleave separately.

Once you have all the individual channels, it's time to mux into MXF:

opendcp_mxf.exe -i "audiosplit" -o "Audio.mxf" -r 25

pause

again, always always always remember to specify the framerate with -r (in this case 25).


At this point, you have the video, you have the audio, all is left to create is the xml:

"opendcp_xml.exe" --title "TestA" --issuer "TestB" --kind feature --reel "video.mxf" "Audio.mxf"

pause

and please replace "TestA" with the name of the movie and "TestB" with the name of the company you work for (in my case, it would be Sky Plc).

And... congratulations, you're done.
If you want to playback the DCP you can use DCP O Matic (free and open source) and use the player to playback the content (please remember to enable OpenGL acceleration in preferences).





### BT2020 HDR HLG ###

For HLG contents, the conversion is still fairly straightforward, the only thing you have to keep in mind is that your result MUST be in DCI P3 XYZ with 2.6 gamma before you pass it to the OpenJPEG encoder, but you're in luck 'cause you can use my LUTs to perform the conversion (https://forum.doom9.org/showthread.php?t=176091).
Here's a 3840x2160 HDR HLG movie in XAVC Intra Class 300 which had 2.35 LB borders for which I performed the conversion:

#Indexing
video=LWLibavVideoSource("H.264 UHD HDR HLG BT2020 YUV422 25p 10bit.mxf", fpsnum=25000, fpsden=1000)
audio=LWLibavAudioSource("H.264 UHD HDR HLG BT2020 YUV422 25p 10bit.mxf", stream_index=1)
AudioDub(video, audio)

#Removing black bars
Crop(0, 278, -0, -278)

#Going to Cinema 4K Scope 2.39 LB
Spline64ResizeMT(4096, 1716)

#Going to RGB Full Range with 16bit precision
z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020:std-b67:2020:limited=>rgb:std-b67:2020:full", resample_filter_uv="spline64", dither_type="error_diffusion")

#From BT2020 HLG to DCI P3 D63 gamma 2.6 XYZ
Cube("A:\MEDIA\temp\BT2020_HLG_to_DCI_XYZ.cube", fullrange=true)

https://i.imgur.com/rW9gvoJ.png

at this point it's gonna be:

ffmpeg.exe -i "AVS Script.avs" -an -r 25 -pix_fmt rgb48 -vcodec tiff -y "tiff\%%06d.tiff"

opendcp_j2k.exe -i "tiff" -o "j2k" -r 25 -b 250M -p cinema4k -t 1 --no_xyz --colorspace p3 --dpx linear

"opendcp_mxf.exe" -i "j2k" -o "Video.mxf" -r 25


"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.0:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\01.left.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.1:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\02.right.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.2:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\03.center.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.3:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\04.lfe.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.4:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\05.leftsur.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.5:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\06.rightsur.wav"


opendcp_mxf.exe -i "audiosplit" -o "Audio.mxf" -r 25


"opendcp_xml.exe" --title "TestA" --issuer "TestB" --kind feature --reel "video.mxf" "Audio.mxf"

pause

and as always, please rename TestA and TestB with the name of the movie and the name of the company you work for, respectively.


Original source in BT2020 HLG HDR YUV 10bit (displayed as is without interpreting the colour curve and matrix):

https://i.imgur.com/gLffohq.png

DCI P3 D63 XYZ 16bit output from Avisynth (displayed as is without interpreting the colour curve, matrix and colorspace):

https://i.imgur.com/EY7ASPa.png

DCI P3 D63 XYZ 12bit MJPEG2000 Intra Class (displayed as is without interpreting the colour curve, matrix, colorspace and density of each colour channel):

https://i.imgur.com/yzkKC2O.png


Now, since everything above is "cool" but makes little sense in terms of comparison, let's interpret those values with a proper player, shall we?

DCI P3 D63 XYZ 12bit (correctly displayed):

https://i.imgur.com/KWm4t6l.png




### BT2020 HDR PQ ###

With PQ, technically, things get a bit more complicated. This is because in theory with PQ you need to know the MaxCLL (i.e the nits) to perform the conversion and you should have 1 LUT per nit for a total of 10'000 LUTs. Practically, this isn't doable and I made one single LUT for now, however I'm planning to create a LUT every 1000 nits, so one for 1000, one for 2000, one for 3000 and so on.

Anyway, not to waste any time, here's an HDR PQ movie which I had to crop, resize and convert from 23,976 to 24p before encoding:

#Indexing
video=LWLibavVideoSource("H.265 UHD HDR PQ BT2020 YUV422 23,976p 10bit.mxf", fpsnum=24000, fpsden=1001)
audio=LWLibavAudioSource("H.265 UHD HDR PQ BT2020 YUV422 23,976p 10bit.mxf")
AudioDub(video, audio)

#Cropping to get to 4K Flat 1.85 LB
Crop(0, 44, -0, -44)
Spline64ResizeMT(3996, 2160)

#Going to RGB Full Range with 16bit precision
z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020:st2084:2020:limited=>rgb:st2084:2020:full", resample_filter_uv="spline64", dither_type="error_diffusion")

#Going from BT2020 HDR PQ to DCI P3 D63 gamma 2.6 XYZ
Cube("A:\MEDIA\temp\BT2020_PQ_to_DCI_XYZ.cube", fullrange=true)

#Speed up from 23,976 to 24p
ResampleAudio(48000)
AssumeFPS(24, 1, true)
ResampleAudio(48000)

https://i.imgur.com/UFnVxN5.png

At this point, it's all the same, but of course this time with -r 24 as it's 24p:

ffmpeg.exe -i "AVS Script.avs" -an -r 24 -pix_fmt rgb48 -vcodec tiff -y "tiff\%%06d.tiff"

opendcp_j2k.exe -i "tiff" -o "j2k" -r 24 -b 250M -p cinema4k -t 1 --no_xyz --colorspace p3 --dpx linear

"opendcp_mxf.exe" -i "j2k" -o "Video.mxf" -r 24


"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.0:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\01.left.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.1:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\02.right.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.2:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\03.center.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.3:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\04.lfe.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.4:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\05.leftsur.wav"
"ffmpeg.exe" -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.5:0.0.0 -acodec pcm_s24le -ar 48000 -y "audiosplit\06.rightsur.wav"


opendcp_mxf.exe -i "audiosplit" -o "Audio.mxf" -r 24


"opendcp_xml.exe" --title "TestA" --issuer "TestB" --kind feature --reel "video.mxf" "Audio.mxf"

pause

and again, as always, please rename TestA and TestB with the name of the movie and the name of the company you work for, respectively.





Original source in BT2020 PQ HDR YUV 10bit (displayed as is without interpreting the colour curve and matrix):

https://i.imgur.com/RVp8K0f.png

DCI P3 D63 XYZ 16bit output from Avisynth (displayed as is without interpreting the colour curve, matrix and colorspace):

https://i.imgur.com/FexDHAa.png


DCI P3 D63 XYZ 12bit MJPEG2000 Intra Class (displayed as is without interpreting the colour curve, matrix, colorspace and density of each colour channel):

https://i.imgur.com/HDoAa7T.png


Now, since everything above is "cool" but makes little sense in terms of comparison, let's interpret those values with a proper player, shall we?


DCI P3 D63 XYZ 12bit (correctly displayed):

https://i.imgur.com/0ClGKHA.png



Download Links:

- FranceBB LUT Collection (https://forum.doom9.org/showthread.php?t=176091)
- FranceBB MJPEG2000 Package with executables, BATs and AVS Scripts (https://mega.nz/file/jMUUhBhZ#p8FJ1VP9m89-0ZLcJM757kp6D9JtTf-onFAb73UWEpI) - Mirror (Backup Only) (https://drive.google.com/file/d/1PBfnKEslOHMEvbhPxJY4lkBgLprzBmVi/view?usp=share_link)
- OpenDCP GitHub release (https://github.com/FranceBB/OpenDCP)
- DCP O Matic GitHub (https://github.com/cth103/dcpomatic) - Builds (https://dcpomatic.com/download)

FranceBB
6th December 2022, 23:19
A big fat thank you to Livio Aloja (algia) - Terrence Meiczinger (tmeiczin) - Carl Hetherington (cth103) and the rest of the Avisynth open source community

Open source rocks

FAQ:
"Have those actually been used at cinemas?"

Absolutely, plenty of times.
This is one example at a theatre: Img1 (https://i.imgur.com/ri8Xi4P.png) - Img2 (https://i.imgur.com/Y9HY1t8.png) - Img3 (https://i.imgur.com/vzbvK0a.png)


"Can you name a movie entirely done with Avisynth, including the cinema release?"

Absolutely, "A proposito di Max" which translates as "About Max" has been entirely post-processed with Avisynth. https://www.imdb.com/title/tt11462526/


"Can you show us what a DCP looks like?"

Sure.

https://i.imgur.com/diGk1QS.png
https://i.imgur.com/iewvw5P.png


"Why does it say RGB instead of XYZ when I check clip properties in the Avisynth stream?"

Unfortunately Avisynth doesn't have a way of flagging XYZ internally, so the most common option is to abuse RGB 16bit planar to store XYZ as long as everyone is aware that it isn't actually RGB. Jean Philippe Scotto di Rinaldi (JPSDR) has been the first to use this method to handle XYZ, so I followed. There have been some improvements recently, for instance LWLibavVideoSource() now allows indexing of XYZ without touching it and it spoofs it as RGB48 too, while FFVideoSource() converts it to YUV and outputs YUV 4:4:4 16bit planar.


"Why do I see the preview green-ish in AVSPmod mod?"

It's normal, you're watching XYZ without telling AVSPmod mod that it's XYZ for the reason above.
If you want to see it properly, create a 'Snippet' or 'Display filter' in AVSPmod mod as described by Gispos: https://forum.doom9.org/showthread.php?t=175823&page=63

Emulgator
7th December 2022, 00:21
Many thanks, FranceBB !
A good thread to return to when I get to handle HDR HLG/PQ masterfiles.

anton_foy
7th December 2022, 12:10
Many thanks FranceBB great job!
Soon I will use this to make both a 2k and 4k DCP but I am a bit confused how to export properly.

Final grade and export from Davinci Resolve to 4k and 2k prores or mxf 444-12bit:

When grading I have of course a calibrated 10-bit display and what I see I will get (basically, I have used the company's Resolve and easyDCP to export and compared to the DCP shown in the theatre and it looked almost identical to what I had graded although an EXTREMELY minor tint in the highlights toward blue).
When exporting from Resolve I can use levels: auto, video or full. I usually leave this in auto and after export I import the final file into Resolve to see if it differs from the graded timeline to see if I have to manually chose another setting. How do I know if Avisynth will interpret the file correctly?
(although this is not then possible to import into Avisynth and keep the 12-bits? Alternatively I could export from Resolve in 444-10bit and import into Avisynth in 10-bit too)

Or would you recommend to export tiff's directly from Resolve in 12-bit?

I guess I will keep it in SDR because I do not know how HDR HLG/PQ would benefit my project since I grade it in Resolve as it should look?
Thanks!

FranceBB
7th December 2022, 13:58
Final grade and export from Davinci Resolve to 4k and 2k prores or mxf 444-12bit

[...]

How do I know if Avisynth will interpret the file correctly?
(although this is not then possible to import into Avisynth and keep the 12-bits? Alternatively I could export from Resolve in 444-10bit and import into Avisynth in 10-bit too)


I think Davinci allows you to export to either ProRes or DNXHQX.
If you choose DNXHQX 4:4:4 12bit and PCM 24bit audio, you can totally use FFVideoSource() and FFAudioSource(). It will index it and it will be correctly displayed as 12bit. I haven't tried LWLibavVideoSource() yet but technically it should too.



When exporting from Resolve I can use levels: auto, video or full.


If you use Video, it will be in Limited TV Range, however if you choose Full it will be in Full PC Range.
Regardless of this, if Resolve sets the right flag, the Indexer will read it accordingly.
To check it, you can do:

TurnRight.Histogram.TurnLeft

and see if it's filling up the entire spectrum, including the brown bars.
If it is, then it's Full PC Range, if it isn't and the black sits above the brown, then it's Limited TV Range.
Otherwise you can use my VideoTek() (https://forum.doom9.org/showthread.php?p=1832763#post1832763)




Or would you recommend to export tiff's directly from Resolve in 12-bit?


if it can export them as Full PC Range in BT709 SDR, then sure, otherwise you would need to address the conversion to DCI P3 D63 XYZ yourself inside Resolve and export them like that (and I'm not familiar enough with Resolve to tell you whether it's doable or not).



I guess I will keep it in SDR because I do not know how HDR HLG/PQ would benefit my project since I grade it in Resolve as it should look?


Yeah, it wouldn't make sense to grade in HLG or PQ for you, given that you're working in Resolve and you can grade it in exactly the way it's gonna look. ;)

FranceBB
8th December 2022, 11:50
With the new release of my LUT Collection (https://forum.doom9.org/showthread.php?t=176091) I've introduced support for the DCI P3 D63 XYZ roundtrip to and from BT2020 HLG and PQ.
This is targeted for those who are NOT creating a DCP but rather they're receiving one as masterfile and they wanna go somewhere else, like to HLG or to PQ before re-encoding.

A quick example is the following:


#Indexing DCI P3 D63 gamma 2.6 XYZ DCP
LwLibavVideoSource("\\Mibcpmcs011\raid0\MASTERFILES\A_Proposito_di_Max_DCP\A_Proposito_di_Max.video.mxf")

https://i.imgur.com/D8q4f6g.png

Now, if we wanna go to BT2020 HDR PQ:


#Indexing DCI P3 D63 gamma 2.6 XYZ DCP
LwLibavVideoSource("\\Mibcpmcs011\raid0\MASTERFILES\A_Proposito_di_Max_DCP\A_Proposito_di_Max.video.mxf")

#Going to BT2020 PQ RGB Full Range with 16bit precision
ConvertBits(16)
ConvertToPlanarRGB(matrix="PC.2020")
Cube("A:\MEDIA\temp\DCI_XYZ_to_BT2020_PQ.cube", fullrange=true)


https://i.imgur.com/FDGevLA.png


Adding a quick and dirt BT709 Display conversion only to see it correctly in our monitor (remember, Display Filter in AVSPmod mod by Gispos):

https://i.imgur.com/4rtYWu6.png



And just like that, we can also go to BT2020 HLG in exactly the same way, in fact:


#Indexing DCI P3 D63 gamma 2.6 XYZ DCP
LwLibavVideoSource("\\Mibcpmcs011\raid0\MASTERFILES\A_Proposito_di_Max_DCP\A_Proposito_di_Max.video.mxf")

#Going to BT2020 HLG RGB Full Range with 16bit precision
ConvertBits(16)
ConvertToPlanarRGB(matrix="PC.2020")
Cube("A:\MEDIA\temp\DCI_XYZ_to_BT2020_HLG.cube", fullrange=true)


https://i.imgur.com/ekPL6Ie.png

and if we again add a quick and dirt BT709 Display conversion only to see it correctly in our monitor (remember, Display Filter in AVSPmod mod by Gispos):

https://i.imgur.com/tT4cJ9p.png

anton_foy
8th December 2022, 15:04
I think Davinci allows you to export to either ProRes or DNXHQX.
If you choose DNXHQX 4:4:4 12bit and PCM 24bit audio, you can totally use FFVideoSource() and FFAudioSource(). It will index it and it will be correctly displayed as 12bit. I haven't tried LWLibavVideoSource() yet but technically it should too.

Super! I did not know that Avisynth+ had support for 10bit+ indexing. I read some time before there was a hack to import in 10-bit max. Great then DNXHQX 4:4:4 12bit and PCM 24bit audio it will be.

If you use Video, it will be in Limited TV Range, however if you choose Full it will be in Full PC Range.
Regardless of this, if Resolve sets the right flag, the Indexer will read it accordingly.

This bit is for me a tricky one. I want to be able to use Full PC Range but after test export when importing the exported clip back to Resolve it looses contrast. Although I guess I should follow through your magnificent guide and do a short test DCP and play it on my calibrated display with DCP O Matic to see if the colors (rather contrast and levels since this project is going to be in black and white) will be correct.
I guess this is the only reasonable way to find out? Hopefully DCP O Matic plays "as is" rather than using some gamma correction stuff like Quicktime or VLC :D

EDIT: you can chose how to interpret the file into Resolve if full or video levels but sometimes it does not fix the contrast issue anyway.
(Off topic question I guess?) is there any way to only use black and white for a DCP or does it use full color anyway?

FranceBB
8th December 2022, 16:00
Super! I did not know that Avisynth+ had support for 10bit+ indexing. I read some time before there was a hack to import in 10-bit max.

Yeah, back in the Avisynth 2.6.1 era, you could index up to 10bit planar and it was gonna be displayed as 16bit stacked (i.e double height with 8bit MSB + 8bit LSB stacked one on top of the other) with FFVideoSource() and 16bit interleaved (i.e double width with 8bit MSB + 8bit LSB interleaved together and one next to the other) with LWLibavVideoSource().

A lot of time has passed since then and we're currently in the Avisynth 3.7.2 era with planar high bit depth support and indexing.



Great then DNXHQX 4:4:4 12bit and PCM 24bit audio it will be.

:)



I want to be able to use Full PC Range but after test export when importing the exported clip back to Resolve it loses contrast.


I think some kind of conversion between limited and full is occuring, then.
Probably even if you use Full PC Range, when you import it back it assumes Limited 'cause it's YUV and not RGB. That would be a "bug" in Resolve.
Anyway, there's nothing "bad" in using Limited, it will simply be Avisynth's duty to "expand" it into Full PC Range and for such a capable frameserver this is a piece of cake ;)



Although I guess I should follow through your magnificent guide and do a short test DCP and play it on my calibrated display with DCP O Matic to see if the colors (rather contrast and levels since this project is going to be in black and white) will be correct.
I guess this is the only reasonable way to find out?


Well, you could index the produced file and check with Avisynth with

TurnRight.Histogram.TurnLeft

but yeah, even going on with the whole process of the DCP creation would work.


Hopefully DCP O Matic plays "as is" rather than using some gamma correction stuff like Quicktime or VLC :D


Absolutely, you can trust DCP O Matic on this. ;)



is there any way to only use black and white for a DCP or does it use full color anyway?

Uhmmm good question, I don't think so, however if you kill the chroma in your source, even if you encode it as 4:4:4, it will be of just a single value, so it shouldn't waste that much space (unless the Open JPEG2000 encoder zero-fills to reach the target bitrate, which would be interesting but I don't think it will unless it really really really needs to).

spoRv
10th December 2022, 16:05
Hey France, thanks for this new tool, great and useful as usual, kudos!

I must add that you forgot full resolutions (2048 × 1080 and 4096 × 2160) - even if not widely used, they are supported, like for the IMAX 1.89:1 movies.

Emulgator
12th December 2022, 11:59
To sum all up I've got:
DCP-Encoding
Resolution (DAR) Width Height Framerate

4K DCP Standard
4K Full Container 4096x2160x30 (AR 1,896) 4096 2160 30,00000 fps
4K Full Container 4096x2160x25 (AR 1,896) 4096 2160 25,00000 fps
4K Full Container 4096x2160x24 (AR 1,896) 4096 2160 24,00000 fps
4K Scope 4096x1716x30 (AR 2,387) 4096 1716 30,00000 fps
4K Scope 4096x1716x25 (AR 2,387) 4096 1716 25,00000 fps
4K Scope 4096x1716x24 (AR 2,387) 4096 1716 24,00000 fps
4K Flat 3996x2160x30 (AR 1,85) 3996 2160 30,00000 fps
4K Flat 3996x2160x25 (AR 1,85) 3996 2160 25,00000 fps
4K Flat 3996x2160x24 (AR 1,85) 3996 2160 24,00000 fps
4K HDTV 3840x2160x30 (AR 1,778) 3840 2160 30,00000 fps
4K HDTV 3840x2160x25 (AR 1,778) 3840 2160 25,00000 fps
4K HDTV 3840x2160x24 (AR 1,778) 3840 2160 24,00000 fps

2K DCP Standard
2K Full Container 2048x1080x30 (AR 1,896) 2048 1080 30,00000 fps
2K Full Container 2048x1080x25 (AR 1,896) 2048 1080 25,00000 fps
2K Full Container 2048x1080x24 (AR 1,896) 2048 1080 24,00000 fps
2K Scope 2048x858x30 (AR 2,387) 2048 858 30,00000 fps
2K Scope 2048x858x25 (AR 2,387) 2048 858 25,00000 fps
2K Scope 2048x858x24 (AR 2,387) 2048 858 24,00000 fps
2K Flat 1998x1080x30 (AR 1,85) 1998 1080 30,00000 fps
2K Flat 1998x1080x25 (AR 1,85) 1998 1080 25,00000 fps
2K Flat 1998x1080x24 (AR 1,85) 1998 1080 24,00000 fps
2K HDTV 1920x1080x30 (AR 1,778) 1920 1080 30,00000 fps
2K HDTV 1920x1080x25 (AR 1,778) 1920 1080 25,00000 fps
2K HDTV 1920x1080x24 (AR 1,778) 1920 1080 24,00000 fps

2K DCP Double Framerate
2K HS Full Container 2048x1080x60 (AR 1,896) 2048 1080 60,00000 fps
2K HS Full Container 2048x1080x50 (AR 1,896) 2048 1080 50,00000 fps
2K HS Full Container 2048x1080x48 (AR 1,896) 2048 1080 48,00000 fps
2K HS Scope 2048x858x60 (AR 2,387) 2048 858 60,00000 fps
2K HS Scope 2048x858x50 (AR 2,387) 2048 858 50,00000 fps
2K HS Scope 2048x858x48 (AR 2,387) 2048 858 48,00000 fps
2K HS Flat 1998x1080x60 (AR 1,85) 1998 1080 60,00000 fps
2K HS Flat 1998x1080x50 (AR 1,85) 1998 1080 50,00000 fps
2K HS Flat 1998x1080x48 (AR 1,85) 1998 1080 48,00000 fps
2K HS HDTV 1920x1080x60 (AR 1,778) 1920 1080 60,00000 fps
2K HS HDTV 1920x1080x50 (AR 1,778) 1920 1080 50,00000 fps
2K HS HDTV 1920x1080x48 (AR 1,778) 1920 1080 48,00000 fps

2K DCP Stereoscopic (3D)
2K 3D Full Container 2048x1080x48 (AR 1,896) 2048 1080 48,00000 fps
2K 3D Full Container 2048x1080x24 (AR 1,896) 2048 1080 24,00000 fps
2K 3D Scope 2048x858x48 (AR 2,387) 2048 858 48,00000 fps
2K 3D Scope 2048x858x24 (AR 2,387) 2048 858 24,00000 fps
2K 3D Flat 1998x1080x48 (AR 1,85) 1998 1080 48,00000 fps
2K 3D Flat 1998x1080x24 (AR 1,85) 1998 1080 24,00000 fps
2K 3D HDTV 1920x1080x48 (AR 1,778) 1920 1080 48,00000 fps
2K 3D HDTV 1920x1080x24 (AR 1,778) 1920 1080 24,00000 fps


Video
JPEG2000 4:4:4 XYZ @12bpp
125 - 250 Mbits/s
until 2006 MPEG-2 was allowed too

Audio
max.16CH
LPCM 24bit @ 48.000 kHz
LPCM 24bit @ 96.000 kHz

anton_foy
6th November 2023, 09:13
Sorry if this is off-topic but FranceBB you mention DCP-O-matic as player but it can also convert to DCP so what are the benifits with using Avisynth+OpenDCP?

FranceBB
6th November 2023, 10:48
Sorry if this is off-topic but FranceBB you mention DCP-O-matic as player but it can also convert to DCP so what are the benifits with using Avisynth+OpenDCP?

The benefit of doing it the "good old way" are the same as the ones of any other frameserver + encoder vs all-in-one solution: total control over what's going on.

Doing it in Avisynth + OpenJPEG allows you to have total control over how the files are indexed, how they're cropped, how the resizing is done, with what kernel, how the LUT is applied, with which kind of interpolation (trilinear? tetrahedral?), which kind of dithering is used, how to perform the frame rate conversion and so on and so forth.
In other words, with Avisynth + OpenJPEG (from OpenDCP) you have total control over what's going on, while with DCP O Matic it's a "one click fits all" approach, so you gotta trust what it does under the hood without having any control over it, which is why I would only recommend it to be used as a player rather than as an encoder.

anton_foy
6th November 2023, 14:47
The benefit of doing it the "good old way" are the same as the ones of any other frameserver + encoder vs all-in-one solution: total control over what's going on.

Doing it in Avisynth + OpenJPEG allows you to have total control over how the files are indexed, how they're cropped, how the resizing is done, with what kernel, how the LUT is applied, with which kind of interpolation (trilinear? tetrahedral?), which kind of dithering is used, how to perform the frame rate conversion and so on and so forth.
In other words, with Avisynth + OpenJPEG (from OpenDCP) you have total control over what's going on, while with DCP O Matic it's a "one click fits all" approach, so you gotta trust what it does under the hood without having any control over it, which is why I would only recommend it to be used as a player rather than as an encoder.

Ok yes this I understand, but I mean if the file (prores or dnxhr hqx 12-bit for example) is done right just before the DCP conversion process, then is there more benifits by using avs+openDCP? And by the way the other resolutions posted by Emulgator than flat and scope are they not supported by all Digital Cinemas? Sorry again for off topic :o

Edit: because you mentioned the cropping/resizing etc. in avisynth I guess it is not too off topic :)

FranceBB
6th November 2023, 17:22
if the file (prores or dnxhr hqx 12-bit for example) is done right just before the DCP conversion process, then is there more benifits by using avs+openDCP?

It depends.
If by "done right" you mean that it's already in DCI P3 D63 γ 2.6, then I guess you can just trust the DCP O Matic conversion to XYZ and encoding in MJPEG2000.
I would still do it in Avisynth, but that's just me being me.
The thing, though, is that it's very rare to have a masterfile delivered in DCI P3 D63 γ 2.6, generally you have graded masters in BT709 SDR or BT2020 SDR or BT2020 HLG or BT2020 PQ, so I would never allow something like DCP O Matic (or any other software) to do it for me.
To this day I generally get the overwhelming majority of contents in YUV 4:4:4 10bit (sometimes 12bit) BT709 SDR 100 nit and I convert them myself to DCI P3 D63 γ 2.6 48nit XYZ 4:4:4.



And by the way the other resolutions posted by Emulgator than flat and scope are they not supported by all Digital Cinemas?


They might or might not support them, correct.
In theory, it's 2023, so I would expect them to support all those variants, however that's not guaranteed.
One of the very first things to do is always talk with the cinemas you gotta send your file to and they'll provide a bunch of specifications.
If it's mass distribution, however, please make sure to make different versions out of the same master.
For instance, to this very day, I still make both the 4K and the 2K versions just to be 100% safe.
On the other hand, all cinemas I sent files to always kept the 2K version as backup and always displayed the 4K version as they were all in 4K.




because you mentioned the cropping/resizing etc. in avisynth I guess it is not too off topic :)

Yep, I would always crop and resize in Avisynth 'cause I can choose the resizing kernel and have perfect control. For instance, if I have to downscale a 4K to 2K, I would use SinPowResizeMT() which is based on the sin squared kernel which again avoids under/over shootings and tries to be gibbs ringing free.
If I were to do it in any other software, only God knows which kind of resizing kernel would be used!

tormento
6th November 2023, 19:17
*sticky post*

anton_foy
7th November 2023, 00:02
It depends.
If by "done right" you mean that it's already in DCI P3 D63 γ 2.6, then I guess you can just trust the DCP O Matic conversion to XYZ and encoding in MJPEG2000.
I would still do it in Avisynth, but that's just me being me.
The thing, though, is that it's very rare to have a masterfile delivered in DCI P3 D63 γ 2.6, generally you have graded masters in BT709 SDR or BT2020 SDR or BT2020 HLG or BT2020 PQ, so I would never allow something like DCP O Matic (or any other software) to do it for me.
To this day I generally get the overwhelming majority of contents in YUV 4:4:4 10bit (sometimes 12bit) BT709 SDR 100 nit and I convert them myself to DCI P3 D63 γ 2.6 48nit XYZ 4:4:4.




They might or might not support them, correct.
In theory, it's 2023, so I would expect them to support all those variants, however that's not guaranteed.
One of the very first things to do is always talk with the cinemas you gotta send your file to and they'll provide a bunch of specifications.
If it's mass distribution, however, please make sure to make different versions out of the same master.
For instance, to this very day, I still make both the 4K and the 2K versions just to be 100% safe.
On the other hand, all cinemas I sent files to always kept the 2K version as backup and always displayed the 4K version as they were all in 4K.





Yep, I would always crop and resize in Avisynth 'cause I can choose the resizing kernel and have perfect control. For instance, if I have to downscale a 4K to 2K, I would use SinPowResizeMT() which is based on the sin squared kernel which again avoids under/over shootings and tries to be gibbs ringing free.
If I were to do it in any other software, only God knows which kind of resizing kernel would be used!

Bomb of info thank you! I learn so much, before I just relied on Davinci Resolve's EasyDCP and it worked in a hurry to deliver and proper too. But now that I want to make it myself and I have no access to that company's easyDCP license anymore I need to go through the open source route. Surely then I will follow your advice and recommendation to have complete control during the process (I always like to do so). Again thanks FranceBB!

FranceBB
7th November 2023, 23:32
I need to go through the open source route.

That's the purest route you can take ehehehehehe



Surely then I will follow your advice and recommendation to have complete control during the process (I always like to do so). Again thanks FranceBB!

No problem, I'm happy to help. :)

Oh and by the way, guess what I'm encoding right now? :P

https://i.imgur.com/lJK1rgN.png


Remember when I said that they haven't asked me a 2K DCP in a long time as they only used them as safe backup?
Well, they just asked me to prepare a 2K one to be used as main 'cause a cinema in Rome is still in 2K...
It breaks my heart 'cause our masterfile for this documentary was UHD 50p (but BT709)... :(

AVS Script:


#Indexing
video=LWLibavVideoSource("E4L.mov")
audio=LWLibavAudioSource("E4L.mov", stream_index=1)
AudioDub(video, audio)

#Bring everything to 16bit planar
ConvertBits(16)

#Crop to (3840 x 2076) 1.85 LB
Crop(0, 42, -0, -42)

#Downscale to Flat (1998 × 1080) 1.85 LB
SinPowResizeMT(1998, 1080)

#Hardsub
AssRender("E4L_Foreign_Dialogues.ass")

#Bring everything to RGB
ConvertToPlanarRGB()

#Decimate to 25p
ChangeFPS(25, linear=false)

#Upmix from stereo to 5.1
UpSoundOnSound()


TIFF creation

ffmpeg.exe -hide_banner -i "AVS Script.avs" -an -r 25 -pix_fmt rgb48 -vcodec tiff -y "W:\00_INGEST_MAM\E4L\tiff\%%06d.tiff"


We've got 74625 tiff lossless RGB48 for a 49 minutes documentary using a total of 897 GB on the RAID6 I'm using.

https://i.imgur.com/ksJUhJp.png

and that was black which is easy to encode, when there are real pictures they're even 12 MB per frame eheheheh


General
Complete name : W:\00_INGEST_MAM\E4L\tiff\005524.tiff
Format : TIFF
File size : 12.2 MiB

Image
Format : PackBits
Format settings : Little
Width : 1 998 pixels
Height : 1 080 pixels
Color space : RGB
Bit depth : 16 bits
Compression mode : Lossless
Density : 72 dpi

https://i.imgur.com/X6mQ070.png

Encoding to JPEG2000 and conversion to DCI P3 2.6 48nit XYZ


opendcp_j2k.exe -i "W:\00_INGEST_MAM\E4L\tiff" -o "W:\00_INGEST_MAM\E4L\j2k" -r 25 -b 125M -p cinema2k -t 112



I ran a massive encode with 112 threads on a massive Intel Xeon server CPU (Intel I still love you, don't worry) and seeing them all at 100% sort of warmed my heart... (along with probably the server room while using an atrocious amount of watts LMAO).


https://i.imgur.com/Cm0p5JY.png


General
Complete name : W:\00_INGEST_MAM\E4L\j2k\022061.j2c
Format : JPEG 2000
File size : 610 KB

Video
Format : JPEG 2000
Format profile : D-Cinema 2k
Width : 1 998 pixels
Height : 1 080 pixels
Display aspect ratio : 1.85:1
Color space : XYZ
Chroma subsampling : 4:4:4
Bit depth : 12 bits
Stream size : 610 KB (100%)



Appending and muxing the video in .mxf


"opendcp_mxf.exe" -i "W:\00_INGEST_MAM\E4L\j2k" -o "W:\00_INGEST_MAM\E4L\Video\Video.mxf" -r 25




General
Complete name : W:\00_INGEST_MAM\E4L\Video\Video.mxf
Format : MXF
Format version : 1.2
Format profile : OP-Atom
Format settings : Closed / Complete
File size : 41.6 GiB
Duration : 49 min 45 s
Overall bit rate : 120 Mb/s
Frame rate : 25.000 FPS
Package name : AS-DCP Material Package / File Package: SMPTE 429-4 frame wrapping of JPEG 2000 codestreams

Video
ID : 2
Format : JPEG 2000
Format profile : D-Cinema 2k
Format settings, wrapping mode : Frame
Codec ID : 0D010301020C0100-0401020203010103
Duration : 49 min 45 s
Bit rate : 120 Mb/s
Width : 1 998 pixels
Height : 1 080 pixels
Display aspect ratio : 1.85:1
Frame rate : 25.000 FPS
Color space : XYZ
Chroma subsampling : 4:4:4
Bit depth : 12 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 2.217
Stream size : 41.6 GiB (100%)
Title : Picture Track
Color range : Full

Other #1
ID : 1-Material
Type : Time code
Format : MXF TC
Frame rate : 25.000 FPS
Time code of first frame : 00:00:00:00
Time code of last frame : 00:49:44:24
Time code settings : Material Package
Time code, stripped : Yes
Title : Timecode Track



As to the audio, first we've got the individual upmixed discrete channels (kudos to Ferenc Pinter for bringing back the audio cache in Avisynth 3.7.3 so that I could use my beloved upmix functions) saved as individual wav:

"ffmpeg.exe" -hide_banner -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.0:0.0.0 -acodec pcm_s24le -ar 48000 -y "W:\00_INGEST_MAM\E4L\audiosplit\01.left.wav"
"ffmpeg.exe" -hide_banner -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.1:0.0.0 -acodec pcm_s24le -ar 48000 -y "W:\00_INGEST_MAM\E4L\audiosplit\02.right.wav"
"ffmpeg.exe" -hide_banner -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.2:0.0.0 -acodec pcm_s24le -ar 48000 -y "W:\00_INGEST_MAM\E4L\audiosplit\03.center.wav"
"ffmpeg.exe" -hide_banner -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.3:0.0.0 -acodec pcm_s24le -ar 48000 -y "W:\00_INGEST_MAM\E4L\audiosplit\04.lfe.wav"
"ffmpeg.exe" -hide_banner -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.4:0.0.0 -acodec pcm_s24le -ar 48000 -y "W:\00_INGEST_MAM\E4L\audiosplit\05.leftsur.wav"
"ffmpeg.exe" -hide_banner -i "AVS Script.avs" -map 0:a:0 -map_channel 0.1.5:0.0.0 -acodec pcm_s24le -ar 48000 -y "W:\00_INGEST_MAM\E4L\audiosplit\06.rightsur.wav"

and then interleaved and muxed in mxf

opendcp_mxf.exe -i "W:\00_INGEST_MAM\E4L\audiosplit" -o "W:\00_INGEST_MAM\E4L\Audio\Audio.mxf" -r 25

General
Complete name : W:\00_INGEST_MAM\E4L\Audio\Audio.mxf
Format : MXF
Format version : 1.2
Format profile : OP-Atom
Format settings : Closed / Complete
File size : 2.40 GiB
Duration : 49 min 45 s
Overall bit rate : 6 916 kb/s
Package name : AS-DCP Material Package / File Package: SMPTE 382M frame wrapping of wave audio

Audio
ID : 2
Format : PCM
Format settings : Little
Format settings, wrapping mode : Frame (BWF)
Codec ID : 0D01030102060100
Duration : 49 min 45 s
Bit rate mode : Constant
Bit rate : 6 912 kb/s
Channel(s) : 6 channels
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 2.40 GiB (100%)
Title : Sound Track
Locked : No

Other #1
ID : 1-Material
Type : Time code
Format : MXF TC
Frame rate : 25.000 FPS
Time code of first frame : 00:00:00:00
Time code of last frame : 00:49:44:24
Time code settings : Material Package
Time code, stripped : Yes
Title : Timecode Track



I'm now creating the final DCP before going to bed but I can't show you 'cause I would give away the name of the documentary I'm working on and it hasn't clearly been to the theatres yet, so... it's a secret :P

Tomorrow I'll check with DCP O Matic to see how it plays and whether everything is fine or not (I really hope it is).


Good night!! :)

Atlantis
9th November 2023, 01:13
What is Digital Cinema Package?!!!

FranceBB
9th November 2023, 09:54
What is Digital Cinema Package?!!!

Have you ever been to a cinema to watch a movie?
Well, then you've watched a DCP (Digital Cinema Package).
Essentially it's nothing less than a folder with video and audio, a CPL that is like a playlist and tells the player what to play and from what point to what point and an Asset Map which is basically a map of all the files inside that folder.

The video file is encoded in MJPEG2000 4:4:4 12bit XYZ in DCI P3 gamma 2.6 48nit and the audio is encoded in PCM 24bit 48000Hz (or 96000Hz) stereo or 5.1 or 7.1 etc.

The container is mxf.
Above I basically explained how to encode it and create such a folder (i.e the DCP) when you gotta deliver a movie or a documentary to a cinema. :)

Atlantis
9th November 2023, 14:57
:thanks:

Interesting. They should just give one mkv file and be done with it! :p But seriously why they make it that complicated?!

Emulgator
9th November 2023, 15:35
End of 2002 .mkv came up: LGPL, royalty-free, no exclusivity, no money to be made.
.mkv is open, .mkv is not American where the decision boards of the film industry rule.
(Well, the now-DCP-mandatory JPEG2000 was not the first muxable thing available back then,
but even DCP started out with guess what on board: MPEG-2)

2005 DCP Interop, starting with MPEG-2(!), then 2009 DCP SMPTE.
Talk potential chains into something as closed, as hidden, as complicated, as proprietary, as encumbered as possible:
There waits the margin to be paid by the users.

anton_foy
15th December 2023, 00:50
OpenDCP aint working correctly here. After making TIFF's I try to use OpenDCP to make the JPEG2000 files but I get:

opendcp_j2k.exe -i "C:\Users\erabo\Videos\ring_dcp\ring_tiff" -o "C:\Users\erabo\Videos\ring_dcp\ring_jp2\" -r 25 -b 250M -p cinema4k -t 1
opendcp_j2k.exe : The term 'opendcp_j2k.exe' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ opendcp_j2k.exe -i "C:\Users\erabo\Videos\ring_dcp\ring_tiff" -o "C:\ ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (opendcp_j2k.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

If I go to the OpenDCP folder in program files I get:

PS C:\Program Files\OpenDCP\bin> .\opendcp_j2k.exe -i "C:\Users\erabo\Videos\ring_dcp\ring_tiff" -o "C:\Users\erabo\Videos\ring_dcp\ring_jp2" -r 25 -b 250M -p cinema4k -t 1

OpenDCP J2K 0.30.0 (c) 2010-2014 Terrence Meiczinger. All rights reserved.
Encoder: OpenJPEG

Note that I need to put .\opendcp_j2k.exe in order for it to run (and be in the OpenDCP\bin -folder).

Okay this is a bit of a hassle yet its working but what is not good is that the jpeg2000 files get dark as muck. Unusable. The tiffs are correct though.

Correction "tiff\%%06d.tiff" should be "tiff\%06d.tiff" in your first post :)

Emulgator
15th December 2023, 13:16
but what is not good is that the jpeg2000 files get dark as muck. Unusable.
You are aware that their colorspace is XYZ, are you ?
If somebody's decoding app assumes different (601, 709), then one may get the wrong impression.

anton_foy
15th December 2023, 14:34
You are aware that their colorspace is XYZ, are you ?
If somebody's decoding app assumes different (601, 709), then one may get the wrong impression.

Yes but since I open it in Resolve it can handle it in XYZ and even the scope shows there is no info in the shadows no longer compared to the original.

FranceBB
15th December 2023, 19:56
Are the TIFF you created BT709 RGB full range originally before the conversion?

anton_foy
16th December 2023, 00:07
Are the TIFF you created BT709 RGB full range originally before the conversion?

I will check if full range but I think so. The TIFF's are identical to the graded original 444 dnxhr 12bit mxf.