vios-media-pipeline · git:20260603.14e198c · 2026-06-03 · sha256 8ebfa988de490551

vios-media-pipeline git:20260603.14e198cA

Immutable. This exact content is served forever at /api/v1/blob/8ebfa988de490551.

---
description: Video pipeline guidelines for GStreamer, codecs, and media threading
globs: "**/media/**,**/live555/**"
alwaysApply: false
---

# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Video Pipeline Guidelines

- **Buffer lifetime** -- pipeline buffers may be ref-counted; never hold a raw pointer past the callback that delivers it
- **Timestamp precision** -- use `int64_t` for PTS/DTS values (nanoseconds or microseconds); avoid `float`/`double` for media time
- **Hot path allocations** -- flag and eliminate unnecessary copies or heap allocations in encode/decode/transmux loops
- **Thread affinity** -- many GStreamer and live555 callbacks have thread affinity requirements; do not call pipeline APIs from arbitrary threads
- **Format negotiation** -- always verify caps/format compatibility before linking pipeline elements; mismatches produce silent black frames or crashes at runtime
- **Codec constraints** -- account for keyframe intervals, B-frame reordering, and profile/level compliance when constructing or reconfiguring pipelines
- **Supported codecs/containers** -- H.264, H.265, VP8/VP9, AV1; MP4, MKV, TS; RTSP, WebRTC, HLS, DASH