in03 / proxima

Transcode source media directly from DaVinci Resolve using multiple machines for encoding. Great for creating proxies quickly.
MIT License
53 stars 3 forks source link

All timelines searched, unlinked proxies remain #178

Closed in03 closed 2 years ago

in03 commented 2 years ago

Recently found a bug where a file outside of the project directory wasn't linking, but wasn't failing. This resulted in all timelines being searched, but none with source media matching the proxy media. Of course that doesn't make sense, so there must be something wrong with the linking criteria not matching the output criteria?

Two issues:

in03 commented 2 years ago

Worth mentioning that there are two link methods:

Find and link iterates all timelines to find matches manually. There is some implementation overlap here, probably best to focus on one method.

in03 commented 2 years ago

Working on integrating the 'link with media pool item' method. By stringifying the media pool items we can roundtrip through Celery and retain a reference to the pointers client-side while the workers encode the jobs. Once they link, we use the stringified items to restore the original media pool items and link.

Still not sure why find and link isn't working. There must be something iffy going on with paths. For source media outside of the directory, it will exhaust all project timelines looking for a match, and for source media in directory it will consider a zero-length string a match to the source media path (probably wrong use of 'x in y' instead of 'x==y'). Unfortunately the behaviour is annoyingly inconsistent.

We may just have to remove it and bend the media_pool_item method to service any legacy/edge cases.

in03 commented 2 years ago

Alright this is confusing the heck out of me...

   141    for job in jobs:                                                                       
   142       for jobm in jobs_with_mpi:                                                        
   143          mpi_str = job["media_pool_item"]                                              
 ❱ 144           mpi_obj = jobm[mpi_str]                                                       
   145          job.update({"media_pool_item": mpi_obj})                                      
   146                                                                                          
   147    try:                                                                                  

KeyError: <PyRemoteObject object at 0x000001FA55EBA168>

I'm getting a keyerror even though the keys are there. This happens only if there's more than one proxy to iterate...

in03 commented 2 years ago

🤦‍♂️ ... Missing equality check... Of course iterating more than one proxy was failing 👎

    for job in jobs:
        for jobm in jobs_with_mpi:
            for k, v in jobm.items():
                assert hasattr(v, "GetClipProperty()")
                if job["media_pool_item"] == k:
                    job.update({"media_pool_item": v})

Also added an attribute assertion to ensure we do have a mediapoolitem.

in03 commented 2 years ago

Fixed in #186: