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
911 stars 268 forks source link

Layer Ordering in Stop Command #304

Closed WASP3D closed 6 years ago

WASP3D commented 10 years ago

stopcmd

Hello

Please refer to the snapshot attached regarding the stop command issue. Here we added three video files in different layers. AMB video file is in layer 10 and TESTPATTERNS/1080I5000_TEST is in layer 11. Firstly we play layer 10 file(AMB) and then we play layer 11 file(1080I5000_TEST) . We noticed that if we select AMB file and call STOP command from playout the STOP command received from client has file name TESTPATTERNS/1080I5000 for layer 10 even though the file in layer 10 is AMB.

Why the stop command is not received for AMB file in layer 10?

Regards Manish Narang

HellGore commented 10 years ago

I don't even recognize the logging output from the server. Are you running a modified version of CasparCG? "Command Recvd" is not a logging output I'm familiar with, I would expect something like "Received message from...".

"Three video files in different layers" -- Three video files but two of them on the same layer is what I'm seeing.

Please clarify your issue.

WASP3D commented 10 years ago

parse

The "Command recvd" logging is added in parse call since we are extracting file name from command so we added it there to check the complete command. The issue is that if we have two video files in different layers for e.g say AMB.mov in layer 10 and Test .mov in layer 11 and we fire stop command from playout (selecting layer 10) the command received for that layer 10 contains file name test.mov instead of AMB.mov (as shown in previous snapshot).

Regards Manish Narang

HellGore commented 10 years ago

pData does not per definition point to a null terminated string so your logging statement is in fact very dangerous, you are seeing additional "garbage" data, you could try changing the line to:

CASPAR_LOG(info) << L"Command Recvd - " << std::wstring(pData, charCount) << "\\r\\n";

What you are seeing are rests from a previous send, since you are reading past charCount.

There is no guarantee that a complete AMCP command results in a single call to Parse, one command could be split into multiple calls to Parse or a single call to Parse could contain parts of multiple AMCP commands. So your "Command Recvd" logging will not represent exactly one AMCP command.

The existing "Received message from " logging in AMCPProtocolStrategy::ProcessMessage on the other hand will do exactly that.

WASP3D commented 10 years ago

Thanks for the information. By using the wstring manipulation we get command as STOP 1-10 or CG 1-20 STOP 1. Actually our producer is template based and we want to extract the template/filename name whenever PLAY or STOP command is received. We get the filename in load command but not in PLAY and STOP command.

Regards Manish Narang

HellGore commented 10 years ago

A producer does not know about the AMCP lifecycle (PLAY and STOP) other than being called every frame on frame_producer::receive after a PLAY has been issued and being destructed after a STOP.

Could you tell me more about what you are trying to achieve with your producer? It seems like you are doing something wrong if you need to add additional logging in AMCPProtocolStrategy in order to somehow help the implementation of a new producer.

Just to be clear you are talking about a subclass of caspar::core::frame_producer when you say producer, right?