Real-world events are inherently elastic. A human smile can flash across a face in half a second or linger for five (RealSmileNet). A hand gesture might be performed with rapid urgency or slow deliberation (Simultaneous Segmentation and Recognition: Towards More Accurate Ego Gesture Recognition).
Yet, despite the fluid nature of time, standard deep learning architectures for video processing demand rigid, fixed-length inputs. 3D Convolutional Neural Networks (CNNs) require static tensor dimensions to compute batch operations, while Vision Transformers (ViTs) rely on fixed token budgets (UniViT: Unifying Image and Video Understanding in One Vision Encoder) and rigid positional encodings (Learning Prompt-Enhanced Context Features for Weakly-Supervised Video Anomaly Detection).
To satisfy these architectural constraints, conventional pipelines resort to destructive workarounds: truncating longer videos, which discards crucial context, or padding shorter ones, which introduces computational waste and artificial artifacts (MMA-MRNNet: Harnessing Multiple Models of Affect and Dynamic Masked RNN for Precise Facial Expression Intensity Estimation). To build models that truly understand video, researchers are developing techniques to decouple neural architectures from fixed temporal constraints.
Differentiable Alignment and Temporal Compression
One way to handle variable-length sequences is to map them into a unified, fixed-size representation space before or during feature encoding, preserving the underlying temporal progression without relying on rigid cropping.
An early manifestation of this idea involves treating video frames as sequences of characters. In Video Event Classification Using Bag of Words and String Kernels, Bertini et al. utilize a string kernel based on the Needleman-Wunsch edit distance. By computing the minimum "edits" required to align two frame sequences, the model naturally accommodates variations in video length and speed within a standard Support Vector Machine framework.
In the era of deep learning, this alignment can be made end-to-end differentiable. Darryl Ho introduces this capability to modern architectures with DejaVid: Encoder-Agnostic Learned Temporal Matching for Video Classification. Instead of forcing a video encoder to ingest a fixed number of frames, DejaVid applies a differentiable version of Dynamic Time Warping (DTW). DTW finds the optimal non-linear alignment path between two feature sequences of different lengths. By learning feature importance over time, this approach allows off-the-shelf, fixed-duration video encoders to align natively with variable-duration real-world streams.
Variable Video A: [Frame 1] -> [Frame 2] -> [Frame 3] -> [Frame 4]
\ / |
Optimal DTW Alignment: \ / |
\ / |
Variable Video B: [Frame 1] -------> [Frame 2] ------------> [Frame 3]
Alternatively, the temporal dimension can be compressed into a static structural representation. Zhanning Gao demonstrates this in Video Imprint Segmentation for Temporal Action Detection in Untrimmed Videos by compressing variable-length videos into a fixed-size "video imprint" tensor. This compression allows a standard Fully Convolutional Network to perform dense temporal boundary predictions, bypassing the need for frame-by-frame analysis or rigid temporal windowing.
Recurrence and Dynamic Masking
A second paradigm shifts away from processing videos as bulk, multi-frame clips. By adopting sequential, frame-by-frame processing, a model's internal state can update indefinitely, adapting naturally to any sequence length.
Jiewen Yang et al. apply this logic to attention-based models in Recurring the Transformer for Video Action Recognition. Instead of feeding a massive, fixed-length block of frames into a self-attention matrix—which scales quadratically with video length—their Recurrent Vision Transformer (RViT) processes frames sequentially. It passes temporal information through a persistent hidden state via an "attention gate," allowing the network to ingest videos of arbitrary duration while maintaining a constant memory footprint.
[Frame t] ---> [ ViT Encoder ]
|
v
[Attention Gate] <--- [Hidden State t-1]
|
v
[Hidden State t] ---> Loop to next frame
However, when hardware batching requires sequences to be padded to a maximum length, standard recurrent networks still suffer from bias because they process the meaningless padding tokens. To eliminate this artifact, Dimitrios Kollias et al. propose a "Masked RNN" in MMA-MRNNet: Harnessing Multiple Models of Affect and Dynamic Masked RNN for Precise Facial Expression Intensity Estimation. The network dynamically tracks the true boundary of each video in a batch and explicitly masks out padding tokens during the recurrent pass. This ensures that the final hidden state is derived solely from the actual temporal context of the video, preventing downstream predictions from being diluted by filler frames.
Relational Matching and Structural Reconfiguration
A third approach bypasses absolute timelines entirely. If a model focuses on the relative order of sub-events rather than their absolute timestamps or frame indices, it becomes inherently invariant to duration and speed.
This intuition is leveraged by Temporal-Relational CrossTransformers for Few-Shot Action Recognition. The architecture avoids fixed-length constraints by sampling and matching temporally ordered sub-sequences—such as pairs, triples, or quadruples of frames—between a query video and support videos. Because the model calculates relations between frames based on their relative ordering rather than their absolute distance in time, it naturally adapts to the temporal scaling of human activities, whether an action takes two seconds or twenty.
Query Video (Long): [Frame 10] ...... [Frame 45] ...... [Frame 80]
\ | /
Matched as an ordered triple (Beginning, Middle, End)
/ | \
Support Video (Short): [Frame 2] ....... [Frame 5] ....... [Frame 8]
Rather than changing how features are sampled, it is also possible to change the network structure itself based on the input duration. Keze Wang et al. pioneer this concept in 3D Human Activity Recognition with Reconfigurable Convolutional Neural Networks. Instead of forcing a video into a static computational graph, their network treats complex activities as sequences of variable-length action segments and dynamically activates or deactivates its own neurons to match. This structural reconfiguration allows the physical layout of the network to scale dynamically alongside the temporal scale of the human behavior it observes.
Key Foundational Work
Video Event Classification Using Bag of Words and String Kernels (2009) — contributed 1 concept elements to this direction.
Scalable action recognition with a subspace forest (2012) — contributed 1 concept elements to this direction.