CasparCG / server

CasparCG Server is a Windows and Linux software used to play out professional graphics, audio and video to multiple outputs. It has been in 24/7 broadcast production since 2006. Ready-to-use downloads are available under the Releases tab https://casparcg.com.
GNU General Public License v3.0
901 stars 269 forks source link

STREAM Exception on Stream Failed #1187

Open sirfnomi opened 5 years ago

sirfnomi commented 5 years ago

Description if there is no any listener or streaming failed on other side of STREAM casparcg return exception and did'nt remove instance of STREAM

AMCP Command ADD 1 STREAM tcp://111.111.20.201:5001 -codec:v libx264 -b:v 2500k -minrate:v 2500k -maxrate:v 2500k -bufsize:v 3000K -b:a 128k -ar:a 48000 -format mpegts -tune:v zerolatency -preset:v medium

Log

[2019-03-08 22:42:15.035] [info] Received message from Console: ADD 1 STREAM tcp://111.111.20.201:5001 -codec:v libx264 -b:v 2500k -minrate:v 2500k -maxrate:v 2500k -bufsize:v 3000K -b:a 128k -ar:a 48000 -format mpegts -tune:v zerolatency -preset:v medium -flags:v +ilme+ildct -filter:v scale=out_color_matrix=bt601:out_range=tv,fps=50,interlace,format=yuv420p,eq=brightness=-0.02\r\n [2019-03-08 22:42:15.036] [info] ffmpeg[tcp://111.111.20.201:5001] Initialized. [2019-03-08 22:42:15.039] [warning] [ffmpeg] [libx264 @ 000000001893BC40] interlace + weightp is not implemented [2019-03-08 22:42:15.039] [warning] [2019-03-08 22:42:15.039] [info] [ffmpeg] [libx264 @ 000000001893BC40] using SAR=64/45 [2019-03-08 22:42:15.039] [info]
[2019-03-08 22:42:15.040] [info] [ffmpeg] [libx264 @ 000000001893BC40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 [2019-03-08 22:42:15.040] [info]
[2019-03-08 22:42:15.043] [info] [ffmpeg] [libx264 @ 000000001893BC40] profile High, level 3.0, 4:2:0, 8-bit [2019-03-08 22:42:15.043] [info]
[2019-03-08 22:42:20.144] [error] [ffmpeg] [tcp @ 00000000025AF800] Connection to tcp://111.111.20.201:5001 failed: Error number -138 occurred [2019-03-08 22:42:20.144] [error]
[2019-03-08 22:42:25.246] [error] [ffmpeg] [tcp @ 00000000025AF800] Connection to tcp://111.111.20.201:5001 failed: Error number -138 occurred [2019-03-08 22:42:25.246] [error]
[2019-03-08 22:42:25.267] [error] Exception: C:\Program Files (x86)\Jenkins\workspace\casparcg-server-dep\master\src\modules\ffmpeg\consumer\ffmpeg_consumer.cpp(578): Throw in function auto cdecl caspar::ffmpeg::ffmpeg_consumer::initialize::::operator ()(void) const [2019-03-08 22:42:25.267] [error] Dynamic exception type: class boost::exception_detail::clone_impl [2019-03-08 22:42:25.267] [error] [struct boost::errinfo_apifunction __ptr64] = avio_open2(&oc->pb, full_path.string().c_str(), 2, nullptr, &dict) [2019-03-08 22:42:25.267] [error] [struct boost::errinfoerrno ptr64] = 138, "Unknown error" [2019-03-08 22:42:25.267] [error] [struct caspar::tag_stacktrace_info * __ptr64] = 0# 0x000000013F418E5E in casparcg [2019-03-08 22:42:25.267] [error] 1# 0x000000013F446D60 in casparcg [2019-03-08 22:42:25.267] [error] 2# 0x000000013F5F13F6 in casparcg [2019-03-08 22:42:25.267] [error] 3# 0x000000013F5F43C0 in casparcg [2019-03-08 22:42:25.267] [error] 4# 0x000000013F413B99 in casparcg [2019-03-08 22:42:25.267] [error] 5# crt_at_quick_exit in ucrtbase [2019-03-08 22:42:25.267] [error] 6# BaseThreadInitThunk in kernel32 [2019-03-08 22:42:25.267] [error] 7# RtlUserThreadStart in ntdll [2019-03-08 22:42:25.267] [error]
[2019-03-08 22:42:25.267] [error]
[2019-03-08 22:42:25.267] [error] 0# 0x000000013F418E5E in casparcg [2019-03-08 22:42:25.267] [error] 1# 0x000000013F41878F in casparcg [2019-03-08 22:42:25.267] [error] 2# 0x000000013F8F1787 in casparcg [2019-03-08 22:42:25.267] [error] 3# _C_specific_handler in VCRUNTIME140 [2019-03-08 22:42:25.267] [error] 4# _FrameUnwindFilter in VCRUNTIME140 [2019-03-08 22:42:25.267] [error] 5# RtlRestoreContext in ntdll [2019-03-08 22:42:25.267] [error] 6# 0x000000013F5025BA in casparcg [2019-03-08 22:42:25.267] [error] 7# 0x000000013F502FF5 in casparcg [2019-03-08 22:42:25.267] [error] 8# 0x000000013F4F934C in casparcg [2019-03-08 22:42:25.267] [error] 9# 0x000000013F4FC990 in casparcg [2019-03-08 22:42:25.267] [error] 10# 0x000000013F413B99 in casparcg [2019-03-08 22:42:25.267] [error] 11# crt_at_quick_exit in ucrtbase [2019-03-08 22:42:25.267] [error] 12# BaseThreadInitThunk in kernel32 [2019-03-08 22:42:25.267] [error] 13# RtlUserThreadStart in ntdll [2019-03-08 22:42:25.267] [error]

Remove AMCP Log

[2019-03-08 22:52:57.804] [info] Received message from Console: REMOVE 1 STREAM tcp://111.111.20.201:5001\r\n

404 REMOVE FAILED

[2019-03-08 22:52:57.805] [info] ffmpeg[tcp://111.111.20.201:5001] Uninitialized.

Diag diag

euphoricz commented 3 years ago

This also causes a rather large memory leak every time this orphaned stream occurs.

Our software is successfully listening and receiving however closing the incoming stream before sending the command to remove the stream causes this to occur as well.

We have been forced to send the AMCP command to remove the stream and rely on ccg to close the stream itself.