Streaming with CasparCG

streaming

#1

Hi Guys,

I have a question about streaming with CasparCG-Server. I read alot of comments how to add a stream with ffmpeg. But i have a problem to fill the stream with content.

I have a setup like this:

  • CasparCG-Server 2.2 stable
  • VLC - Player

I add the Stream with this command:
ADD 2 STREAM udp://localhost:1234 -format mpegts -vcodec libx264 -crf 0 -tune zerolatency -preset ultrafast

and im setting up a reciever on VLC with: udp://@:1234

After this, VLC is recieving from CasparCG but i cant see something. So I guess, that my stream from Caspar is empty.
Now my question is: How can I add Content to the stream?

Maybe my thoughts are on a wrong way and you guys can help me. Our later goal of streaming is to stream an incoming SDI-signal to various IP-adresses.

Thanks for helping!

Norman


#2

first of all with this ADD 2 command you are going to stream Channel 2 so confirm that your channel 2 is not empty.
second i don’t think that your streaming parameters are acceptable with 2.2 build. In server 2.2 ffmpeg updated with updated version so parameters are change in 2.2 so i’m sure you must be getting warning after adding stream check console for this.

you can try with

ADD 1 STREAM udp://localhost:1234 -format mpegts -codec:v libx264 -crf:v 0 -tune:v zerolatency -preset:v ultrafast


#3

Yes i know - but thanks for this hint.

for me first testcase i just added a picture to layer 1 on channel 2. But i couldnt see it on my stream.

I tried this command and i didnt get any warnings like beofre. Thanks for that. But now vlc cant recieve anything and stays in search mode.

Maybe i have to smth in my config? I still have the standard one.

Am I getting it right? Normally you fill your layer with content as you want and then you add a stream with this command to your channel and it should now stream your whole channel content?

Thanks for your reply and help!

Greetings,
Norman


#4

check console window for info/error

i’m testing it right now with same command and working fine on VLC

console info is:

[2019-04-10 20:42:48.106] [info] Received message from Console: ADD 1 STREAM udp://localhost:1234 -format mpegts -codec:v libx264 -crf:v 0 -tune:v zerolatency -preset:v ultrafast\r\n
#202 ADD OK
[2019-04-10 20:42:48.108] [info] ffmpeg[udp://localhost:1234] Initialized.
[2019-04-10 20:42:48.109] [info] [ffmpeg] [libx264 @ 0000000002742E40] using SAR=64/45
[2019-04-10 20:42:48.109] [info]
[2019-04-10 20:42:48.114] [info] [ffmpeg] [libx264 @ 0000000002742E40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[2019-04-10 20:42:48.114] [info]
[2019-04-10 20:42:48.117] [info] [ffmpeg] [libx264 @ 0000000002742E40] profile High 4:4:4 Predictive, level 3.1, 4:2:2, 8-bit
[2019-04-10 20:42:48.117] [info]

config is your default preset like if you want to start streaming with server start you can set it in config settings.


#5

ok, I get the same console info like you. But my VLC is not recieving anything…

Anyways - thanks for your help!

Norman


#6

Test using “127.0.0.1” instead of localhost.


#7

Thanks for this idea - but its the same result :confused:

Norman


#8

Hi Guys - Im still struggling with streaming and CasparCG.

I get a weird exception, when i want to add a stream to youtube:

[2019-05-17 15:30:23.892] [info]    ffmpeg[rtmp://(Stream Name)@(Server URL)] Initialized.
[2019-05-17 15:30:23.893] [info]    [ffmpeg] [libx264 @ 0000018758520080] using SAR=1/1
[2019-05-17 15:30:23.893] [info]
[2019-05-17 15:30:23.894] [info]    [ffmpeg] [libx264 @ 0000018758520080] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[2019-05-17 15:30:23.894] [info]
[2019-05-17 15:30:23.896] [info]    [ffmpeg] [libx264 @ 0000018758520080] profile High 4:2:2, level 3.2, 4:2:2 8-bit
[2019-05-17 15:30:23.896] [info]
[2019-05-17 15:30:24.583] [error]   Exception: C:\Program Files (x86)\Jenkins\workspace\casparcg-server-dep\2.2.x\src\modules\ffmpeg\consumer\ffmpeg_consumer.cpp(580): Throw in function auto __cdecl caspar::ffmpeg::ffmpeg_consumer::initialize::<lambda_e201b6f5f8931444e6d9c1015de83729>::operator ()(void) const
[2019-05-17 15:30:24.583] [error]   Dynamic exception type: class boost::exception_detail::clone_impl<struct caspar::ffmpeg::ffmpeg_error_t>
[2019-05-17 15:30:24.583] [error]   [struct boost::errinfo_api_function_ * __ptr64] = avio_open2(&oc->pb, full_path.string().c_str(), 2, nullptr, &dict)
[2019-05-17 15:30:24.583] [error]   [struct boost::errinfo_errno_ * __ptr64] = 5, "Input/output error"
[2019-05-17 15:30:24.583] [error]   [struct caspar::tag_stacktrace_info * __ptr64] =  0# 0x00007FF780A598AE in casparcg
[2019-05-17 15:30:24.583] [error]    1# 0x00007FF780A88C50 in casparcg
[2019-05-17 15:30:24.583] [error]    2# 0x00007FF780C32DE6 in casparcg
[2019-05-17 15:30:24.583] [error]    3# 0x00007FF780C35450 in casparcg
[2019-05-17 15:30:24.583] [error]    4# 0x00007FF780A545C9 in casparcg
[2019-05-17 15:30:24.583] [error]    5# o_exp in ucrtbase
[2019-05-17 15:30:24.583] [error]    6# BaseThreadInitThunk in KERNEL32
[2019-05-17 15:30:24.583] [error]    7# RtlUserThreadStart in ntdll
[2019-05-17 15:30:24.583] [error]
[2019-05-17 15:30:24.583] [error]
[2019-05-17 15:30:24.583] [error]    0# 0x00007FF780A598AE in casparcg
[2019-05-17 15:30:24.583] [error]    1# 0x00007FF780A591DF in casparcg
[2019-05-17 15:30:24.583] [error]    2# 0x00007FF780F30F37 in casparcg
[2019-05-17 15:30:24.583] [error]    3# _C_specific_handler in VCRUNTIME140
[2019-05-17 15:30:24.583] [error]    4# _TypeMatch in VCRUNTIME140
[2019-05-17 15:30:24.583] [error]    5# RtlCaptureContext in ntdll
[2019-05-17 15:30:24.583] [error]    6# 0x00007FF780B476BA in casparcg
[2019-05-17 15:30:24.583] [error]    7# 0x00007FF780B480F5 in casparcg
[2019-05-17 15:30:24.583] [error]    8# 0x00007FF780B22E1D in casparcg
[2019-05-17 15:30:24.583] [error]    9# 0x00007FF780B26050 in casparcg
[2019-05-17 15:30:24.583] [error]   10# 0x00007FF780A545C9 in casparcg
[2019-05-17 15:30:24.583] [error]   11# o_exp in ucrtbase
[2019-05-17 15:30:24.583] [error]   12# BaseThreadInitThunk in KERNEL32
[2019-05-17 15:30:24.583] [error]   13# RtlUserThreadStart in ntdll
[2019-05-17 15:30:24.583] [error]

Following line is the command im using:
add 1 stream rtmp://(Stream Name)@(ServerURL) -format mpegts -codec:v libx264 -crf:v 0 -tune:v zerolatency -present:v ultrafast

I cant figure out what the problem is, maybe you can help me.

Thanks, Norman


#9

This is not a standard URI for RTMP: rtmp://(Stream Name)@(ServerURL)
Usually it is rtmp://SERVER/APPLICATION/STREAMNAME