I compiled this on Linux, Linux buers-MS-7B98 5.3.0-26-generic #28~18.04.1-Ubuntu SMP Wed Dec 18 16:40:14 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux. First time, I compiled kodi, so obviously experience is missing.
1. As we have seen by serveral messages here, streams are working, when you stream them on other devices inside the same network (i.e. VLC, enigma2 receiver, Telekom MagentaTV receiver, ...)
2. Somewhere a slash gets appended to the URL. From the log: CPlayerCoreFactory::GetPlayers(rtp://
[email protected]:10000/). I did not investigate the source of the slash yet, but it won't be liked by ffmpeg
3. CDVDDemuxFFmpeg::Open(), where you have added most of your changes, which we are discussing here, really would need a parser for rtp://source_ip@host_ip. But during this phase, simple string operations are of course ok. I already said, that I am no C++ expert. Nevertheless, I believe that this snippet should improve things:
Code:
else if (url.IsProtocol("udp") || url.IsProtocol("rtp"))
{
std::string strURL = url.Get();
CLog::Log(LOGDEBUG,
"CDVDDemuxFFmpeg::Open() UDP/RTP Original URL '%s'",
strURL.c_str());
size_t found = strURL.find("://");
if (found != std::string::npos)
{
size_t start = found + 3;
size_t pat = strURL.find("@");
CLog::Log(LOGDEBUG,
"CDVDDemuxFFmpeg::Open() start %u pat %u",
(unsigned)start, (unsigned)pat);
if (pat != std::string::npos && pat > start)
{
// sourceip found
std::string strSourceIp = strURL.substr(start, pat - start);
strFile = strURL.substr(0, start);
strFile += strURL.substr(pat);
size_t l = strFile.length();
if (l > 0 && strFile[l-1] == '/')
// strFile[l-1] = '\0';
strFile.pop_back();
/* if (strFile.back() == '/')
strFile.back() = 0; */
strFile += "?sources=";
strFile += strSourceIp;
// only use udp as there is bug in rtp in ffmpeg
strFile[0] = 'u';
strFile[1] = 'd';
CLog::Log(LOGDEBUG,
"CDVDDemuxFFmpeg::Open() UDP/RTP URL '%s'",
strFile.c_str());
}
}
I assume, that all the formatting will be lost, but you will see, what I mean, @
phunkyfish. I got rid of the overloaded found, and checked for trailing slash, if there, delete it. Sure, this is not production quality.
Then, from the log, it looks ok for me from point of view of the transcription of the URL. Unfortunately, I now get an error inside ffmpeg: "ERROR: ffmpeg[0x55be3de45b60X]: setsockopt(MCAST_JOIN_SOURCE_GROUP): Cannot assign requested address". I have to investigate further from here. My test program, that is able to record the SSM streams, is using exactly this call to setsockopt witt MCAST_JOIN_SOURCE_GROUP. I don't understand this yet. After all, @
Newbie268 reported, that the same channel I used for testing, was working. So, quite possible, that I have f***d up something.
Just wanted to share with you the findings, in the hope, that they can be helpful in further analysis.