CLI for dcpomatic2

Anything and everything to do with DCP-o-matic.
wunderbarb
Posts: 2
Joined: Tue Nov 20, 2018 9:39 pm

CLI for dcpomatic2

Post by wunderbarb »

I am starting to experiment the CLIs. I will report on this topic my "discoveries" or supposed bugs. So you may expect a few posts.

My goal is to generate encrypted DCPs using a fixed image. Then generate the corresponding KDMs using the certificates of the servers. I tested the chain using the GUIs. No problem. Porting to CLI is not as obvious as expected.

Question 1: I did not find in the documentation of dcpomatic2_create and dcpomatic2_cli an option for generating an encrypted DCP. Is there such an option?

In order to overcome this issue, I expected to use a template. Thus, I created a template "BC_TDL" with the GUI that has the encrypted flag switched on.

The CLI: dcpomatic2_create -n Commit --template "BC_TDL" --container-ratio 119 --content-ratio 119 -s 30 -o test QR generates the following error: dcpomatic2_create: Programming error at ../src/lib/dcpomatic_time.h:208

The same CLI without the template works perfectly dcpomatic2_create -n Commit -c TST --container-ratio 119 --content-ratio 119 -s 30 -o test QR. But of course, the DCP would be in the clear

I am using V2.12.13 on Ubuntu 18.04

Thanks in advance
wunderbarb
Posts: 2
Joined: Tue Nov 20, 2018 9:39 pm

Re: CLI for dcpomatic2

Post by wunderbarb »

Following the experimentation, I created an encrypted DCP and registered a theater and screen with a certificate S_CLED_1.pem (It is the certificate of an actual device).

dcpomatic2_kdm_cli -c "S_CLED_1" -f now -d "2 weeks" -v QR1 works smoothly.

Now the command dcpomatic2_kdm_cli --certificate ~/go/src/TDL/ks/S_CLED_1.pem -f now -d "2 weeks" -v QR1 , i.e., replacing the registered "theater" by its certificate generates the crash
terminate called after throwing an instance of 'dcp::MiscError'
what(): unexpected data after certificate
Aborted (core dumped)


I tried with other valid certificates, same feedback.
PS: I used V2.13.72 on Ubuntu 18.04

Minor bugs:
  • in dcpomatic2_create option -t is not recognized, although --template is
  • In the help of dcpomatic2_kdm_cli, the example at the end should be updated to dcpomatic2_kdm_cli -c "Fred's Cinema" -f now -d "2 weeks" -z my_great_movie
carl
Site Admin
Posts: 2550
Joined: Thu Nov 14, 2013 2:53 pm

Re: CLI for dcpomatic2

Post by carl »

Thanks for those minor bugs; I've fixed them locally.

Can you send S_CLED_1.pem to carl@dcpomatic.com

?
carl
Site Admin
Posts: 2550
Joined: Thu Nov 14, 2013 2:53 pm

Re: CLI for dcpomatic2

Post by carl »

OK it's because S_CLED_1.pem contains a full chain, not an individual certificate. If you cut out just the last certificate in the file and give that to DCP-o-matic it should work.

Alternatively I just changed dcpomatic2_kdm_cli to accept a chain and use its leaf certificate, if you want to wait for that.
Jan Rogowski
Posts: 13
Joined: Tue Jan 15, 2019 1:52 pm

Re: CLI for dcpomatic2

Post by Jan Rogowski »

Hi wunderbarb,

I'm having the exact same issue as you were with trying to create a DOM project via dcpomatic2_create with templates. I've assumed as you did that this is the only way to implement encryption (and 3D) via the command line. The same issue each time...

Programming error at ../src/lib/dcpomatic_time.h:208

dcpomatic2_create --template TEMPLATE -o ..\my\dir\path --content-ratio 185 ..\my\j2c\path ..\my\wav\path

I can generate an encrypted dcp from the GUI but not via cli. Would you mind telling me how yo you got past this?

Thanks,
Jan.
carl
Site Admin
Posts: 2550
Joined: Thu Nov 14, 2013 2:53 pm

Re: CLI for dcpomatic2

Post by carl »

If you can send me the template file, which should be in a file somewhere like

c:\Users\your_user_name\AppData\Local\dcpomatic2\templates

I can investigate.

carl@dcpomatic.com
carl
Site Admin
Posts: 2550
Joined: Thu Nov 14, 2013 2:53 pm

Re: CLI for dcpomatic2

Post by carl »

OK, your bug has a simple fix, and I've added the option to make an encrypted film.

Specifying 3D is a little more complicated, depending on how you are passing your content; are you using separate files for each eye?
Jan Rogowski
Posts: 13
Joined: Tue Jan 15, 2019 1:52 pm

Re: CLI for dcpomatic2

Post by Jan Rogowski »

Brilliant! Thanks Carl.

Footage is left/right j2c image sequences
Jan Rogowski
Posts: 13
Joined: Tue Jan 15, 2019 1:52 pm

Re: CLI for dcpomatic2

Post by Jan Rogowski »

Sorry if this is repeated, I'm not sure if it posted and got stalled because I'm new to the forum.

Source footage is ideally jpeg2000, left/right image sequences. I'm trying to render dci compliant direct from Resolve and leverage DOM to encode encrypted DCP in one fell swoop.
carl
Site Admin
Posts: 2550
Joined: Thu Nov 14, 2013 2:53 pm

Re: CLI for dcpomatic2

Post by carl »

OK; I want to add support for that but it will need to be in the 2.13.x branch as it will be a bit of a big change. If you're happy to track the test versions I should be able to remove the need for the template.