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

makedip.py, bitc.py - add ffmpeg for DCP single reels #59

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hyz2993
Copy link
Member

@hyz2993 hyz2993 commented Aug 6, 2023

Still looking for ways for multi-reels.

Basic command line:
ffmpeg -i $mxf_1 -i $mxf_2 -c:a copy -c:v libx264 -pix_fmt yuv420p $output

Main difference:
DCP single reel includes two .mxf files as input. Current structure in makedip.py cannot recognise numbers of mxf in one directory. A change is made for it by sum([filename.count('.mxf') for filename in filenames]) == 2.
DCP proxies requires audio codec copying to the output instead of using aac codec, which is the general option in bitc.py. A change is made for it.

Also:
Split code for renaming proxy to a function in makedip.py.

I didn't figure out ffmpeg -map while it does stop audio codec copied to the output. So it's removed when running for DCPs.
using -map

Stream mapping:
  Stream #0:0 -> #0:0 (jpeg2000 (native) -> h264 (libx264))

-map removed

Stream mapping:
  Stream #0:0 -> #0:0 (jpeg2000 (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (copy)

@kieranjol
Copy link
Contributor

Have you looked into the dcp scripts for this, like dcpaccess and dcpfixity? Just focusing on the mxfs doesn’t work the best as it only accounts for simple cases. You have to use the xml files in a dcp as your entry point and that tells you which mxfs to use, which order, and dcps can also have in and out points too, where the audio or video for each reel may not start or end with the first or last frame of data. And you have to account for the colour space issues too with the xyz source which i never quite figured out but it’s why that 3d LUT is in the scripts folder.

@hyz2993
Copy link
Member Author

hyz2993 commented Aug 10, 2023

Thanks for the advice. It's true, while I think it's too complicated for checking too many sources just to make proxies for DCP. The command line provided from the document for making DCP proxies is ffmpeg -i $mxf_1 -i $mxf_2 -c:a copy -c:v libx264 -pix_fmt yuv420p $output, nothing about colour and start frame yet. I guess so far we can take this as an update, only if it won't make any error. And we will talk about the plan about a full service for DCP DIPs once we decide to work on that :).

@kieranjol
Copy link
Contributor

kieranjol commented Aug 11, 2023

You could also just update dcpaccess and if Args.dcp is used, it just calls dcpaccess. I spent so much time working on dcp scripts as you have to dig into the standard and test it against so many dcps as the standard has so much variety. Also if you use the xmls as your entry point, it will pretty much work for multi reel and single reel regardless.
Edit: dcpaccess was one of the very first scripts I wrote so it probably needs a lot of work, but there’s a lot in there to reuse as dcps are just so difficult.

@kieranjol
Copy link
Contributor

Actually, it’s worth looking into easy dcps command line functionality as well. As the easydcp player is one of the best tools to make access copies of dcps. Dcpomatic also handles this now but not sure if it allows command line calls for this. There could be a series of fallback options. If easydcp installed, do a, if dcp o matic, do b, if neither, do your command or dcpaccess

@hyz2993
Copy link
Member Author

hyz2993 commented Aug 11, 2023

They all sounds like very good advices! I should take a look at those scripts. Let me keep this pr on hold until I get something from Easy DCP and dcpaccess. Thanks!

@hyz2993 hyz2993 force-pushed the master branch 2 times, most recently from 7587e0e to 20767d1 Compare September 22, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants