Skip to content

Unexpected Transcoding When Recording VP9 to .webm or H265 to .mp4 #130

@Yonge2

Description

@Yonge2

Prerequisites

These are MANDATORY, otherwise the issue will be automatically closed.

Issue description

When recording a WebRTC stream that uses VP9 or H265 codec using Kurento Media Server’s RecorderEndpoint, we expect the following behaviors:

  • VP9 → .webm : Passthrough (no transcoding)
  • H265 → .mp4 : Passthrough (no transcoding)

However, in practice, transcoding is triggered even when the container format matches the codec. This causes unnecessary CPU overhead and defeats the purpose of codec-aware recording.

Context

This issue increases CPU usage and introduces latency in our video pipeline. Our architecture ensures that streams are already encoded with the desired codec, so Kurento should record them directly.

How to reproduce?

  1. Use WebRtcEndpoint, 'RtpEndpoint' to receive a video stream encoded in VP9 or H265
  2. Connect to RecorderEndpoint configured with:
    • URI: file:///tmp/output.webm (for VP9)
    • URI: file:///tmp/output.mp4 (for H265)
  3. Observe the logs and output file

Expected & current behavior

Expected Behavior

  • VP9 to .webm: Recorded directly without transcoding
  • H265 to .mp4: Recorded directly without transcoding

Current Behavior

Transcoding is being activated, confirmed by Kurento logs, even for codec-container combinations that should be compatible.

2025-06-04T10:13:29,307405 16978 0x00007d6a4a3f36c0    info KurentoRecorderEndpointImpl RecorderEndpointImpl.cpp:127 RecorderEndpointImpl()  Set MP4 VIDEO ONLY profile
2025-06-04T10:13:29,310984 16978 0x00007d6a4dbfa6c0    info kmsutils                  kmsutils.c:514 kms_utils_pad_monitor_gaps() <'':sink_video_default>  Add probe: DISCONT buffers and GAP events
2025-06-04T10:13:29,385593 16978 0x00007d6a4dbfa6c0    info agnosticbin               kmsagnosticbin.c:759 kms_agnostic_bin2_find_or_create_bin_for_caps() <kmsrtpendpoint0_kmsagnosticbin2-0>  TRANSCODING ACTIVE for video

(Optional) Possible solution

Info about your environment

About Kurento Media Server

About your Application Server

  • Programming Language: Node.js
  • Kurento Client version: 7.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions