Kaltura CE 12.4.0 | Bug Report

I updated to the new release and notice there is no option to specific what port to use for the new ngnix Live Streaming option. So people like me who already have a running copy of Wowza on our system broke all the live stream upon installation of the new version. Finally, I located the ngnix HTTP configuration file and change the port something other than 1935 which was already being used by Wowza.

Next, issue is it is unclear how to feed a live IP camera feed into the new ngnix live streaming and then call to that live feed. The option to feed a live stream with an app is straight forward but not a live feed from a dynamic source.

Here is another issue I found.

Hi @hiphopservers,

In regards to prompting for the RTMP port - I will add it for 12.6.0, 12.5.0 is already sealed and will become the stable version later today. However, if you already have your Wowza daemon running on the machine, Nginx would fail to start a listener on the same port [TCP 1935] and the Wowza should remain operational. None of the postinst scripts restart the Wowza daemon so, unless you stopped it and restarted Nginx manually, I’m a bit unclear as to how you got to the end result. Can you please explain?

About streaming, I’m a bit unclear as to your question and in particular “The option to feed a live stream with an app is straight forward but not a live feed from a dynamic source.”… Can you please explain what you mean? There’s a short explaining about how to stream to the Nginx using RTMP here:

It does not really matter if you stream from your webcam or streaming a file from your desktop, both should work.

I am not sure what happen. I have service monitors running in background but none appear to have reported any services down. In some instance when a service is down the monitor will attempt to restart the service.

This issue happen after I updated Kaltura CE to the latest version and got a report that the live feed were not loading anymore. Since I was traveling it took two days before I could site down and dig in to investigate. After reading the change notes and seeing that Ngnix was using live streaming I change the port configuration and restarted Ngnix which resolved the issue.

Short answer I do not know why Wowza stopped allowing Ngnix to take control over the port.

I mean that when I load my live streams into Wowza they are unquie URL with authentication data in the URL and configured in our firewall appliance at the source of the live feed. All 22 live feeds feed into Wowza stream from a single IP using different ports served from a IP camera server (appliance) which uses a combination of network cameras and wired cameras.

So for my configuration to be served from Ngnix I would need to know where to paste the source URL for each of the IP cameras to stream into Ngnix. Wowza currently allows us to pull from each source URL once and server multiple connections from a single live source. I see how to push a live feed using an app like FME to serve a live feed to Kaltura CE and then how to call to that feed from within Kaltura CE. I do not see how to create a LIVE stream from a static or dynamic URL source and feed it into Ngnix and then serve it to Kaltura.

My current setup limits the amount of bandwidth and connections using from the source and expands the connections and bandwidth by using Wowza and Kaltura CE as a relay with more resources available. I hope this clarifies your understanding of my setup.

@jess

How do I configure Kaltura CE to ingest my LIVE stream from a specified URL for playback and recording of the source via Kaltura CE Live Streaming with Nginx? That is what I am not able to figure out as it is not as straight forward as doing it with Wowza. User that have Wowza create stream files with the source URL information this is then passed to Wowza much like FME sends the file to Wowza just without the FME actually ingesting the source.

My guess is that we have to make a similar type of file and then call to the file from Kaltura CE as the source but a how to would be very helpful. This would eliminate the need for third party software in my configuration.

Hi @hiphopservers,

To stream use:
rtmp://$NGINX_HOST:1935/kLive/stream

to get the HLS manifest for playback, use:
http://$NGINX_HOST:$NGINX_PORT/hlsme/stream.m3u8

To use this with the HTML5 Kaltura player, go to KMC->Upload->Live Stream Entry->under Live Stream Type select Manual Live Stream URLs, provide a name and then in the URL input http://$NGINX_HOST:$NGINX_PORT/hlsme/stream.m3u8 and uncheck “Akamai HD protocol…”

Obviously, you can replace ‘stream’ and ‘stream.m3u8’ with any other stream name so, for example:
rtmp://$NGINX_HOST:1935/kLive/jess
and then, in the URL for the entry in KMC, input:
http://$NGINX_HOST:$NGINX_PORT/hlsme/jess.m3u8

As explained here:

@jess

Streaming from an IP camera is not quite that straight forward. Unlikely a source such as the one you describe.[quote=“jess, post:6, topic:6011”]
To stream use:rtmp://$NGINX_HOST:1935/kLive/stream
[/quote]
I need the synatax to make another stream file like kLive however it would have static source information rather than dynamic information the way you use FME to stream. Example would be as follows:

Wowza Manager creates a stream file for each live source.

camera one live = cam1
camera two live = cam2

Hence I would have a different application file and folder simular to the default folder example call:

sLive rather than kLive

This would then make the streaming URL as such:

http://$WOWZA_HOST:$WOWZA_PORT/sLive/

Now, in the current format I have to make a stream file for each live feed using that specific application. The stream file references the actual static URL of the source of the stream versa the adaptive stream.

rtsp://username:stream-pswd@SOURCE_HOST:SOURCE_PORT/ip-cam-media/live-media.amp?videocodec=h264&streamprofile=balanced&camera=1

Stream files are usually name by the source or how administrator see fit.

cam1 = cam1.stream
cam2 - cam2.stream

This URL will vary depending on the source and the result would be as such to stream from. How ever in this instance the playback URL would be similar to this:

http://$WOWZA_HOST:$WOWZA_PORT/sLive/hlsme/cam1.m3u8

or

http://$WOWZA_HOST:$WOWZA_PORT/sLive/hlsme/cam2.m3u8

The following issues are:

  1. I don’t know the path to the NGINX stream application file kLive to make another folder and file for my alternate source.

  2. I do not know the syntax for the stream files to properly pull from the static source URL as I would from Wowza on NGNIX. These are the files used by the application to access the live stream.

  3. Finally, it is not clear if the static streams require configuration to startup on reboot or how to manually connect to them if required in this configuration. Most of this is very straight forward on Wowza but not well documented for the NGNIX platform nor in this configuration of NGNIX.

Please confirm you understand my question and what additional information I need to complete my configuration.

@jess

Do you know what modules were compiled in the Kaltura version of NGiNX? I want to know if the same modules found in this users configuration are enable on the Kaltura CE version. He seems to have gotten RTSP streams to encode through NGiNX and stream back out as RTMP through NGINX.

https://forum.nginx.org/read.php?2,268298,268298#msg-268298

Either, I am not able to create the proper syntax to make the stream work or the configuration for Kaltura’s version of NGiNX is properly configured to allow ingestion or reply of RTSP streams. Here is the detectives I have tried on my system.

# RTMP configuration
rtmp {
    server {
        listen 1945; # Listen on standard RTMP port
	 listen 5554;
	 notify_method get;
	 record off;
        chunk_size 4000;

        # This application is to accept incoming stream
        application kLive {
                live on; # Allows live input from above
		 exec_options on;

            # Static pull is started at nginx start
            exec_pull ffmpeg -rtsp_transport tcp —i rtsp://usr_name:pswd@LIVE_CAMIP:IP_CAM_PORT/axis-media/media.amp?camera=1 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -f flv rtmp://NGiNX_HOST:PORT/$name name=camone;

            exec_push ffmpeg -rtsp_transport tcp —i rtsp://usr_name:pswd@LIVE_CAMIP:IP_CAM_PORT/axis-media/media.amp?camera=2 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -f flv rtmp://NGiNX_HOST:PORT/$name name=camtwo;

                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/;


        }
    }

Neither, of the directives work for this instance of NGINX configured and complied by Kaltura. As you can see this specific instance would have to ingest a live RTSP stream and then encode it in a format that can be process by Kaltura CE to distribute to end uses. The source does not have enough bandwidth to server multiple connections.

If you have any suggestions or a solution you can integrate in the next or future version of Kaltura CE please advise.

Hello,

The exec_pull and exec_push directives belong to the RTMP Nginx module:


The Nginx shipped with the kaltura-nginx package includes this module since the 12.4.0 release, which had Nginx version of 1.10.2-1.

If you are using an older version of the package then you will not have this module. What version do you have and what is the error you are getting?

As for your question:

Who would know if not me? I am the one doing it, after all:)

The full specs for all Kaltura CE are publicly available so you can see them here:
RPM spec file:


And specifically, this is the configure command:

deb rules:

@jess

I have updated to the lastest version of Kaltura and I have customized the configuration file to include links to stream a single live stream from the RTSP source as described. I must assume the syntax is fine as I get no errors when I start NGINX. The VODs play fine via Kaltura but I am not able to get playback of the configured Live Stream. Even after customizing the port so their is no conflict.

My searches on the web show that a few people have claim to have gotten NGINX to ingest the RTSP live feed but not really clear on how but the issue that most of them report is the same. Basically, the process dies when you configure multiple streams. Either processing memory issue. I am not sure as the notes were very vage.

Unless you know the proper Syntax to use to have the NIGNX ingest the individual live stream them be allowed to play the stream back via the Kaltura Player as shown in my sample then currently this version does not allow use of live streams in RTSP format.

@hiphopservers,

Our default configuration does not support ingesting RTSP streams nor did our documentation ever stated that we do, so I don’t see how your report can be considered a bug.
We DO support ingestion of live RTMP streams using the Nginx RTMP module and playback using HLS and DASH.
For that, there is some basic documentation here:

and a post I recently wrote here:


detailing the solution and configuration.

That said, I am willing to look into your configuration and try to help you with it, for that, the first step would be to include the full configuration blocks you’ve added and the steps you took when testing.

@jess

Shall I email these blocks to you or post them here without the IP, domain or other secure information? I will be providing a copy of my configuration file and full user stories so you can replicate my results. However, if you want to use my streams you will need to get sudo information and complete testing from my own host or provide IPs to your test host so I can authorize that IP to access the live streams from the source. The live streams are behind a secure firewall appliance. I will await your response.

Hi @hiphopservers,

Paste them here while masking sensitive info.
It should be enough for me to test on my own ENV.

I have previously posted the information related to my custom configuration. The caption configuration is the version that did not generate an error when restarting NGINX.

# RTMP configuration
rtmp {
    server {
        listen 1945; # Listen on standard RTMP port
	 listen 5554;
	 notify_method get;
	 record off;
        chunk_size 4000;

        # This application is to accept incoming stream
        application kLive {
                live on; # Allows live input from above
		 exec_options on;

            # Static pull is started at nginx start
            exec_pull ffmpeg -rtsp_transport tcp —i rtsp://usr_name:pswd@LIVE_CAMIP:IP_CAM_PORT/axis-media/media.amp?camera=1 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -f flv rtmp://NGiNX_HOST:PORT/$name name=camone;

            exec_push ffmpeg -rtsp_transport tcp —i rtsp://usr_name:pswd@LIVE_CAMIP:IP_CAM_PORT/axis-media/media.amp?camera=2 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -f flv rtmp://NGiNX_HOST:PORT/$name name=camtwo;

                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/;


        }
    }

After getting NGINX stated I use the URL format descibed in the documentation to attempt to stream the live stream. I did not see any errors nor am I clear where to look for such errors. These live feeds are only availabe in RTPS format. I am not able to convert them to RTMP without Wowza at this time.

The success path is to 1st be able to configure multiple source URLs from a fix source which allow ingestion of RTPS streams. Currently, Kaltura CE does not have the ablity to configure multiple LIVE stream direct source via NGINX and notes I have read on the topic suggest NGINX has issues processing multiple LIVE sources configured in this manner. I would assume that is a resource intensive method. NGINX would have to encode each live stream before passing it to the playback application.

Your ENV would need to be able to provide multiple direct sources such as IP cameras in RTPS format, then allow you to feed that source for ingestion and encoding by NGINX for playback through Kaltura CE. Taking note these sources are password protected and configured behind a firewall appliance to limit connectivity to the streams to specific machine IPs.

@jess

I am still trying to configure NGINX to ingest LIVE RTSP streams and convert them to RTMP to pass them to Kaltura CE for playback by the end users. As shown in my previous NGINX configuration sample I am still have not been able to get the streams to playback. I am sure the installation is working properly because I have tested LIVE streaming over RTMP from my desktop and a mobile device and have been able to view the stream.

However, I am not able to include any combination of the following commands to generate a live RTMP stream from my RTSP source device using NGINX to playback using Kaltura CE.

`           exec_pull ffmpeg -rtsp_transport tcp —i rtsp://usr_name:pswd@LIVE_CAMIP:IP_CAM_PORT/axis-media/media.amp?camera=2 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -f flv rtmp://NGiNX_HOST:PORT/$name name=camtwo;`
            exec_push ffmpeg -rtsp_transport tcp —i rtsp://usr_name:pswd@LIVE_CAMIP:IP_CAM_PORT/axis-media/media.amp?camera=2 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -f flv rtmp://NGiNX_HOST:PORT/$name name=camtwo;

Most online documentation suggests using the pull method rather than push but I think this is specifically related to the encoding commands needed to get the desired results. I also tried this command set but it was not successful either.

            exec_pull ffmpeg -i rtsp://user_name:pswd@LIVE_CAM_HOST:PORT/axis-media/media.amp?videocodec=h264&streamprofile=balanced&camera=1 -threads 2 -f flv -r 25 -s 1280x720 -an rtmp://NGiNX_HOST:PORT/APP_NAME/CAM_NAME;

If you are able to find a success path to configure static sources into NGINX to allow playback using Kaltura CE this would make Kaltura CE a true All In One solution. As of now to get this to work I have to feed the live stream into Wowza to encode before serving the stream from Wowza into Kaltura.

@jess

From what I can tell after reviewing support group threads and other sites like Stackflow this issue could be specific to the ffmpeg configuration. Now, what I am not sure about it what configuration settings if any are missing to allow transcoding of the rtsp stream. The caption site shows examples I tried to use on command line with mpeg and I did not get the same results.

https://groups.google.com/forum/#!searchin/nginx-rtmp/rtsp$20nginx$20rtmp|sort:relevance/nginx-rtmp/iuKgNa3I2hs/VEPPaL6BAAAJ

I ran a command simalar to the one caption from command line:

ffmpeg -rtsp_transport tcp —i rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?videocodec=h264&streamprofile=balanced&camera=1 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -c copy -f flv rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name;

the results I got are as follows:

# ffmpeg -rtsp_transport tcp —i rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?videocodec=h264&streamprofile=balanced&camera=1 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -c copy -f flv rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name;
[7] 18308
[8] 18309
-bash: -c: command not found
[8]   Done                    streamprofile=balanced
[root@tig03 ~]# ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
  configuration: --prefix=/opt/kaltura/ffmpeg-3.2 --libdir=/opt/kaltura/ffmpeg-3.2/lib --shlibdir=/opt/kaltura/ffmpeg-3.2/lib --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -I/opt/kaltura/include' --extra-ldflags=-L/opt/kaltura/lib --disable-devices --enable-bzlib --enable-libgsm --enable-libmp3lame --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-avisynth --enable-libxvid --enable-filter=movie --enable-avfilter --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libvpx --enable-libspeex --enable-libass --enable-postproc --enable-pthreads --enable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --enable-gpl --enable-pthreads --enable-swscale --enable-vdpau --enable-bzlib --disable-devices --enable-filter=movie --enable-version3 --enable-indev=lavfi --enable-x11grab
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100

This is all the output I got from the command. I am still trying other combinations as I am pretty sure if I can get ffmpeg to successfully return output simular to the example provided. It will ingest the live feed and become available for playback.

@jess

So I noticed

this is a trulicated portion of the URL provided and I also notice in the example the ‘&’ options are not passed. So I amended the url to basic information.

ffmpeg -rtsp_transport tcp —i rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -c copy -f flv rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name;

This command now returns the following error.

ffmpeg -i rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -c copy -f flv rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name;

ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
  configuration: --prefix=/opt/kaltura/ffmpeg-3.2 --libdir=/opt/kaltura/ffmpeg-3.2/lib --shlibdir=/opt/kaltura/ffmpeg-3.2/lib --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -I/opt/kaltura/include' --extra-ldflags=-L/opt/kaltura/lib --disable-devices --enable-bzlib --enable-libgsm --enable-libmp3lame --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-avisynth --enable-libxvid --enable-filter=movie --enable-avfilter --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libvpx --enable-libspeex --enable-libass --enable-postproc --enable-pthreads --enable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --enable-gpl --enable-pthreads --enable-swscale --enable-vdpau --enable-bzlib --disable-devices --enable-filter=movie --enable-version3 --enable-indev=lavfi --enable-x11grab
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
[NULL @ 0xf5cfa0] Unable to find a suitable output format for '—i'
—i: Invalid argument

Clearly, I am on the right track with figuring out why the stream is not being displayed properly. I am pretty sure it is because ffmpeg is not process the stream and passing it to NGINX to stream.

I have figured out why I got the invalid error. Since I copy and pasted the command from a site it had a hyphen rather than an English dash. After changing the command to this I got a new error message.

#ffmpeg -rtsp_transport tcp -i rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -c copy -f flv rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name;

ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
  configuration: --prefix=/opt/kaltura/ffmpeg-3.2 --libdir=/opt/kaltura/ffmpeg-3.2/lib --shlibdir=/opt/kaltura/ffmpeg-3.2/lib --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -I/opt/kaltura/include' --extra-ldflags=-L/opt/kaltura/lib --disable-devices --enable-bzlib --enable-libgsm --enable-libmp3lame --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-avisynth --enable-libxvid --enable-filter=movie --enable-avfilter --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libvpx --enable-libspeex --enable-libass --enable-postproc --enable-pthreads --enable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --enable-gpl --enable-pthreads --enable-swscale --enable-vdpau --enable-bzlib --disable-devices --enable-filter=movie --enable-version3 --enable-indev=lavfi --enable-x11grab
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, rtsp, from 'rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.033367, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, smpte170m/smpte170m/bt709, progressive), 704x480 [SAR 10:11 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
Output #0, flv, to 'rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name':
  Metadata:
    title           : Media Presentation
    encoder         : Lavf57.56.100
    Stream #0:0: Video: h264 (Main) ([7][0][0][0] / 0x0007), yuvj420p(pc, smpte170m/smpte170m/bt709, progressive), 704x480 [SAR 10:11 DAR 4:3], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[flv @ 0x2209a00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
av_interleaved_write_frame(): Broken pipe
Error writing trailer of rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name: Broken pipeframe=    1 fps=0.0 q=-1.0 Lsize=      10kB time=00:00:00.00 bitrate=79280.0kbits/s speed=4.27x
video:9kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.068123%
Conversion failed!

I also re-ran the command with a the ‘-v debug’ option and got this:

#ffmpeg -v debug -rtsp_transport tcp -i rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1 -vcodec libx264 -vprofile baseline -g 10 -acodec libfaac -ar 44100 -ac 1 -c copy -f flv rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name;

ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
  configuration: --prefix=/opt/kaltura/ffmpeg-3.2 --libdir=/opt/kaltura/ffmpeg-3.2/lib --shlibdir=/opt/kaltura/ffmpeg-3.2/lib --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPICall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -I/opt/kaltura/include' --extra-ldflags=-L/opt/kaltura/lib --disable-devices --enable-bzlib --enable-libgsm --enable-libmp3lame --enable-libschroedinger --es --enable-libx264 --enable-libx265 --enable-avisynth --enable-libxvid --enable-filter=movie --enable-avfilter --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libvpx --enable-libspeex --enable-libass --enable-postproc --enable-pthrred --enable-gpl --disable-debug --disable-optimizations --enable-gpl --enable-pthreads --enable-swscale --enable-vdpau --enable-bzlib --disable-devices --enable-filter=movie --enable-version3 --enable-indev=lavfi --enable-x11grab
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'tcp'.
Reading option '-i' ... matched as input file with argument 'rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1'.
Reading option '-threads' ... matched as AVOption 'threads' with argument '2'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '25'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '1280x720'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option '-vprofile' ... matched as AVOption 'vprofile' with argument 'baseline'.
Reading option '-g' ... matched as AVOption 'g' with argument '10'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfaac'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '44100'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '1'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1.
Successfully parsed a group of options.
Opening an input file: rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1.
[tcp @ 0x23effc0] No default whitelist set
[rtsp @ 0x23edf60] SDP:
v=0
o=- 1147797149021282 1147797149021282 IN IP4 50.242.199.138
s=Media Presentation
e=NONE
b=AS:50000
t=0 0
a=control:rtsp://HOST-IP:PORT/axis-media/media.amp?camera=1    a=range:npt=0.000000-
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:50000
a=framerate:30.0
a=transform:1.000000,0.000000,0.000000;0.000000,0.909091,0.000000;0.000000,0.000000,1.000000
a=control:rtsp://HOST-IP:PORT/axis-media/media.amp/trackID=1?camera=1
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; profile-level-id=4D0029; sprop-parameter-sets=Z00AKeKQFge2BqwYBBuHiRFQ,aO48gA==
Failed to parse interval end specification ''
[rtsp @ 0x23edf60] video codec set to: h264
[rtsp @ 0x23edf60] RTP Packetization Mode: 1
[rtsp @ 0x23edf60] RTP Profile IDC: 4d Profile IOP: 0 Level: 29
[rtsp @ 0x23edf60] Extradata set to 0x23f03d0 (size: 30)
[rtsp @ 0x23edf60] setting jitter buffer size to 0
[rtsp @ 0x23edf60] hello state=0
Failed to parse interval end specification ''
[h264 @ 0x23f1760] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x23f1760] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x23f1760] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x23f1760] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x23f1760] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x23f1760] Reinit context to 704x480, pix_fmt: yuvj420p
[h264 @ 0x23f1760] nal_unit_type: 1, nal_ref_idc: 2
    Last message repeated 5 times
[rtsp @ 0x23edf60] All info found
[rtsp @ 0x23edf60] rfps: 29.250000 0.019163
[rtsp @ 0x23edf60] rfps: 29.333333 0.014981
[rtsp @ 0x23edf60] rfps: 29.416667 0.011313
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 29.500000 0.008159
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 29.583333 0.005520
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 29.666667 0.003394
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 29.750000 0.001783
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 29.833333 0.000686
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 29.916667 0.000103
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 30.000000 0.000035
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 60.000000 0.000138
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 120.000000 0.000553
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 240.000000 0.002210
    Last message repeated 1 times
[rtsp @ 0x23edf60] rfps: 29.970030 0.000000
[rtsp @ 0x23edf60] rfps: 59.940060 0.000000
[rtsp @ 0x23edf60] Setting avg frame rate based on r frame rate
Input #0, rtsp, from 'rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.033378, bitrate: N/A
    Stream #0:0, 28, 1/90000: Video: h264 (Main), 1 reference frame, yuvj420p(pc, smpte170m/smpte170m/bt709, progressive, left), 704x480 [SAR 10:11 DAR 4:3], 0/1, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
Successfully opened the file.
Parsing a group of options: output file rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name.
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 25.
Applying option s (set frame size (WxH or abbreviation)) with argument 1280x720.
Applying option an (disable audio) with argument 1.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libx264.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument libfaac.
Applying option ar (set audio sampling rate (in Hz)) with argument 44100.
Applying option ac (set number of audio channels) with argument 1.
Applying option c (codec name) with argument copy.
Applying option f (force format) with argument flv.
Successfully parsed a group of options.
Opening an output file: rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name.
[rtmp @ 0x2516f00] No default whitelist set
[tcp @ 0x23f0740] No default whitelist set
[rtmp @ 0x2516f00] Handshaking...
[rtmp @ 0x2516f00] Type answer 3
[rtmp @ 0x2516f00] Server version 13.14.10.13
[rtmp @ 0x2516f00] Proto = rtmp, path = /kLive/stream_name, app = kLive, fname = stream_name
[rtmp @ 0x2516f00] Server bandwidth = 5000000
[rtmp @ 0x2516f00] Client bandwidth = 5000000
[rtmp @ 0x2516f00] New incoming chunk size = 4096
[rtmp @ 0x2516f00] Releasing stream...
[rtmp @ 0x2516f00] FCPublish stream...
[rtmp @ 0x2516f00] Creating stream...
[rtmp @ 0x2516f00] Sending publish command for 'stream_name'
Successfully opened the file.
Output #0, flv, to 'rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name':
  Metadata:
    title           : Media Presentation
    encoder         : Lavf57.56.100
    Stream #0:0, 0, 1/1000: Video: h264 (Main), 1 reference frame ([7][0][0][0] / 0x0007), yuvj420p(pc, smpte170m/smpte170m/bt709, progressive, left), 704x480 (0x0) [SAR 10:11 DAR 4:3], 0/1, q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[flv @ 0x251a4e0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
av_interleaved_write_frame(): Broken pipe
No more output streams to write to, finishing.
Error writing trailer of rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name: Broken pipeframe=    1 fps=0.0 q=-1.0 Lsize=       9kB time=00:00:00.00 bitrate=75080.0kbits/s speed=3.68x
video:9kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.245325%
Input file #0 (rtsp://usr_name:usr_pswd@HOST-IP:PORT/axis-media/media.amp?camera=1):
  Input stream #0:0 (video): 1 packets read (9090 bytes);
  Total: 1 packets (9090 bytes) demuxed
Output file #0 (rtmp://NGINX_HOST:NGINX_PORT/kLive/stream_name):
  Output stream #0:0 (video): 1 packets muxed (9090 bytes);
  Total: 1 packets (9090 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x24a0b20] Statistics: 0 seeks, 2 writeouts
[rtmp @ 0x2516f00] UnPublishing stream...
[rtmp @ 0x2516f00] Deleting stream...
Conversion failed!

My specific errors would need to be fixed by updating the configuration at time of compiling of ffmpeg to resolve both issues. Specifically, the timestamp issue and issue with the error writing trailer. If these issues are resolved then I add all my IP camera RSTP streams to the NGINX configuration file and pull them into NGINX to hand off to Kaltura CE for streaming without using Wowza.

@jess

Is it possible this ffmpeg configuration issue with missing or reconfiguration of the settings causing the caption errors can be fixed in the next release?

Hi @hiphopservers,

I’ll try to allocate some time to erect a similar ENV so I can debug it.

Until then, you are more than welcome to experiment with the ffmpeg build and produce your own kaltura-ffmepg package for testing.
The full spec used for building the kaltura-ffmpeg RPM is here:


and building it requires the following devel packages:
kaltura-a52dec-dev
kaltura-lame-dev
kaltura-libopencore-amr-dev
kaltura-librtmp-dev
kaltura-x264-dev

Specs for these are also available under https://github.com/kaltura/platform-install-packages/blob/Lynx-12.17.0/RPM/SPECS

A basic howto for building the RPMs can be found here:

If you arrive at a working configuration, feel free to let me know so I can examine it and if it works and causes no regressions, I’ll be happy to merge it and release a new official package.

Alternatively, if you want to speed things up, you can create a Docker container with the same packages and configuration as you use on your Prod. ENV and send me a private message with how to obtain it. This will save some time and will make debugging easier.