Using FFMPEG to convert DCPs to other formats ?

Using FFMPEG to convert DCPs to other formats ?

Ffmpeg can read the MXF files used in DCPs and automatically apply a XYZ-RGB color transform when converting them.

This could be useful if a movie is only in the DCP format and you need to convert it and screen it on an ordinary projector and you have no time to get a replacement, use resolve or easydcp player.

Or you have no other way to check sync or 5.1 sound on a DCP.

You will also get an idea of the picture quality.

Note: the resulting video from FFMPEG will have crushed blacks. This is because it is difficult to do the color conversion from XYZ-RGB because a DCP is in a display referred color space called (DCDCM) X’Y’Z’ that is meant to be watched in a digital cinema projector enviroment. So you can’t use the same color transform that you would use to convert between TV/Monitor standards.

for more details on RGB-DCDM X`Y`Z`conversions see this post

Some FFMPEG tests I did:
With FFMPEG you can convert a DCP to a Prores file.
You can also convert to a TS file that you can play on a PS3.

You can even watch a low res version in real-time.

Links:

Belle Nuit: Use ffmpeg for dcp playback

Open Source DCP Player Proof of Concept

I tried to play a DCP with the newest build of FFMPEG for windows using this command in cmd.exe:

c:\downloads\ffmpeg\bin\ffmpeg -lowres 2 -i 1_j2c.mxf -i 2_pcm.mxf -c:a copy -c:v mpeg2video -f avi - | c:\downloads\ffmpeg\bin\ffplay -

I used proxy option 2 (0 is full quality) and full quality audio.
I tried it on a 25 FPS DCP and it played in realtime in low quality.

To get a better look at the DCP you can convert the DCP to other formats:

Converting a DCP to Prores 422 HQ Quicktime with FFMPEG

c:\downloads\ffmpeg\bin\ffmpeg -i 2_j2c.mxf -i 2_pcm.mxf -c:a copy -c:v prores -profile:v 3 -pix_fmt yuv422p10le -vf scale=min(1920\,a*1080):min(1080\,1920/a),pad=1920:1080:(ow-iw)/2:(oh-ih)/2 test4.mov

I copied the audio from the DCP: -c:a copy

I used Prores 422 hq: -profile:v 3.

You can also use:
Prores 422 LT = -profile:v 1
Prores 422 Proxy = -profile:v 0

I reversed the scaling/padding from here so 2048×858 and 1998×1080 will be scaled and padded to 1920×1080

FFMPEG prores files plays fine in VLC, but not in quicktime player. DNXHD is an alternative.

To play the DCP on a PS3 with 5.1 dolby digital sound you can convert it to a TS video file with this command:

c:\downloads\ffmpeg\bin\ffmpeg -i 3_j2c.mxf -i 3_pcm.mxf -c:a ac3 -ab 448k -c:v libx264 -preset slow -tune film -b:v 20M -pix_fmt yuv420p -vf scale=min(1920\,a*1080):min(1080\,1920/a),pad=1920:1080:(ow-iw)/2:(oh-ih)/2 test7.ts

It played fine on the PS3 with Dolby digital 5.1 sound. I used h264 compression with 20 mbit bitrate, -b:v 20M.

Notes:

The converted files are a bit dark (crushed blacks).

Update: I tested the prores conversion again in 2014. See comments.
The prores is in 10 bit.
A test image with grey patches with original values around 11,11,11 in 8 bit did not get converted to 8 bit values in the prores. But the patches in the prores was off from 11,11,11, one patch had values 10,6,10.

Some DCP conversion software raises the blacks a lot.

DCPs with offsets on the MXF files can be out of sync.

DCPs with soft subtitles will not keep their subtitles.

To watch DCPs in better quality (10 bit) with offsets and subtitles use Fraunhofer Easydcp Player. It can also convert DCPs to quicktime files or 16 bit TIFF with better image quality and subtitles.

You could try to find the offset in the CPL XML file and cut away the frames from the start of the video/audio in a video editor and convert the subtitles to srt in Subtitle edit and load them in VLC.

6 Replies to “Using FFMPEG to convert DCPs to other formats ?”

  1. Hello Knut,

    have you checked the color levels? I made a test month ago and the only way to get correct colors was using the mainconcept direct show filter that comes with Squeeze 8 (free version, that comes with Avid Media Composer)

    regards
    Udo

  2. Just wanted to say thank you for your post. I was able to quality check a DCP, where other players were proprietary. I’m a bit beside myself with how far FFMPEG has come. Amazing development team in my opinion.

  3. Dear Knut,

    I have the impression the blacks are correct if you export h264. Though 8bit, I get acceptavle results using crf 15.

    As for Prores, the colorspace flag is not correctly set. It can help just to import the file into FCP 7, drag it to a new sequence and reexport it as FCP movie. You then get the same levels displayed in QT player than h264.

    How can you verify if a Prores file is 10bit or 8bit? I have written the xyz2rgb filter to handle 12bit and the Prores in ffmpeg should be 10bit, but I do not know how to check it.

    Matthias

  4. Hey everyone,

    i was so happy with this tutorial on how to convert an DCP to a mov file that i have build an mac app which do the same thing with ffmpeg but without knowlidge of ffmpeg. The app converts the two mxf files to a prores mov file. As a special feature it can play the movie instantly.

    If anybody is interested, please contact me.

    greetings
    Stephan

Leave a Reply

Your email address will not be published. Required fields are marked *