I have managed it. Here's how:
DIGITAL CINEMA PACKAGE - HOW I, A COMPUTER NEOPHYTE, MADE AN OPEN SOURCE DCP ON MY MAC.
Intro:
Firstly, I would like to thank Chris Perry at bitfilms. What I will describe below is a mac version of his linux workflow and of what is written was by him.
http://bitfilms.blogspot.com/
Secondly, I would like to thank, amongst many, Fabien Illide, Terrence Meiczinger, Agustin Goya,John Hurst at Cinecert and Wolfgang Woehl
http://wiki.github.com/wolfgangw/digitalcinematools/
Thirdly, all those that contributed to the Digital Cinema Package thread, in particular Leerafel
http://www.reduser.net/forum/showthread.php?t=33118
I suggest you read all of the above sites info before starting.
Without their work and the work of many others (plus some cash from the European Union), none of this would be possible. Many thanks
This document is not a manual, but more a 'how a managed it'. It is a starting point and I hope that my peers who are far more qualified than myself can contribute to a more definitive version.
DISCLAIMER: I CANNOT BE HELD RESPONSIBLE FOR THE ACTIONS DESCRIBED BELOW . ALSO, I AM NOT A UNIX PRO, SO I WILL NOT BE ABLE TO TELL YOU WHY IT IS NOT WORKING FOR YOU. I AM A FILM EDITOR.
Preamble:
1. What I describe below is how I did it. This is not necessarily how it should be done. You must be prepared to work your own version as I am sure that it will not work for you first time round.
2. You should read what is written on Chris Perry's blog
http://bitfilms.blogspot.com/
and also all the elements at
http://wiki.github.com/wolfgangw/digitalcinematools/
YOU MUST HAVE A BASIC UNDERSTANDING OF MAC TERMINAL COMMANDS AND APPRECIATE HOW THE TERMINAL WORKS. There are loads of web pages explaining basic unix commands. It took me a few days and alot of hasseling others to understand how to use the basic commands needed for this tutorial.
Basic commands needed for this tutorial are:
sudo su
cd
cd ..
ls
./
*
make
DO NOT CONTINUE UNTIL YOU HAVE MASTERED THESE SIMPLE COMMANDS.
The work on this tutorial was done on a macintel 2.66ghz OS 10.5.8. This tutorial will probably not work on a PowerPC and may not on 10.6 or 10.4. You can always try, though. TRYING IS THE ESSENCE OF THIS TUTORIAL.
Before you start:
To help you in this endeavour, I suggest that:
1. You have mastered the very basic unix commands. Check out;
http://www.ee.surrey.ac.uk/Teaching/Unix/
2. You have a very large, empty hard drive (for a 30min film I used up 1 terrabyte of HD with all the file that are created.)
3. Loads of time and patience.
4. A very clean OS. I suggest you install a virgin OS on your dedicated DCP work disk. An old OS full of dodgy apps off the web may not help.
5. Your film must be finished and that you have a 5.1 mix (You can do this with stereo elements but you will probably end up having to duplicate the stereo tracks into the 6 tracks needed for a standard cinema theatre).
6. You must have Xcode installed. It can be found either on your OS DVD install or at
http://developer.apple.com/technologies/xcode.html
You must install the version that corresponds to your OS.
7. I suggest that you install a free utility called ONYX
http://www.titanium.free.fr/
if you wish to see all the hidden files that you will be manipulating.
8. Make friends with your local projectionist who has a digital projector and a server. I have found that projectionists are very curious about all this and so very approachable.
9. Macports: some much more talented persons than myself, were able to short curcuit some ofthe installation procedures described below using macport. Macport is well documented on the web and the Porticus application
http://porticus.alittledrop.com/
is simple to use and open you up to loads of opensource apps that are very interesting. That said, I never managed to get any of the apps described below to install properly, hence this document.
10. Be aware that a DCP is based on ISO standards, therefore the rules are very strict concerning how it is formatted. Be prepared to spend loads of time getting your film up to these standards.
How to create a Dolby 5.1 from a stereo file.
If you do not have the time or money to mix in Dolby 5.1, you can use Apple Compressor and Final Cut Pro to automatically spatialize a stereo file into a Dolby 5.1 space.
1. Read the Compressor manual concerning, particularly the Quicktime Surround 5.1 and Dolby Digital Professional 5.1 settings.
You have the choice of between export a QT with 6 channels but with no spatialation, or export an ac3 file using Dolby Digital Professional 5.1 setting. The Dolby Digital Professional 5.1 setting allows a simple spatialization but this must be experimented.
2. If the QT is used, you can import the QT into a Final Cut Pro - Dolby 5.1 sequence.
If the AC3 method is used, you need to reconvert the ac3 file to 6 wave files (see below).
-----------------------
The film I am working on is a PRORES 1980x1080 4:4:4 10 bit QT file from Final Cut Pro.
FOR A STANDARD DCP, THE FILM MUST BE IN 24fps. You will probably have to pitch the sound to get the right frame rate if you are not in 24fps. Some server might hande 25fps, but this is unclear.
The audio is a 5.1 24bit 48khz Protools mix in 6 seperate mono wave tracks.
The audio and video must be exactly the same length.
STEP 0. Prepping your QT for 24fps
First thing to know is that a 24fps DCP is 24fps, not 23.98 or anything else. I am in 25fps world, so I used Apple's Cinema Tools to conver the file video to 24fps.
The DCP 24fps Dolby 5.1 version of the film was mixed in protools with a low res version of the 24 QT file, applying a 4.1% pitch change. Naturally, this means that your film runs longer.
A list of pitch percentages for protools is available in their manual.
Otherwise, you can recut you film in a 24fps ...
Also you can read the Leerafel explaination that uses Adobe Premier.
http://www.reduser.net/forum/showthread.php?t=33118
Preparing film into reels
Each reel is a seperate DCP, therefore they must be prepared before starting the process below.
Preparation of Sound files:
Dolby 5.1 24bit 48khz with 6 seperate mono wave tracks. (2.0 and 7.1 are possible)
Ref at 1khz: -20dbfs
Speed: 24fps
If reels are made, each reel must have 6 assoociated tracks
Wave files are named:
Reel Number + track L / R / C / Lfe / Ls or Rs
Each track must start with a 1khz beep with coresponding image at 48 frames before start of programme.
The audio and video must be exactly the same length.
CHECK THE NUMBER OF FRAMES THAT THE QT MASTER HAS. A FRAME COUNTER CAN BE FOUND BY CLICKING ON THE TIMECODE DISPLAY IN THE PLAYER.
STEP 1. export PNGs from source QuickTime movie
Use Quicktime Pro to export a PNG image sequence, in Millions of Colours, non-interlaced to a dedicate folder on your new HD.
I suggest that you keep your file QT file name very short.
TEST EVERY STAGE OF THIS TUTORIAL ON A FEW SECS OF IMAGES BEFORE DOING THE FILM.
Step 2: convert to 12 bit per channel XYZ color images
DCPs do not have a RGB colourspace. They use an XYZ colour space. To convert your png files to the new colour space you need ImageMagick
You can download the latest version of ImageMagick
http://www.imagemagick.org/script/download.php?ImageMagick=7j7ci2rtpr0prq7qiiuci u1og0
The installation procedure is described clearly at
http://www.imagemagick.org/script/install-source.php#unix
Chris Perry writes "This takes a 1920 x 1080 PNG from step 1, removes any alpha, pads the image with 64 pixels of black on each side so that it becomes 2048 x 1080, sets the bit depth to 12 bits per pixel, and does a linear-space color shift from RGB->XYZ. Then it writes the image out as a TIFF."
This app works on single images. I reworked the chris Perry command to make it repeat on all the elements in a folder. You will have to rework the command below for your own file paths (hence why you need to have an understanding of unix).
In the terminal, navigate to the folder that has your pngs. Then copy:
for image in *; do echo $image; convert $image -type TrueColor -alpha Off -background black -extent 2048x1080-64 -depth 12 -gamma 0.454545 -recolor "0.4124564 0.3575761 0.1804375 0.2126729 0.7151522 0.0721750 0.0193339 0.1191920 0.9503041" -gamma 2.6 <TIFF FOLDER NAVIGATION>$image.tif; done
When you open the tiff files, they will have a wierd colour. If you want to see them correctly, you need to install EASYDCP player.
http://www.dcinema.fraunhofer.de/en/veranstaltungen/ibc/player.jsp
Seemingly, you can also do this within After Effects. Details can be found at
http://groups.google.fr/group/openjpeg/browse_thread/thread/b195bbe7b784f39e
CHECK FILES BEFORE MOVING FORWARD.
Step 3: convert TIFFs to JPEG-2000
INSTALL VERSION - THE OFFICIAL VERSION THAT I NEVER MANAGED TO GET TO WORK - HELP PLEASE
To install OpenJPEG. (I was never able to get the SVN version of the app to install correctly but I will describe how to do it anyway. Maybe someone can correct the errors.)
THIS EXPLAINS HOW TO INSTALL LATEST BUILD OF OPENJPEG USING SVN - SUBVERSION.
GET AND INSTALLED OPENJPEG FOR MAC OSX INTEL
To get the latest version of the OpenJpeg
In the Terminal application type
sudo su
and enter your user password
then type
svn checkout
http://openjpeg.googlecode.com/svn/trunk openjpeg-read-only
At the end of a long list of events, the result is
Checked out ...
Go to the root of your user, using the cd command, type
ls
Hopefully you will find a folder called openjpeg-read-only
Then type
cd openjpeg-read-only
Then type
ls
A similar list to the one below should appear in the terminal
.svn Makefile doc
CMakeLists.txt Makefile.osx indexer_JPIP
ChangeLog OPJViewer jp3d
DllOpenJPEG.dsp OPJ_Validate jpwl
DllOpenJPEG.sln OpenJPEG.rc libopenjpeg
DllOpenJPEG.vcproj README.cmake libs
JavaOpenJPEG README.linux license.txt
LibOpenJPEG.dsp README.msvc mj2
LibOpenJPEG.dsw README.osx openjpeg.xcodeproj
LibOpenJPEG.sln clean.bat
LibOpenJPEG.vcproj codec
If so, you have downloaded the elements and checked that they exist
Installation
------------
If you have Xcode installed, you can double click on the file
openjpeg.xcodeproj
and in the window, click the BUILD button. This will compile the elements and place them in the right folder. (This did not work for me but it should)
If not, you can do it through the terminal.
Note: You will need to have root privileges in order to install the library in
/usr/include and /usr/lib directories.
The installation process is as simple as this :
1) Make sure that you are in the openjpeg directory which has the
make osx, make osxinstall and make osxclean files listed. See above
2) To build the distribution, type :
make osx
make osxinstall
3) Clean all files produced during the build process
make osxclean
------------------------
INSTALL VERSION B - This is not the right way but it worked for me.
Go to
http://code.google.com/p/openjpeg/downloads/list
and download the latest verion for mac. I used openjpeg
v1_3osx.zip
Find the image
toj2k file and copy it to the folder where your tifs are.
------------
To create JPEG 2000 files from the TIFFs
Copy the image
toj2k to the folder that holds all the tiff files.
Open the terminal. Go to TIFF file folder.
for image in *; do echo $image; ./image
toj2k -cinema2K 24 -i $image -o $image.j2c; mv $image.j2c <YOUR FOLDER PATH>; done
NOTE: THERE ARE MANY TYPES OF JPEG 2000 TYPE FILES. THE IMPLEMENTATION FOR CINEMA DCPs IS VERSION 3 or 4, WHICH DOES NOT SEEM TO BE THE SAME AS THE EXPORT VERSION YOU HAVE IN QT OF PREVIEW. BE AWARE. USE GOOGLE TO FIND OUT MORE.
Step 4: Create a DCP compatible MXF file
Download the latest stable version of asdcplib from
http://www.cinecert.com/asdcplib/
I used version 1.5.32
To compile and install:
To unpack the file:
tar xzvf asdcplib-1.5.32.tar.gz
Then to build:
cd asdcplib-1.5.32
./configure --with-expat
make
sudo make install
The last step will ask for your password.
The script below will have the PROJ.video.mxf file name. This can be changed but the name must end with .mxf
Navigate in the terminal to the same level as the folder that holds the j2c files. Then type:
asdcp-test -v -L -c PROJ.video.mxf <FOLDER NAME THAT HOLDS ALL THE j2c FILES>
A PROJ.video.mxf should be created at the same level as the folder that contains the j2c.
I have not found a way to test this file. Just check that the size is about the same as the j2c folder.
Now that you have all the j2c files, I suggest you create a script in Automator to rename the j2c files to a simple file sequence such as 0000001.j2c etc
Step 5: make all the necessary DCP files with opencinematools
Download opencinematools
http://code.google.com/p/opencinematools/
The official route that did NOT work for me:
Get the latest release (
http://www.cinecert.com/asdcplib/asdcplib-1.5.32.tar.gz) and install. Change 2 lines in opencinematools-1.1.2/build/macosx/build.tcsh:
* Change
$compileCmd -o ../../bin/mkpkl.o ../../src/mkpkl.cpp -I${PREFIX}/include
* to
$compileCmd -o ../../bin/mkpkl.o ../../src/mkpkl.cpp -I${PREFIX}/include -D
FILE_OFFSETBITS=64
* and
$compileCmd -o ../../bin/mkmap.o ../../src/mkmap.cpp -I${PREFIX}/include
* to
$compileCmd -o ../../bin/mkmap.o ../../src/mkmap.cpp -I${PREFIX}/include -D
FILE_OFFSETBITS=64
and rebuild the opencinematools binaries.
To install, open the terminal:
sudo su
chmod +x ./build/macosx/build.tcsh
then
./build/macosx/build.tcsh
--------------
Thanks to Terrence Meiczinger, he offers this working solution and also, thanks to Wolfgang Woehl for the install advise.
Duplicate the build.tcsh file, open it in textedit, delete the code in it and paste the code below. Rename the new file Makefile.
CC = g++
LIBS = -lm -lasdcp -lkumu -lcrypto
SRCS = ../../src/
BINS = ../../bin/
all : mkcpl mkpkl mkmap
mkcpl : $(SRCS)mkcpl.cpp
$(CC) -o $(BINS)mkcpl $(SRCS)mkcpl.cpp $(LIBS)
mkpkl : $(SRCS)mkpkl.cpp
$(CC) -o $(BINS)mkpkl $(SRCS)mkpkl.cpp $(LIBS) -D
FILE_OFFSETBITS=64
mkmap : $(SRCS)mkmap.cpp
$(CC) -o $(BINS)mkmap $(SRCS)mkmap.cpp $(LIBS) -D
FILE_OFFSETBITS=64
install :
install -v -p -s ../../bin/mkcpl /usr/bin
install -v -p -s ../../bin/mkpkl /usr/bin
install -v -p -s ../../bin/mkmap /usr/bin
In the terminal, navigate to Makefile you have created and type:
sudo su
then
make all
make install
then, in the finder use a utility like ONYX (see above) to reveal the hidden files. You will discover a whole new world but be VERY CAREFUL WHAT YOU DO! I had problems with the creation of the xmls described below, so I navigated /usr/bin/ and copy the files:
mkcpl
mkmap
mkpkl
to the folder where you will be creating the DCP elements.
VERY IMPORTANT NOTE
Naming conventions are very important for DCPs, so I highly recommend that you read about them yourself and make informed choices.
http://digitalcinemanamingconvention.com/
Preparation of Sound files:
Dolby 5.1 24bit 48khz with 6 seperate mono wave tracks. (2.0 and 7.1 are possible)
Ref at 1khz: -20dbfs
Speed: 24fps
If reels are made, each reel must have 6 assoociated tracks
Wave files are named:
Reel Number + track L / R / C / Lfe / Ls or Rs
Each track must start with a 1khz beep with coresponding image at 48 frames before start of programme.
The audio and video must be exactly the same length.
Multiple reels
If yo want to name them video.reel1.mxf sound.reel1.mxf video.reel2.mxf sound.reel2.mxf. write in this order in the .cpl and .pkl .map and the dcp will automatically pick them up in this order. You can check it's working by downloading easyDCP player.
Subitles
The DCP subtitle standard is TI CineCanvas, which is a specific XML standard.
Currently, Belle Nuit (www.belle-nuit.com) or MacCaption (www.cpcweb.com)
Below is a partial sample of a CineCanvas "subtitle script". (the subtitles are in Japanese). Courtesy of www.thedigitalcowboy.us
Subitile timecode is based on reel length.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--
* XML Subtitle File
*
-->
- <!--
* Created By CANVASs Co.,LTD.
*
-->
- <!--
* Wednesday, February, 18, 2004
*
-->
- <DCSubtitle Version="1.0">
<SubtitleID>B396FFBC-75CB-4738-AAB1-2BC7E10D9B94</SubtitleID>
<MovieTitle>Kamen Test</MovieTitle>
<ReelNumber>1AB</ReelNumber>
<Language>Japanese</Language>
<LoadFont Id="theFont" URI="Font/FANRG7BFCONV.TTF" />
-
- <Subtitle SpotNumber="1" TimeIn="01:00:42:125" TimeOut="01:00:43:177">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">??</Text>
</Subtitle>
- <Subtitle SpotNumber="2" TimeIn="01:00:46:219" TimeOut="01:00:47:167">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">??!</Text>
</Subtitle>
- <Subtitle SpotNumber="3" TimeIn="01:00:54:010" TimeOut="01:00:55:031">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">??</Text>
</Subtitle>
- <Subtitle SpotNumber="4" TimeIn="01:00:58:052" TimeOut="01:00:59:021">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">??!</Text>
</Subtitle>
- <Subtitle SpotNumber="5" TimeIn="01:01:05:010" TimeOut="01:01:05:219">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">???!</Text>
</Subtitle>
- <Subtitle SpotNumber="6" TimeIn="01:01:06:219" TimeOut="01:01:07:208">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">??!</Text>
</Subtitle>
- <Subtitle SpotNumber="7" TimeIn="01:01:09:010" TimeOut="01:01:10:156">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">??! ??!</Text>
</Subtitle>
- <Subtitle SpotNumber="8" TimeIn="01:01:11:052" TimeOut="01:01:12:219">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">???! ??!</Text>
</Subtitle>
- <Subtitle SpotNumber="9" TimeIn="01:01:13:125" TimeOut="01:01:14:135">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">(??)?? ??</Text>
</Subtitle>
- <Subtitle SpotNumber="10" TimeIn="01:01:17:115" TimeOut="01:01:18:115">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">???</Text>
</Subtitle>
- <Subtitle SpotNumber="11" TimeIn="01:01:20:073" TimeOut="01:01:21:083">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">??…</Text>
</Subtitle>
- <Subtitle SpotNumber="12" TimeIn="01:01:25:188" TimeOut="01:01:29:198">
<Text HAlign="center" HPosition="0.0" VAlign="bottom" VPosition="13.00">???? ????…</Text>
To create the DCP: (copy from the Chris Perry blog)
This step has five substeps, each of which generates one or more of the files needed for the DCP. Naming conventions are very important in DCP land, so I highly recommend that you read about them yourself and make informed choices. When you see DCPFULLNAME below, that's shorthand for what I used, which was the mouthful:
TOWER37FTR_F_EN-XX_US-XX_51_2K_ST_20100212OV
ICARESHR_C_FR-EN_FR-AA_51_2K_20100423OV
Command A (create a video MXF file from the folder of J2K files):
asdcp-test -v -L -c PROJ.video.mxf FOLDEROFJ2KS
Command B (create an audio MXF file from the six wavs):
asdcp-test -v -L -c PROJ.audio.mxf -l 5.1 left.wav -l 5.1 right.wav -l 5.1 center.wav -l 5.1 sub.wav -l 5.1 surrLeft.wav -l 5.1 surrRight.wav
Command C (create an XML composition playlist):
mkcpl --kind feature --title DCPFULLNAME --annotation DCPFULLNAME --norating PROJ.video.mxf PROJ.audio.mxf > PROJ.cpl.xml
Command D (create an XML packing list):
mkpkl --issuer DumDumFilms --annotation DCPFULLNAME PROJ.video.mxf PROJ.audio.mxf PROJ.cpl.xml > PROJ.pkl.xml
Command E (create the ASSETMAP and VOLINDEX XML files):
mkmap --issuer DumDumFilms PROJ.video.mxf PROJ.audio.mxf PROJ.cpl.xml PROJ.pkl.xml
I used a bit of shorthand above since I did not identify enclosing folders. I suggest that if you make a DCP this way, you use temporary folders for all the inputs (and the results of steps 1-3), then create a finalDCP folder which you populate with only the files that will be part of the eventual DCP itself (namely, the 2 mxfs and the 4 XML files that come from step 4).
Command D may take sometime to produce. Be patient.
You should end up with 6 files that look something like:
VOLINDEX.xml
PROJ.video.mxf
PROJ.pkl.xml
PROJ.cpl.xml
PROJ.audio.mxf
ASSETMAP.xml
Some quick notes:
* It is important that you check your XML files to make sure the file paths don't contain any incorrect information: if you aren't careful during step 4, your file paths in the XML may be incorrect! Here's what one of my entries looks like in my final ASSETMAP.xml file as an example: file:///tower37_complete3.video.mxf
* I don't know what happens if your audio and video durations are different, so I was careful to make sure mine were not. Check them in the CPL (the tag is ).
* Work with a small movie file for starters, a minute or less, until you get the steps ironed out. Then move to your full film.
CONGRATULATIONS:
YOU HAVE MADE A DCP ...
Check it first using EasyDCP then ...
Step 6 : Taking the files to the Projectionist.
DCP servers are often either based on Linux so it is best to format the disk that you will take to the projectionist in .ext3. If not, NTFS formatted disks should be read. Check with the projectionist beforehand. You can find opensource NTFS and ext3 solutions on the web.
http://macntfs-3g.blogspot.com/
http://www.paragon-software.com/home/ntfs-mac/
http://www.paragon-software.com/home/extfs-mac/