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

Choose timelines to queue in CLI #161

Open in03 opened 2 years ago

in03 commented 2 years ago

More commands!

Queuing the active timeline by default is handy, but being able to specify the exact timeline means you can look through command history and see which ones you've already done. Queuing multiple timelines at once or even all would be nice too.

Calling without arguments activates picker

Special timelines, Active and All are coloured differently. Picker only allows one choice if special timeline. Choosing a special deselects all others. Multiple named timelines can be chosen.

> rprox queue
Working on project "Project 1"
Which timeline would you like to queue?
[space to select, enter to confirm]

-> Active Timeline
   All timelines     
   Assembled Edit
   Best Takes
   Day 1 review
   Day 2 review

Queuing active timeline "Assembled Edit"
[...]

Without argument for timeline option, defaults to active timeline

> rprox queue --active
Working on project "Project 1"
Queuing active timeline "Assembled Edit"
[...]

With timeline provided

> rprox queue "Best Takes"
Working on project "Project 1"
Queuing timeline "Best Takes"
[...]

With '--all' flag

> rprox queue --all
Working on project "Project 1"
[Warning]: Are you sure you want to queue all timelines?
           This includes any revisions and nested timelines!
           Large projects may take a while to process!
> y

Queuing timelines: 
"Assembled Edit"
"Best Takes"
"Day 1 review"
"Day 2 review"

Multiple chosen timelines

> rprox queue "Day 1 review" "Day 2 review"`
Working on project "Project 1"

Queuing timelines: 
"Day 1 review"
"Day 2 review"
[...]

But How?

Queuing multiple timelines could be a huge pain as far as implementation goes. As the application stands at the moment, it's centered on the handling of a single timeline.


Simple implementation:

  1. Iterate each timeline, all handlers, checks, etc on a per-timeline basis
  2. Gather all tasks from each timeline into a single task group
  3. De-duplicate tasks within the group that have the same source media reference
  4. Encode all tasks as per usual
  5. Notify when the entire task group of multiple timelines has finished
  6. Link proxies for each of these timelines
  7. Exit

Pros:

Cons:


A more complicated way would be:

  1. Modify the Resolve class to always iterate all timelines, retrieving clip-properties along with appended timeline name
  2. thanks to media-pool-item de-duplication, we only need to remove tasks not in the list of chosen timelines
  3. Queue a task group for each timeline
  4. Encode all tasks as per usual
  5. Wait in a while-loop for a task group to finish:
    1. Run the notify routine for that task group
    2. Run the link routine for that task group
    3. Return to the loop until all groups have run those routines
  6. Exit

Pros:

Cons: