VideoOrchestrator
The main orchestration class for managing video generation workflows.
Constructor
VideoOrchestrator(provider: VideoProvider)Parameters
provider
VideoProvider - The video generation provider to use
Example
from ministudio import VideoOrchestrator, VertexAIProvider
provider = VertexAIProvider()
orchestrator = VideoOrchestrator(provider)Methods
generate_shot()
Generate a single video shot.
async def generate_shot(
request: VideoGenerationRequest
) -> VideoGenerationResultParameters
request
VideoGenerationRequest - The generation request configuration
Returns
VideoGenerationResult
The result containing the generated video
Example
result = await orchestrator.generate_shot(
VideoGenerationRequest(
prompt="A scientist in a laboratory",
duration_seconds=8
)
)
if result.success:
print(f"Video generated: {result.video_path}")
else:
print(f"Error: {result.error}")generate_shot() is an async function. Use it with await or asyncio.run().
generate_sequence()
Generate a multi-shot sequence with automatic continuity.
async def generate_sequence(
shots: List[VideoGenerationRequest]
) -> List[VideoGenerationResult]Parameters
shots
List[VideoGenerationRequest] - List of shot requests to generate
Returns
List[VideoGenerationResult]
Results for each shot in the sequence
Example
shots = [
VideoGenerationRequest(
prompt="A researcher enters the laboratory",
duration_seconds=5
),
VideoGenerationRequest(
prompt="The researcher examines equipment",
duration_seconds=6
),
VideoGenerationRequest(
prompt="The researcher makes notes",
duration_seconds=4
)
]
results = await orchestrator.generate_sequence(shots)
video_paths = [r.video_path for r in results if r.success]The orchestrator automatically handles frame extraction and state management for continuity between shots.
get_state()
Get the current state of the orchestrator.
def get_state() -> OrchestratorStateReturns
OrchestratorState
Current state including shot history and continuity data
reset()
Reset the orchestrator state for a new sequence.
def reset() -> NoneExample
# Finish first sequence
results1 = await orchestrator.generate_sequence(shots1)
# Reset for new sequence
orchestrator.reset()
# Start new sequence
results2 = await orchestrator.generate_sequence(shots2)