IP Camera as source for the client

config
client

#1

Hello!

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

udp://127.0.0.1:3454 -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://127.0.0.1:3454”)

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

Thank you in advance for the help!


#2

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://127.0.0.1:345


#3

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://127.0.0.1:3454", 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!

Federico


#4

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://127.0.0.1:3454", False)
End Sub

or just add the text:

PLAY 1-10 rtsp://127.0.0.1:345

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


#5

Hi didi!

This is the response of cg server:

[2019-01-04 13:55:27.170] [17832] [info]    Sent message to 127.0.0.1: 501 PLAY FAILED\r\n
[2019-01-04 13:56:17.786] [7884]  [info]    Received message from 127.0.0.1: PLAY 1-10 rtsp://127.0.0.1:3454\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://127.0.0.1:3454

[2019-01-04 13:56:19.161] [17832] [error]   File not found. No match found for parameters. Check syntax:rtsp://127.0.0.1:3454
[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 127.0.0.1: 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:


#6

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


#7
[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?


#8

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


#9

Hi @balte

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 127.0.0.1: PLAY 1-10 rtsp://192.168.0.97:554/live.sdp\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 127.0.0.1: 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

Federico


#10

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


#11

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:
Federico


#12

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:


#13

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