IP Camera as source for the client


Anyone knows if in the client there is a way to set and url like: rtsp:// to get a feed from a camera in an easy way?
I added this in the config file

udp:// -vcodec libx264 -tune zerolatency -preset ultrafast -crf 25 -format mpegts -vf scale=240:180

and tried to make it run from my little client with the following line but it did not work eheh

CG_Play(10, “udp://”)

Would be great if the Caspar Client has already a function :slight_smile:

Thank you in advance for the help!

What you added in the config file would create a consumer (output), not a producer (source).

In the casparcg client you could add a custom command, with a play command as such: PLAY 1-10 rtsp://

1 Like

Hi, I tried doing this:

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim tmpl As Template = New Template
        _Caspar.CG_Add(10, "udp://", tmpl, False)
        _Caspar.CG_Play(1, 10)
End Sub

I am not sure about how to create a custom command for Caspar…could you make me an example? thank you very much!


It’s not a CG command, as it is NOT a template. It would either be:

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        _Caspar.Play(10, "udp://", False)
End Sub

or just add the text:

PLAY 1-10 rtsp://

into the “Play” field of the custom command in the official client.

Hi didi!

This is the response of cg server:

[2019-01-04 13:55:27.170] [17832] [info]    Sent message to 501 PLAY FAILED\r\n
[2019-01-04 13:56:17.786] [7884]  [info]    Received message from PLAY 1-10 rtsp://\r\n
[2019-01-04 13:56:17.938] [17832] [error]   [ffmpeg] [rtsp @ 1B71D440] method DESCRIBE failed: 401 Unauthorized
[2019-01-04 13:56:18.133] [17832] [error]   producer\input\input.cpp(279): Throw in function caspar::ffmpeg::`anonymous-namespace'::<lambda9>::operator ()
Dynamic exception type: class boost::exception_detail::clone_impl<struct caspar::ffmpeg::ffmpeg_error>
std::exception::what: Unknown exception
[struct boost::errinfo_api_function_ *] = avformat_open_input(&weak_context, narrow(resource_name).c_str(), nullptr, &format_options)
1094995529, "Unknown error"[struct caspar::tag_msg_info *] = Invalid data found when processing input
[struct caspar::tag_source_info *] = rtsp://

[2019-01-04 13:56:19.161] [17832] [error]   File not found. No match found for parameters. Check syntax:rtsp://
[2019-01-04 13:56:19.243] [17832] [warning] Failed to execute command: PlayCommand on AMCPCommandQueue Channel 1 for TCP Port 5250
[2019-01-04 13:56:19.534] [17832] [info]    Sent message to 501 PLAY FAILED\r\n

This is the format of the video output.

Is there a way to fix it?

Thanks a lot :slight_smile:

I have no idea, probably @mint knows more. What format does that stream have?

[2019-01-04 13:56:17.938] [17832] [error]   [ffmpeg] [rtsp @ 1B71D440] method DESCRIBE failed: 401 Unauthorized

That is the most interesting part of the log. Seems like ffmpeg isn’t allowed by the IP Camera to open the stream. Are you able to open it in VLC or command line ffmpeg?

Hi! Yes I’ve just tried, it looks vlc is not able to play it as well.
Actually asks me username and password…adding them still not able to load…Camera network access issue

Hi @mint

I manage to do a step up eheh
I removed privileges from the streaming and now connects to the camera.
I am still receiving an error message:

[2019-01-07 07:57:43.827] [16412] [info]    Received message from PLAY 1-10 rtsp://\r\n
[2019-01-07 07:57:45.000] [13908] [info]    ffmpeg[live.sdp|1920x1080i0.00|0/0] [video-decoder] H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[2019-01-07 07:57:45.025] [13908] [debug]   [audio-decoder] PCM mu-law / G.711 mu-law Selected channel layout MONO
[2019-01-07 07:57:45.057] [13908] [info]    ffmpeg[live.sdp|1920x1080i0.00|0/0] [audio-decoder] PCM mu-law / G.711 mu-law
[2019-01-07 07:57:45.094] [13908] [info]    transition[empty=>ffmpeg[live.sdp|1920x1080i0.00|0/0]] Initialized.
[2019-01-07 07:57:45.124] [13908] [debug]   Executed command: PlayCommand
[2019-01-07 07:57:45.142] [13908] [info]    Sent message to 202 PLAY OK\r\n
[2019-01-07 07:57:45.162] [16464] [info]    transition[empty=>ffmpeg[live.sdp|1920x1080i0.00|0/0]] End Of File.
[2019-01-07 07:57:45.195] [16464] [warning] [frame_muxer] Auto-transcode: Failed to detect display-mode.
[2019-01-07 07:57:45.223] [16464] [error]   Dynamic exception type: class boost::bad_rational
std::exception::what: bad rational: zero denominator

[2019-01-07 07:57:45.263] [16464] [info]    transition[empty=>ffmpeg[live.sdp|1920x1080p0.00|0/1]] Uninitialized.

It looks like is not able to understand the format.
I am running it by caspar cg client.

Thank you in advance!

OBS it works in VLC


It’s not detecting the framerate. See if you can make sure that the camera outputs at a fixed framerate.

Hi @hreinnbeck
Unfortunately it seems that this models I got here permit only to set a max framerate that change automatically.
I will see if possible with other models.
Thank you for your quick feedback! :slight_smile:

It might be tricky / not really a production-state but it you open your RTMP with VLC and then uses VLC to restream it to a fixed framerate this could do the job :slight_smile:

Thank you @timmalos this is actually the only solution for the framerate issue of my cameras :slight_smile:

Anyone has a good tip about a cheap IP camera to use with caspar for testing?
The solution using vlc was working but I would prefer to avoid to use it

Thank you in advance!


Interested too.

Hi Pascoual,

I fixed the issue using OBS.
Just add a media source to OBS and use the NDI converter.
Then install the iVGA to NDI of tricaster to the CasparCG and add it as a layer on OBS.
You can find online the guidelines.

In this way you can use any kind of IP camera on the market :slight_smile:

1 Like