Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing SPS when using TCP #37

Closed
9a4gl opened this issue Apr 16, 2017 · 0 comments
Closed

Error parsing SPS when using TCP #37

9a4gl opened this issue Apr 16, 2017 · 0 comments

Comments

@9a4gl
Copy link
Contributor

9a4gl commented Apr 16, 2017

This is maybe not related to TCP, but when I tried new feature to use rtsp over tcp.
So, my old camera works only over TCP, so I tried it today and got "cannot parse sps" message, then I did following change and then it works correctly, I checked and it still works with other cameras using udp.
Unfortunately I do not know much about sps and it's format, so leaving to you to decide if fix is ok.

diff --git a/src/rtspvideocapturer.cpp b/src/rtspvideocapturer.cpp
index 18757eb..740420f 100644
--- a/src/rtspvideocapturer.cpp
+++ b/src/rtspvideocapturer.cpp
@@ -80,7 +80,7 @@ bool RTSPVideoCapturer::onData(const char* id, unsigned char* buffer, ssize_t si
                m_cfg.clear();
                m_cfg.insert(m_cfg.end(), buffer, buffer+size);
                
-               rtc::Optional<webrtc::SpsParser::SpsState> sps = webrtc::SpsParser::ParseSps(buffer+sizeof(marker)+webrtc::H264::kNaluTypeSize, size-sizeof(marker)-webrtc::H264::kNaluTypeSize);       
                
+               rtc::Optional<webrtc::SpsParser::SpsState> sps = webrtc::SpsParser::ParseSps(buffer, size);
                if (!sps)
                {       
                        LOG(LS_ERROR) << "cannot parse sps" << std::endl;

If you need access to this camera, let me know I can put it on public.

BR,
Tihomir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants