Livestreaming from OBS To Kaltura


#1

Hello,

I managed to create a livestream from kaltura got the primary url and the stream name from kaltura and used that as a custom rtmp service in OBS.

When i press start streaming, it works well from OBS and i see traffic going to port 1935 on kaltura.

For some reason i cant see the stream on kaltura side, i get broadcast did not start.

What am i missing?

Thank you


#2

Please see my reply here: VOD Packager and PRIMARY_MEDIA_SERVER_HOST


#3

Hello Jess,

If i understand correctly, i read in nginx.conf

RTMP configuration

rtmp {
server {
listen 1935; # Listen on standard RTMP port
chunk_size 4000;

    # This application is to accept incoming stream
    application kLive {
            live on; # Allows live input from above
            dash on;
            dash_path /var/tmp/dashme;

            hls on; # Enable HTTP Live Streaming
            hls_cleanup on;
            hls_sync 100ms;
            hls_fragment 2s;

            hls_path /var/tmp/hlsme/;


    }
}

}

This means we have a kLive application to accept the incoming data from obs. In obs i can configure the stream to point to that application and the token provided by the generated livestream from KMC. What am i still missing?

I followed this document but when i try to playback i get nothing but a timeout https://archive.fosdem.org/2017/schedule/event/om_kaltura/attachments/slides/1404/export/events/attachments/om_kaltura/slides/1404/fosdem2017_presentation.pdf


#4

Hi @OCX,

For the Nginx-RTMP-Kaltura integrations, the best doc to follow is https://blog.kaltura.com/free-and-open-live-video-streaming.
If something does not work, check the HTTP requests going out when you hit play, in particular, the playManifest request the player makes. Then make the same request with curl and look at the response.
Feel free to share your findings here for additional guidance.


#5

Thanks Jess!
I got it working finally :))

Some errors though when playing back:
[http @ 0x7fb07c0c6720] No trailing CRLF found in HTTP header.0/0
[http @ 0x7fb07c012280] No trailing CRLF found in HTTP header.0/0
[http @ 0x7fb07c012240] No trailing CRLF found in HTTP header.0/0
[http @ 0x7fb07c012240] HTTP error 404 Not FoundB sq= 0B f=0/0
[hls,applehttp @ 0x7fb07c009280] Failed to open segment of playlist
[http @ 0x7fb07c071880] No trailing CRLF found in HTTP header.

The way i understand it is that the nginx-rtmp-module accepts broadcasts from encoders on port 1935 using rtmp on the kLive app.
Then it transcodes that automatically using ffmpeg into hls segments and serves that over hlsme application on port 88 “not 1935” for hls and dash delivery correct?

If the above is correct, i still have a question, how can i serve rtmp for the viewers that do not support hls? In the above scenario we are not serving rtmp for delivery but only for publishing

The idea is that i want to control my users on kaltura and serve them rtmp as well as hls to cover all devices and old flash stuff

Thank you!!


#6

Hi @OCX,

For RTMP playback, you can use the same URI as you do for streaming.
To wit: say this is the command you use to stream the content:

$ ffmpeg -re -i /path/to/mp4 -c copy -f flv rtmp://$NGINX_HOST:$NGINX_RTMP_PORT/kLive/my-stream

For testing RTMP playback, you can use ffplay:

$ ffplay rtmp://$NGINX_HOST:$NGINX_RTMP_PORT/kLive/my-stream

For HLS playback, you’d use:

$ ffplay http://$NGINX_HOST:$NGINX_HTTP_PORT/hlsme/my-stream.m3u8

Which, I believe you already figured out since you say HLS playback worked for you.

By default, when installing the kaltura-nginx package, $NGINX_HTTP_PORT is 88 [because with Kaltura CE 80 is already used for Apache] and $NGINX_RTMP_PORT is 1935 [default RTMP port].


#7

Jess, this is exactly what i am trying to do.
I am not able to play the RTMP streams but i am able to play http://host…:88/hlsme/myStream.m3u8.

i get this kind of output from the avplay;

avplay rtmp://host…:1935/kLive/myStream
ffplay version 2.8.11-0ubuntu0.16.04.1 Copyright © 2003-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB
RTMP_ReadPacket, failed to read RTMP packet headersq= 0B f=0/0
Invalid data found when processing input

Update: Sometimes if i try the avplay command several times in a row it works but i get a black screen only playing no video/audio