Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

KMS 6.61, GST 1.18.4 - RecorderEndpoint periodic intra frames in output when transcoding #642

Open
3 tasks done
neilyoung opened this issue Nov 23, 2022 · 6 comments
Open
3 tasks done
Projects

Comments

@neilyoung
Copy link

Prerequisites

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

Issue description

  • Browser let's KMS offer, either H.264 or VP8
  • Connecting prepared RecorderEnpoint (to local file, WEBM_VIDEO_ONLY) on MediaFlowOutStateChange of WebRtcEndpoint.
  • RecorderEndpoint MediaFlowInStateChanged fires with FLOWING
  • RecorderEnpoint receives Recording event
  • The recorded file is correctly following resolution changes, but does contain periodic intra frames, which are not justified by the connection quality. Happens only when transcoding (H.264 -> VP8).

Context

How to reproduce?

Expected & current behavior

Should not contain periodic intra frames

(Optional) Possible solution

Info about your environment

KMS source compilation, GST source compilation. Running in VM on same machine

About Kurento Media Server

About your Application Server

  • Programming Language: Node JS
  • Kurento Client version: 6.16.0

About end-user clients

  • Device(s): Mac
  • OS(es): Ventura 13.01
  • Browser(s): Chrome 107.0.5

Run these commands

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
kurento-media-server --version
Kurento Media Server version: 6.16.0
Found modules:
	'core' version 6.16.1~15.gcf111ef4
	'elements' version 6.16.1~19.gb38df49
	'filters' version 6.16.1~3.gec9da10
	'webrtcarucocode' version 0.1.6~14.g7bb9038
	'webrtcbarcode' version 0.1.6~5.gfd167d4
	'webrtccbr' version 0.1.6~7.gb9ddf5e
dpkg -l | grep -Pi 'kurento|kms-|gst.*1.5|nice'
no output
@github-actions
Copy link

Hello @neilyoung! 👋 we're sorry you found a bug... so first of all, thank you very much for reporting it.

To know about progress, check in Triage. All issues are considered Backlog Candidates until work priorities align and the issue is selected for development. It will then become part of our official Backlog.

@j1elo j1elo added this to Backlog Candidates in Triage Nov 23, 2022
@neilyoung
Copy link
Author

Attempting to improve transcoding quality for WEBM by

setMaxOutputBitrate(0)

(supposed to be unlimited), doesn't change anything: The resulting WEBM file when transcoding is about 2MByte per minute, while it is about 12MByte/min if plain VP8 as input. The same time the browser's encoder produces a constant bitstream of 3 MBit/s... That doesn't go together well, IMHO.

EDIT: Having now recorded 5 minutes WEBM. WebRTC internals showed 3 MBit/s encoding bitrate H.264 constant. The created output file was about 12MB. IMHO this means a rough output transcoding bitrate of about 300 kBit/s.

@j1elo
Copy link
Member

j1elo commented Dec 27, 2022

The Min and MaxOutputBitrate settings were lacking proper docs on what they do exactly, because they are quite advanced settings to change the limits of REMB bitrate feedbacks on WebRTC, and that's something that is not obvious nor too useful for most users.

Also, the actual bitrate for transcoding was hardcoded to 300 kbps :-(

This all changes today, because your comment prompted me to look into adding a new property, targetOutputBitrate, which once integrated, will allow to set whatever desired target bitrate for the encoder:

Kurento/kms-core@e0cd486

Note this work happened on the branch "7.0.0", because nowadays we're slowly getting ready to make the jump for the major version update. If you want to test custom code against Kurento 7, make sure you checkout to the 7.0.0 branch in all repos.

7.0 does not get the corresponding client SDK generated, so this might take a while to appear for nightly users of Kurento; I'll try to backport it to 6.x, otherwise this property will be available when 7.0 gets released (hopefully soon!)

@neilyoung
Copy link
Author

Oh...mmm. Would be nice to have that in 6.18.1 too

@shaman79
Copy link

We are also desperate to get some decent quality recordings out of KMS. Due to production use it is hard to rely on custom build or development version. Is there any estimate when this feature will be out in stable build?

@shaman79
Copy link

@j1elo Did you succeeded in backporting to 6.x?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Triage
Backlog Candidates
Development

No branches or pull requests

3 participants