Writing Kurento Module that records ts file

44 views
Skip to first unread message

kwon kwon

unread,
Mar 13, 2023, 10:46:43 PM3/13/23
to kurento
  Hi Kurento Team

1. Module Description
I'm trying to make a Kurento Module that record TS files without transcoding.
For recording ts files, I 'm planning to use the gstreamer hlssink.
The below is the flow I described.

(client : web browser) ---h264/webrtc--->
(kurento 6.18 server : webrtcEndpoint) ---h264-->
(kurento 6.18 server : TSRecorderModule using gstreamer hlssink)---ts file/h264-->
(storage)

2. Questions
a. Is it possible to make above module?

b. If it is possible, how can I get h264 frame data in the module? 
All the example sources provided in the below url are getting decoded data.


Thanks!

Neil Young

unread,
Mar 14, 2023, 12:36:04 AM3/14/23
to kur...@googlegroups.com
How are you managing your KMS instance? Are you using a Node JS server app?

kwon kwon

unread,
Mar 14, 2023, 1:00:07 AM3/14/23
to kurento
I'm using kurento docker image on Ubuntu 18.04. 
2023년 3월 14일 화요일 오후 1시 36분 4초 UTC+9에 Neil Young님이 작성:

Neil Young

unread,
Mar 14, 2023, 1:13:38 AM3/14/23
to kur...@googlegroups.com
Question was: How are you managing this?

kwon kwon

unread,
Mar 14, 2023, 1:42:22 AM3/14/23
to kurento
I'm using  the Kurento Java client  to communicate with the Kurento Media server.

(Client : web browser) <----->  (Signaling Server with Kurento Java Client) <----> (KMS 6.18 : docker on Ubuntu 18.04) 

2023년 3월 14일 화요일 오후 2시 13분 38초 UTC+9에 Neil Young님이 작성:

Neil Young

unread,
Mar 14, 2023, 2:03:41 AM3/14/23
to kurento
Ah, ok. This differs from my setup (Node JS app on the server which runs KMS) I never dealt with GStreamer plugins (just OpenCV plugins, there transcoding is definitely involved).

Your setup doesn't allow me to suggest you to just simply use an RtpEndpoint and some FFMPEG background processing on the server. From what I have seen with GStreamer modules so far is that they also just give you access to the decoded video (but I might be wrong).

Maybe this page gives some inspiration https://telecom.altanai.com/tag/kurento/

Juan Navarro

unread,
Apr 17, 2023, 5:53:21 AM4/17/23
to kurento
Hi, if you select the appropriate recording profile in RecorderEndpoint, no transcoding will take place. We use this feature for OpenVidu individual recordings, where the preferred codec during WebRTC negotiation is VP8, so the RecorderEndpoint is instructed to save WEBM files and thus the whole process avoids transcoding, and uses little CPU.

Currently Kurento doesn't allow to specify codec and container; instead, they are both tied up in the so-called "recording profile". Two that make use of H.264 are MP4 and MKV. So, I'd suggest doing this:

* Recording your H.264 stream with the MKV profile.
* Checking CPU usage to verify no transcoding is being done (it should be obvious as it takes a lot of CPU). Also the "Transcoding active/inactive" messages and application events will help here.
* Remuxing the resulting files with a post-process step. Something like "ffmpeg -i file.mkv -c:a copy -c:v copy file.ts".

That is probably much simpler and easier to manage than writing a whole custom plugin for Kurento.
Reply all
Reply to author
Forward
0 new messages