Kurento support rtmp

739 views
Skip to first unread message

richmonkey

unread,
Sep 10, 2020, 11:25:27 AM9/10/20
to kurento
Change RecordEndpoint(kmsavmuxer)  mux:flvmux sink:rtmpsink to support  rtmp stream from webrtcendpoint.
Is is Possible?

Micael Gallego

unread,
Sep 10, 2020, 4:47:40 PM9/10/20
to kur...@googlegroups.com
We don't know.

You can try it and if it work, you can contribute it with a PR.

Regards

On Thu, Sep 10, 2020 at 5:25 PM richmonkey <houxu...@gmail.com> wrote:
Change RecordEndpoint(kmsavmuxer)  mux:flvmux sink:rtmpsink to support  rtmp stream from webrtcendpoint.
Is is Possible?

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/5690f991-5164-418a-ade0-a14964410b9cn%40googlegroups.com.

richmonkey

unread,
Sep 12, 2020, 2:29:42 AM9/12/20
to kurento
It works perfect.
 It needs two patch. 
core.patch -> kms-core
elements.patch -> kms-elements
Do I need contribute the patch from github?
core.patch
elements.patch

Micael Gallego

unread,
Sep 14, 2020, 11:51:05 AM9/14/20
to kur...@googlegroups.com
Thank you richmonkey, 

We will take a look at it. 

Micael Gallego

unread,
Sep 14, 2020, 11:54:37 AM9/14/20
to kur...@googlegroups.com
Can you describe what is the supposed behaviour of the patch?

Have you added the capability to record FLV files on disk or it is possible to send the media to a RTMP server?

Can you provide an example of pipeline configuration in Java or JavaScript? 

Regards

richmonkey

unread,
Sep 14, 2020, 12:27:59 PM9/14/20
to kurento
Yes, Flv and rtmp all tested.

1. test flv:

//here,  I tested with MediaProfileSpecType.MP4, because i do not build the new javaclient sdk.
MediaProfileSpecType profile = MediaProfileSpecType.FLV;
String filePath = "file:///tmp/test.flv";
RecorderEndpoint recorder = new RecorderEndpoint.Builder(pipeline, filePath)
.withMediaProfile(profile).build();

//build webrtcendpoint 
WebRtcEndpoint webrtcEndpoint = ...;

webrtcEndpoint.connect(recorder);


2. test  rtmp,  rtmp server installed  in localhost. 
(gst_element_make_from_uri is compatible with rtmp&file protocol)

just change filePath, other same as flv file.
String filePath = "rtmp://127.0.0.1/live/teststream";

richmonkey

unread,
Sep 14, 2020, 12:29:58 PM9/14/20
to kurento
Any recorder example can test the patch.
 just change the profile&filePath parameter when build the RecorderEndpoint
profile = flv
filePath = "rtmp://" or "file://xxxx.flv"
在2020年9月14日星期一 UTC+8 下午11:54:37<OpenVidu> 写道:

richmonkey

unread,
Sep 14, 2020, 12:34:04 PM9/14/20
to kurento
By the patch , i can transfer webrtc stream to rtmp stream(other rtmp server),  it is more power & robus than rtpendpoint -> ffmpeg -> rtmp server

richmonkey

unread,
Sep 14, 2020, 12:37:02 PM9/14/20
to kurento
I test the patch with rtmp server:
It's very simple&powerful

在2020年9月14日星期一 UTC+8 下午11:54:37<OpenVidu> 写道:

richmonkey

unread,
Sep 30, 2020, 2:21:52 AM9/30/20
to kurento
any new message? Is the patch accepted?

Juan Navarro

unread,
Oct 26, 2020, 1:14:13 PM10/26/20
to kur...@googlegroups.com
I've added a new issue to track merging of this patch, so it doesn't get lost in this forum:
https://github.com/Kurento/bugtracker/issues/541

Alejandro Sellero Rodríguez

unread,
Nov 22, 2020, 10:29:52 AM11/22/20
to kurento
hi richmonkey,

I was interested in trying out your patch and applied it in a custom build. Sadly it seems not to work in my case. Could be that the patch does not work with the last version of kms (6.15.0)?

Here is the recorder endpoint creation (scala code):
```
val RECORDER_FILE_PATH =
"file:///out/test.flv"
val mediaProfile = MediaProfileSpecType.FLV
val recorder =
new RecorderEndpoint.Builder(mediaPipeline, RECORDER_FILE_PATH).withMediaProfile(mediaProfile).build();

```

And this is the output
```
vs-kurento-media-server_1  | 0:28:04.994304451     1 0x7fc35004a090 WARN                    glib GLib-GObject:0:: value "((KmsRecordingProfile) 11)" of type 'KmsRecordingProfile' is invalid or out of range for property 'profile' of type 'KmsRecordingProfile'
vs-kurento-media-server_1  | 0:28:04.994323174     1 0x7fc35004a090 INFO    KurentoRecorderEndpointImpl RecorderEndpointImpl.cpp:150:RecorderEndpointImpl: Set FLV profile
vs-kurento-media-server_1  | 0:28:05.082859583     1 0x55cab4471900 ERROR                   glib (NULL):0:: kms_base_media_muxer_set_state: assertion 'KMS_IS_BASE_MEDIA_MUXER (obj)' failed
```

richmonkey

unread,
Nov 22, 2020, 10:50:20 AM11/22/20
to kurento

I think, The key error is " 'KmsRecordingProfile' is invalid or out of range for property 'profile' of type 'KmsRecordingProfile'"
I do't update java sdk, so I have not tested  the new enum KMS_RECORDING_PROFILE_FLV.
The problem is how to add a new profile enum value.
the key function is tested, and the i can get flv file & rtmp stream.

richmonkey

unread,
Nov 22, 2020, 11:02:06 AM11/22/20
to kurento

Does the kms loaded the new kms-core plugin? maybe the kms still load the old(system path) plugin.
在2020年11月22日星期日 UTC+8 下午11:29:52<alex...@gmail.com> 写道:

Alejandro Sellero Rodríguez

unread,
Nov 22, 2020, 1:09:23 PM11/22/20
to kurento
Theoretically I installed the custom kms-core as well, I will try to check if the custom build is the loaded one in the next days.

Thanks

Juan Navarro

unread,
Nov 23, 2020, 5:21:08 AM11/23/20
to kur...@googlegroups.com
To modify kms-elements, like with any other Kurento module, there are 2 sides of the same coin:

1) Modify the module's implementation in the server, including the generic module definition file(s) (files with ".kmd" extension).
2) Update the client SDK (Java or Javascript) (which gets auto-generated from the .kmd files, by the kurento-module-creator tool).

Here is an example of adding a new format to the RecorderEndpoint: https://github.com/Kurento/kms-elements/pull/13

--
Juan Navarro
Kurento developer
@j1elo at GitHub & Twitter

Alejandro Sellero Rodríguez

unread,
Nov 23, 2020, 5:31:10 AM11/23/20
to kurento
This PR fits perfectly with what richmonkey did, so the problem has to be in my custom build. I will try to build everything again and see...

Thanks a lot both of you for your answers :)

Juan Navarro

unread,
Nov 23, 2020, 7:49:09 AM11/23/20
to kur...@googlegroups.com
You're welcome!

A bit more info, in case it is useful (docs are extense so important info might slip through a quick read), about step (2): auto-generating the client SDK code can be done as explained in Writing Modules or in the Dev Guide.

Regards
--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.

Alejandro Sellero Rodríguez

unread,
Nov 25, 2020, 11:02:39 AM11/25/20
to kurento
Hello again guys,

you were right, the kms-core version I got installed was not the right one. Now I can confirm that I got it to work saving to local and also streaming to Amazon IVS.

If you would like to test it without having to build kurento again I have both modules in this repo in bintray:
https://bintray.com/alex1712/deb/vs-kms-core/6.15.1

Also you can find the java sdk under this repository:
https://bintray.com/alex1712/maven/kurento-client/6.15.0-VS

If you'd like I already have the changes richmonkey did in a fork in github so I could create a PR and link it in the issue you created (https://github.com/Kurento/bugtracker/issues/541).

Micael Gallego

unread,
Nov 25, 2020, 11:07:08 AM11/25/20
to kur...@googlegroups.com
Good news Alejandro!!

If you create a PR it is easier for us to apply it to the code base and include it with the new release.

Regards

richmonkey

unread,
Nov 25, 2020, 8:57:59 PM11/25/20
to kurento
great, waiting the new release.

Alejandro Sellero Rodríguez

unread,
Nov 26, 2020, 3:21:05 PM11/26/20
to kurento
Hi, I was creating the PR and I notice that 1 of the conditions is to add tests for the new features, in my case I just took the patches and applied them, I am not really a C developer and would be really hard for me to write the tests.

So, I will leave you here a link to the draft PR's with the changes:
https://github.com/Kurento/kms-core/pull/24
https://github.com/Kurento/kms-elements/pull/30

Sorry, I hope that helps anyway :)

Micael Gallego

unread,
Nov 26, 2020, 4:08:30 PM11/26/20
to kur...@googlegroups.com
No problem, thanks! 

Juan Navarro

unread,
Nov 27, 2020, 5:24:22 AM11/27/20
to kur...@googlegroups.com
Hi,

I see in the Pull Request that the profile is only available for audio+video. So, here is my question: does it make sense to provide it also for video-only and/or audio-only?

Are there use cases that would benefit for an audio-only FLV recording?

--
Juan Navarro
Kurento developer
@j1elo at GitHub & Twitter

Alejandro Sellero Rodríguez

unread,
Nov 27, 2020, 5:42:19 AM11/27/20
to kurento
I am really new to media software and C in general, I think richmonkey could answer better than me :)
Message has been deleted

richmonkey

unread,
Nov 27, 2020, 5:58:18 AM11/27/20
to kurento
And  flv is not better than mp4, support flv,  just for rtmp, so i think no audio-only flv is fine.

Trevor Chan

unread,
Feb 18, 2021, 11:02:52 AM2/18/21
to kurento
Hi everyone,

How do you configure the RecorderEndpoint filepath to use an rtmps location with a stream key? I'm also trying to build kurento with these modules to stream to Amazon IVS  but can't figure out the configuration. 

Thanks in advance!

Alejandro Sellero Rodríguez

unread,
Feb 18, 2021, 11:11:14 AM2/18/21
to kurento
Well in my test I just set the MediaProfile to flv and created the RecorderEndpoint with the endpoint from amazon IVS

val mediaProfile = MediaProfileSpecType.FLV
val recorderEndPoint = new RecorderEndpoint.Builder(mediaPipeline, {{AMAZON_ENDPOINT}}.withMediaProfile(mediaProfile).build()


for me, using only this with the custom kurento packages worked

Trevor Chan

unread,
Feb 18, 2021, 11:24:47 AM2/18/21
to kurento
Hey Alex,

Apologies for the noob question but how did you construct the AMAZON_ENDPOINT? For example, if I have the following IVS credentials:

stream key:   sk_us-east-1_xxxxx

How do I create the endpoint?

Alex

unread,
Feb 18, 2021, 11:34:55 AM2/18/21
to kur...@googlegroups.com
I think to remember that it was just concatenating them:
rtmp://...live-video.net:443/app/{{KEY}}

sorry I don't have the code anymore, I just needed to be check if it works

You received this message because you are subscribed to a topic in the Google Groups "kurento" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kurento/_1jO6ugsAO4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kurento+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/6c141d32-b3ae-4d62-99be-cd57c2c58e59n%40googlegroups.com.


--
Alejandro Sellero
alex...@gmail.com

Trevor Chan

unread,
Feb 18, 2021, 12:57:29 PM2/18/21
to kurento
Sounds good. I'll give that a try. Thanks!

Neil Young

unread,
Mar 25, 2022, 3:54:01 AM3/25/22
to kurento
Found this thread yesterday and applied the PRs to my KMS source installation on an ARM VM (Apple Silicon). Works like a champ. Took the "official" JS recorder sample and just changed ".webm" to ".flv". Having an FLV now and need to figure out, what to do with it (hints welcome). Having to stream RTMP to somewhere.

These PRs deserve a merge.

Regards

Juan Navarro

unread,
May 12, 2022, 1:42:12 PM5/12/22
to kur...@googlegroups.com

Alejandro Sellero Rodríguez

unread,
May 12, 2022, 3:00:03 PM5/12/22
to kurento
Thanks to @richmonkey for the patch :) and thank you for merging it. Looking forward for the release.

Juan Navarro

unread,
May 12, 2022, 5:18:36 PM5/12/22
to kur...@googlegroups.com
This got merged for the upcoming release of Kurento 6.18, of which a pre-release build is already available in the development nightly builds channel


--
Juan Navarro
Kurento developer
@j1elo at GitHub & Twitter
No problem, thanks! 

--
Reply all
Reply to author
Forward
0 new messages