Manuscript Offprint

arXiv:2610.11105

TKCAM: Text and Keyframe to Camera Trajectory Generation

Haozhe Yang, Zhiyang Dou, Zekai Gu, Cheng Lin, Wenping Wang, Yuan Liu, Taku Komura

Abstract

Generating high-quality and controllable camera motion is essential for AI-assisted cinematography, video synthesis, and 3D scene understanding. We introduce TK-CAM, a Text- and Keyframe-conditioned CAMera-motion synthesis framework based on generative masked modeling. We represent camera dynamics using a 12-dimensional kinematic feature comprising position, velocity, and a continuous rotation representation and discretize them into hierarchical motion tokens via a Residual Vector Quantizer (RVQ). A two-stage masked transformer architecture then learns to reconstruct and refine these tokens, utilizing explicit self- and cross-attention modules for multimodal conditioning. A central feature of our framework is sparse visual keyframe conditioning: users can provide free-form text prompts together with RGB observations at selected timestamps, which provide temporally localized visual guidance for generating coherent in-between trajectories. Furthermore, to advance evaluation standards, we curate RealEstate10K-Cap, a large-scale text-camera dataset, and establish a cross-domain benchmark with a Universal CLaTr Evaluator. Extensive experiments demonstrate that TKCAM surpasses recent state-of-the-art baselines on Fréchet distance (FID), text-motion matching scores, and retrieval metrics (R@K), while additional analyses evaluate temporal smoothness and cross-domain generalization. Code is available at https://github.com/linearalgebrayhz/TKCAM.

1 Introduction

Camera motion determines how a scene is perceived, understood, and narrated. For modern vision–language systems, the ability to synthesize high-quality and controllable 6-DoF camera trajectories enables AI-assisted cinematography [15, 16], video synthesis [12, 17, 18, 28, 33, 37], and spatial reasoning in 3D environments [4, 22, 27, 32]. Yet translating sparse, symbolic language into metrically consistent 3D motion remains challenging: language under-specifies geometry and timing; naïve regression drifts semantically; and existing datasets rarely couple reliable camera annotations with temporally grounded captions or standardized tools for evaluating text and camera-motion alignment.

Recent approaches [7, 16, 19, 36] have modeled text-to-trajectory either autoregressively or via diffusion. While these models can produce smooth paths given prompts, they still face three practical limitations. First, direct regression from text often ignores fine-grained visual semantics, leading to

†^{\dagger}Corresponding authors.

Preprint.

trajectories that miss spatial relations or temporal emphasis. Second, existing control mechanisms commonly rely on explicit camera states, scene geometry, or other structured inputs, whereas users may instead wish to guide motion using sparse visual observations at selected timestamps. Third, the modality gap between discrete text and continuous 3D motion, combined with the limited availability of semantically rich supervision, hinders efficient learning and generalization.

In this paper, we address these issues with TKCAM, a text- and keyframe-conditioned camera-motion generator built on generative masked modeling. TKCAM first discretizes continuous 3D camera trajectories into hierarchical motion tokens using a Residual Vector Quantizer (RVQ). To learn the multimodal correspondences, we train a base masked transformer that performs conditional demasking to reconstruct the masked motion tokens. Instead of complex token-level masking heuristics, we adopt a simple attention design within the transformer blocks: a motion-motion self-attention module to capture the temporal dynamics of the trajectory, followed by a motion-condition cross-attention module to directly inject the text and visual keyframe embeddings. A residual masked transformer then further refines the higher RVQ quantization levels in a coarse-to-fine manner, enhancing the high-frequency fidelity of the camera motion. As a result, at inference, TKCAM supports both text-only generation and animator-style keyframe conditioning: users can provide free-form text prompts alongside sparse RGB keyframes (e.g., first-frame or start/end observations), which serve as temporally localized visual guidance while the model generates coherent in-between trajectories conditioned on both the text and visual observations.

To train TKCAM, we curate RealEstate10K-Cap, a large-scale camera motion dataset built upon RealEstate10K [38]. RealEstate10K-Cap couples high-quality 3D camera trajectories with temporally grounded directorial captions. Specifically, the corpus comprises 25K annotated sequences (5 million frames, approximately 50 hours in total) across diverse real estate environments. Furthermore, a significant bottleneck in current camera generation research is the absence of a standardized and cross-domain evaluation metric. To support evaluation across different camera-motion domains, we further construct a Universal CLaTr Evaluator by retraining the CLaTr contrastive objective [7] on a balanced mixture of indoor, cinematic, and character-centric trajectory data.

We conduct extensive experiments to validate that TKCAM generates semantically faithful camera trajectories with smooth translational motion under both text-only and text-keyframe settings. On our mixed-domain benchmark, TKCAM outperforms recent state-of-the-art baselines on Fréchet distance (FID), CLaTr-based text-motion matching score, and retrieval metrics (R@K). Furthermore, ablations support the benefits of our 12-dimensional kinematic representation, RVQ discretization, and the dual masked transformer architecture. Our main contributions can be summarized as follows:

• We present TKCAM, a hierarchical masked generative framework tailored to multimodal camera trajectory synthesis. Building on established RVQ-VAE and masked modeling techniques, TKCAM introduces a camera-specific 12-dimensional kinematic representation together with decoupled motion self-attention and multimodal cross-attention for camera-motion generation.

• We introduce animator-style sparse-keyframe conditioning for text-driven camera generation. RGB observations at selected timestamps provide soft visual guidance through cross-attention, enabling bidirectional generation of coherent in-between trajectories without requiring explicit camera extrinsics as user input.

• We curate RealEstate10K-Cap, a large-scale dataset of reconstructed camera trajectories paired with temporally grounded, scene-aware captions, and establish a cross-domain evaluation protocol with a Universal CLaTr Evaluator. We further validate the framework through controlled baseline retraining, temporal-smoothness analysis, and human evaluation of the proposed evaluator. Among the compared methods, ours achieves the best FID, matching, and retrieval scores.

References (35)