Git Product home page Git Product logo

rtmfp-cpp's People

Contributors

zenomt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rtmfp-cpp's Issues

Discussion are not working creating an issue for Windows port here.

Greetings !

I started a Windows port but came to a roadblock because I have no experience with Socket porting from Unix to Windows but somehow I found the bits an pieces from around the web and added new files and modified CMakeLists.txt file to take into consideration WIN32 with vcpkg for Visual Studio 2019 project generation.

I hope that it is going to lead somewhere.

https://github.com/al-sabr/rtmfp-cpp/tree/win32-port

Best Regards

Replace OpenSSL by WolfSSL

Greetings again!

Since OpenSSL is an old library and not as performant as WolfSSL I thought to suggest to add an Adapter for it which will reduce the size and increase the performances of this library. I hope that this is a good idea that might inspire you.

Best regards

REDIRECTOR CRASH AS CLIENTS CALLED CLOSE.

Hi Thornburgh,
I've tested your redirector code in your example on CentOS7 and met a crash as many redirector's client disconnect (close) at the same time with the stack trace below. to specific, This is my test:

  • Run 30 relay connect to redirector and kill relay on CentOS7. rep rate : 7/10
  • This crash not happen in MacOS.

E20240911 14:01:58.894667 45021 ServerApp.cpp:248] *** SIGABRT (@0x3e90000afd5) received by PID 45013 (TID 0x7fe515295700) from PID 45013; stack trace: ***
E20240911 14:01:58.894979 45021 ServerApp.cpp:248] @ 0x7fe518019630 (unknown)
E20240911 14:01:58.895383 45021 ServerApp.cpp:248] @ 0x7fe516e30387 __GI_raise
E20240911 14:01:58.895720 45021 ServerApp.cpp:248] @ 0x7fe516e31a78 __GI_abort
E20240911 14:01:58.896059 45021 ServerApp.cpp:248] @ 0x7fe516e72ed7 __libc_message
E20240911 14:01:58.896251 45021 ServerApp.cpp:248] @ 0x7fe516e7b299 _int_free
E20240911 14:01:58.899547 45021 ServerApp.cpp:248] @ 0x6ee63a com::zenomt::List<>::~List()
E20240911 14:01:58.902670 45021 ServerApp.cpp:248] @ 0x6eb4a2 com::zenomt::rtmfp::RecvFlow::~RecvFlow()
E20240911 14:01:58.906158 45021 ServerApp.cpp:248] @ 0x6eb629 com::zenomt::rtmfp::RecvFlow::~RecvFlow()
E20240911 14:01:58.908824 45021 ServerApp.cpp:248] @ 0x6ef4ba _ZNSt19_Sp_counted_deleterIPN3com6zenomt5rtmfp8RecvFlowEZNS1_9share_refIS3_EESt10shared_ptrIT_EPS7_bEUlPNS1_6ObjectEE_SaIvELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv
E20240911 14:01:58.911636 45021 ServerApp.cpp:248] @ 0x702fd7 com::zenomt::rtmfp::Session::abortFlowsAndTimers()
E20240911 14:01:58.914172 45021 ServerApp.cpp:248] @ 0x7022b0 com::zenomt::rtmfp::Session::abort()
E20240911 14:01:58.917240 45021 ServerApp.cpp:248] @ 0x70bbb3 com::zenomt::rtmfp::Session::onCloseAckChunk()
E20240911 14:01:58.920346 45021 ServerApp.cpp:248] @ 0x70b155 com::zenomt::rtmfp::Session::onChunk()
E20240911 14:01:58.923573 45021 ServerApp.cpp:248] @ 0x6fde94 com::zenomt::rtmfp::ISession::onReceivePacket()
E20240911 14:01:58.926578 45021 ServerApp.cpp:248] @ 0x70a4d6 com::zenomt::rtmfp::Session::onReceivePacket()
E20240911 14:01:58.929595 45021 ServerApp.cpp:248] @ 0x6dfbcd com::zenomt::rtmfp::RTMFP::onReceivePacket()
E20240911 14:01:58.932370 45021 ServerApp.cpp:248] @ 0x6db518 com::zenomt::rtmfp::PosixPlatformAdapter::receiveOnePacket()
E20240911 14:01:58.932555 45021 ServerApp.cpp:248] @ 0x6db5cc std::_Function_handler<>::_M_invoke()
E20240911 14:01:58.935199 45021 ServerApp.cpp:248] @ 0x6c764d com::zenomt::EPollRunLoop::processActivatedItems()
E20240911 14:01:58.938537 45021 ServerApp.cpp:248] @ 0x6c72f0 com::zenomt::EPollRunLoop::run()
Do you have any insight for this crash ?

Thanks.

ENCRYPT DATA WITH GCM

Hi zenomt, Your example is using CBC to encrypt data between sessions. Can I replace it with GCM? is there any problem with GCM as in my research GCM has a better performance than CBC. Does GCM cause rtmfp overhead in some cases that I don't realize ?

Received wrong RTMP packet

Sometimes, RTMP player stops playing, I try to use ffplay to play an RTMP url from server and it dumps the error message:
RTMP packet size mismatch 52249 != 10815/1

At the first time, I think that maybe there is some wrong from the network, internet. But when I make a overload test, using many tccon to connect to server at the same time this error often occurs , the ffplay rtmp player hangs up and shows the message: "RTMP packet size mismatch xxxx != yyyyy1"

RTMFP costs so much cpu

Run tcserver -B 0.0.0.0:1935 -b 0.0.0.0:1936 and make a stress test for server.

The tcserver run with RTMFP which disables openssl by call EVP_enc_null() in
if( (not EVP_CipherInit_ex(m_ctx, EVP_enc_null(), NULL, (const unsigned char *)key, NULL, encrypt ? 1 : 0))
or (not EVP_CIPHER_CTX_set_padding(m_ctx, 0))
)
return false;
and:
m_ciphertextBuf = (uint8_t *)malloc(ENCRYPT_BUF_LENGTH + ENCRYPT_BUF_MARGIN);
m_plaintextBuf = m_ciphertextBuf + ENCRYPT_BUF_MARGIN;

I've tested, and it were ok for both client tcconn & tcserver to make sure that the crypto didnt costs any cpu.

  • Using ffmpeg to publish a channel 720p-1Mbps
  • Using 500 rtmfp clients to connect to the tcserver to play this channel., the cpu (1 core) gets 90-100%. When cpu get to 100% it start stuttering and client have the same.
  • Using 1000 rtmp clients to connect to the tcserver and play the same stream above, the cpu (1 core) gets only 60%.

I had 3 days to review to fix this problem but I havent found any solution yet. Please help me to fix this!

I think there is some this wrong on RTMFP, so it costs so much CPU.

P1: 500 - RTMFP clients
image

P2: 1000 - RTMP clients

image

Memory leaking while testing tcserver

Run tcserver -B 0.0.0.0:1935 -b 0.0.0.0:1936 now that tcserver use 1.2MB of memory
Using 100 rtmfp clients or more connect to a tcserver to play a stream, after that closing all these streams from each client. The memory of tcserver process increases to 3.9MB ...

After thousand of rtmfp connections & disconnect and now tcserver increases to 2GB memory.

Edit: I've found that when the client is killed or crashed (shutdown function is not called from client) to server, so server leaked memory though the function onException is called by RTMFPClient.

Please fix!! Thanks!!

Cannot compile on Linux Fedora 40

here is the error log:
g++ -Os -Wall -pedantic -std=c++11 -c -o src/URIParse.o src/URIParse.cpp
In file included from src/URIParse.cpp:9:
src/../include/rtmfp/Hex.hpp:15:62: error: ‘uint8_t’ was not declared in this scope
15 | static void print(const char *msg, const std::vector<uint8_t> &bytes);
| ^~~~~~~
src/../include/rtmfp/Hex.hpp:8:1: note: ‘uint8_t’ is defined in header ‘’; this is probably fixable by adding ‘#include ’
7 | #include
+++ |+#include
8 |
src/../include/rtmfp/Hex.hpp:15:69: error: template argument 1 is invalid
15 | static void print(const char *msg, const std::vector<uint8_t> &bytes);
| ^
src/../include/rtmfp/Hex.hpp:15:69: error: template argument 2 is invalid
src/../include/rtmfp/Hex.hpp:22:53: error: ‘uint8_t’ was not declared in this scope
22 | static std::string encode(const std::vector<uint8_t> &bytes);
| ^~~~~~~
src/../include/rtmfp/Hex.hpp:22:53: note: ‘uint8_t’ is defined in header ‘’; this is probably fixable by adding ‘#include ’
src/../include/rtmfp/Hex.hpp:22:60: error: template argument 1 is invalid
22 | static std::string encode(const std::vector<uint8_t> &bytes);
| ^
src/../include/rtmfp/Hex.hpp:22:60: error: template argument 2 is invalid
src/../include/rtmfp/Hex.hpp:24:57: error: ‘uint8_t’ was not declared in this scope
24 | static bool decode(const char *hex, std::vector<uint8_t> &dst);
| ^~~~~~~
src/../include/rtmfp/Hex.hpp:24:57: note: ‘uint8_t’ is defined in header ‘’; this is probably fixable by adding ‘#include ’
src/../include/rtmfp/Hex.hpp:24:64: error: template argument 1 is invalid
24 | static bool decode(const char *hex, std::vector<uint8_t> &dst);
| ^
src/../include/rtmfp/Hex.hpp:24:64: error: template argument 2 is invalid
src/URIParse.cpp: In static member function ‘static std::string com::zenomt::URIParse::percentDecode(const std::string&)’:
src/URIParse.cpp:226:38: error: ‘uint8_t’ was not declared in this scope
226 | rv.push_back(uint8_t(b));
| ^~~~~~~
src/URIParse.cpp:11:1: note: ‘uint8_t’ is defined in header ‘’; this is probably fixable by adding ‘#include ’
10 | #include "../include/rtmfp/URIParse.hpp"
+++ |+#include
11 |
make: *** [: src/URIParse.o] Error

gcc 14.1.1

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.