Set up H.264 video contraints

3,597 views
Skip to first unread message

Antonio Rusconi

unread,
Mar 3, 2015, 4:08:21 AM3/3/15
to kur...@googlegroups.com
Hello there,
I'm trying to set up video capture on Kurento with H.264 codecs but I can't understand how to do it. Is that a way to set up SDP in Kurento or there is another solution?

I've found this one but I can't find more information about used methods on internet:

org.kurento.client.Fraction fr = new org.kurento.client.Fraction(1, 30);        
VideoCaps vc= new VideoCaps(VideoCodec.H264,fr);
httpEndpoint
.setVideoFormat(vc);

I can't find which library I have to import.

Can someone help me to understad how to handle codecs in Kurento?

Thank you.

Jose Antonio Santos Cadenas

unread,
Mar 3, 2015, 4:31:32 AM3/3/15
to kur...@googlegroups.com
In general, Kurento handles codecs automatically and you only need to configure endpoints. The api that you use in your message is just for testing purposes that  is why you cannot find documentation nor examples.

In order to help you I need more data:

What do you mean by "capture on Kurento with H.264 codecs"? 
What is the source of the media? 
Why do you need H264 coded? 
Are you trying to create a file or just stream with http?

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.
For more options, visit https://groups.google.com/d/optout.

Antonio Rusconi

unread,
Mar 3, 2015, 6:03:36 AM3/3/15
to kur...@googlegroups.com
Hello,
yes,  I'm capturing data from webcam and I am recording the stream on hard disk. The video stored is coded in VP8, I need it in H.264.

MediaPipeline pipeline = kurento.createMediaPipeline();
WebRtcEndpoint webRtcEndpoint = new WebRtcEndpoint.Builder(pipeline).build();
recorderEndpoint
= new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + RECORDING_EXT).build();
webRtcEndpoint
.connect(webRtcEndpoint);
webRtcEndpoint
.connect(recorderEndpoint);
recorderEndpoint
.record();

I need to have the recorderEndpoint coded in H.264.

Can you help me to understand how to do it? Thank you for your help.

Jose Antonio Santos Cadenas

unread,
Mar 3, 2015, 6:23:29 AM3/3/15
to kur...@googlegroups.com

Antonio Rusconi

unread,
Mar 3, 2015, 7:25:24 AM3/3/15
to kur...@googlegroups.com
MediaPipeline pipeline = kurento.createMediaPipeline();
WebRtcEndpoint webRtcEndpoint = new WebRtcEndpoint.Builder(pipeline).build();
recorderEndpoint  
=  new RecorderEndpoint
     
.Builder(pipeline, RECORDING_PATH + RECORDING_EXT)

     
.withMediaProfile(MediaProfileSpecType.MP4)
     
.build();

webRtcEndpoint
.connect(webRtcEndpoint);
webRtcEndpoint
.connect(recorderEndpoint);
recorderEndpoint
.record();

I've solved. Thank you, you've ben very gentle.

Jose Antonio Santos Cadenas

unread,
Mar 3, 2015, 9:28:52 AM3/3/15
to kur...@googlegroups.com
You are welcome.

yaship...@gmail.com

unread,
Mar 16, 2015, 1:21:30 PM3/16/15
to kur...@googlegroups.com
Hi Jose,

I am using kurento media server(node.js) for my application and I am trying for one to many communication with recording and playing the recorded file on client side.

I have an issue in which when I try to view the Recorded file on my client side using PlayerEndPoint, the video quality is really bad as compared to the one that is recorded on the server.
If I play the video using any player on the server, it plays perfectly and the video quality is very good. The issue arises when I try to view the recording on client side. I am recording the video using RecorderEndpoint into .mp4 format. The codec is H.264 and I am using the way you have described above to record it in mp4.

Please suggest me about any parameters or anything we can do to improve the quality.Also, please help me find out the root cause of the issue. Really appreciate any help provided.

Thanks
Yashi Parolia


Jose Antonio Santos Cadenas

unread,
Mar 27, 2015, 4:10:18 AM3/27/15
to kur...@googlegroups.com
Hi,

It seems that you are making too many transcodings. I suppose that you are sending media to mediaserver using webrtc, that normally uses vp8 format and then sending again to clients using webrtc, this means that you are converting vp8 to h264 and then again to vp8. I suggest to use webm format, this way you'll avoid this transcofications. 

Additionally, we have detected some issues with mp4 format, regarding to quality and stability. We are aware of them and we'll try to fix them as soon as possible.

Antonio Rusconi

unread,
Apr 22, 2015, 11:55:30 AM4/22/15
to kur...@googlegroups.com

Hi Jose,

is that a way to have a communication based on H.264? I Mean, Kurento prefers to use VP8 but I need to send a stream from PlayerEndpoint to WebRtcEndpoint in H.264.

Even if the file sent is in H.264, the codec used for the communication is VP8.

I've tried to change the file in /etc/kurento/sdp_pattern.txt putting H.264 as first but it doesn't work...mozilla firefox always choose VP8.

Jose Antonio Santos Cadenas

unread,
Apr 22, 2015, 5:53:43 PM4/22/15
to kur...@googlegroups.com
Sorry, but h264 support is not complete and it is disabled.

Sam Khan

unread,
May 24, 2015, 10:03:12 AM5/24/15
to kur...@googlegroups.com
Hello,

Has there been any update regarding the use of h264 in KMS? I have been through many topics in this forum on how to create stream in mp4 format but i'm still not sure if "RecorderEndpoint.Builder withMediaProfile(MediaProfileSpecType mediaProfile)" only changes the video file container to mp4 or also changes the codec to h264.

The current thread particularly confuses me because it makes me think that while the container gets changed to mp4 the codec remains vp8.

Could you please provide some comments on this subject. Thank you.

- Sam

Ivan Gracia

unread,
May 26, 2015, 6:06:51 AM5/26/15
to Kurento Public
With that recorder, you should get h264 and mp3. Nevertheless, we are not providing support for h264 right now since it's an incomplete feature, as Jose said earlier. Our main focus lately in the server part has been on webrtc and performance, and haven't got round to that yet.

In any case, by all means give it a go ;-)

Ivan Gracia


tto...@ippon.fr

unread,
Mar 21, 2016, 10:50:55 AM3/21/16
to kurento
Hi there,

I'm trying to set up H264 streaming from an IP video camera to an HMI in H264 (in HTML5 + Javascript), but we are experiencing problems due to the H264 -> VP8 transcoding. Looking for a solution, we crossed upon this topic and would like to know if there were any news regarding the H264 support/feature.

Best regards,

Thomas Toledo.

Ivan Gracia

unread,
Mar 21, 2016, 1:15:13 PM3/21/16
to Kurento Public
You'll need to install openh264-gst-plugins-bad-1.5 in your KMS box, and you'll get that support in WebRTC.

Ivan Gracia


Message has been deleted

Jose Antonio Santos Cadenas

unread,
Mar 22, 2016, 11:24:16 AM3/22/16
to kurento

The delay is caused by buffering on player, not by transcoding. There is a patch on the way, but it requires a little bit more work to be ready.

Here is the patch: https://github.com/Kurento/kms-elements/pull/3


El mar., 22 de marzo de 2016 16:20, <tto...@ippon.fr> escribió:

Hello Ivan,

First of all, thank you for your answer and support.
We installed the openh264-gst-plugins-bad-1.5, but we still cannot manage to do the following :

We have an IP camera with the following address : rtsp://myhostname/ipcam and we can get its stream with VLC Media Player (so we know it is working). What we would like to achieve, is to show via Kurento the camera stream without any latency. We are using this example : Kurento RTSP2WebRTC, but there is a huuuuge latency (approximately 3 sec).

We believe it is due to the H264 to VP8 transcoding. We would like a simple H264 to H264 communication, without the transcoding phase (as we do not need it). Is it currently possible, and if so, I would be very glad if you could tell me how to do this.

I hope I correctly explained myself (I might have forgot some information that you might need to help me, and if it is the case, I apologize in advance).

Best regards,

Thomas Toledo.

tto...@ippon.fr

unread,
Mar 22, 2016, 11:27:56 AM3/22/16
to kurento
Thanks ! (I deleted my previous message by accident, so here it is :
"Hello Ivan,

First of all, thank you for your answer and support.
We installed the openh264-gst-plugins-bad-1.5, but we still cannot manage to do the following :

We have an IP camera with the following address : rtsp://myhostname/ipcam and we can get its stream with VLC Media Player (so we know it is working). What we would like to achieve, is to show via Kurento the camera stream without any latency. We are using this example : Kurento RTSP2WebRTC, but there is a huuuuge latency (approximately 3 sec).

We believe it is due to the H264 to VP8 transcoding. We would like a simple H264 to H264 communication, without the transcoding phase (as we do not need it). Is it currently possible, and if so, I would be very glad if you could tell me how to do this.

I hope I correctly explained myself (I might have forgot some information that you might need to help me, and if it is the case, I apologize in advance).

Best regards,

Thomas Toledo."


Thank you very much for your answer, this extremely good news ! We are going to check this patch, I'll come toward you later.

A great, big thanks, again :)

陈超

unread,
Jun 25, 2017, 11:32:53 PM6/25/17
to kurento
I have same problem , i got h264/AAC strem from playendpoint , then use Webrtcendpoint play in chrome. but cpu up to 40%, i think it`s trancode cost.
how can i prevent the transcode ? i try to set kurton  SDPendpoint ,remove the VP8 ,only left H264, but  it can`t work in chrome .


在 2015年3月3日星期二 UTC+8下午5:31:32,Jose Antonio Santos Cadenas写道:
Reply all
Reply to author
Forward
0 new messages