Skip to content

Commit 6e095ab

Browse files
committed
onebinary: integrate with MistIn and MistSession
1 parent 5d00828 commit 6e095ab

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/comms.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ namespace Comms{
360360
Socket::hostBytesToStr(ip.data(), ip.size(), host);
361361
pid_t thisPid;
362362
std::deque<std::string> args;
363-
args.push_back(Util::getMyPath() + "MistSession");
363+
args.push_back(Util::getMyPath() + "MistServer");
364+
args.push_back("MistSession");
364365
args.push_back(sessionId);
365366

366367
// First bit defines whether to include stream name

lib/stream.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,11 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
640640
setenv("MISTPROVIDER", "1", 1);
641641
}
642642

643-
std::string player_bin = Util::getMyPath() + "MistIn" + input["name"].asStringRef();
644-
char *argv[30] ={(char *)player_bin.c_str(), (char *)"-s", (char *)streamname.c_str(),
643+
std::string player_bin = "MistIn" + input["name"].asStringRef();
644+
std::string mistserver_bin = Util::getMyPath() + "MistServer";
645+
char *argv[30] ={(char *)(mistserver_bin).c_str(), (char *)player_bin.c_str(), (char *)"-s", (char *)streamname.c_str(),
645646
(char *)filename.c_str()};
646-
int argNum = 3;
647+
int argNum = 4;
647648
std::string debugLvl;
648649
if (Util::printDebugLevel != DEBUG && !str_args.count("--debug")){
649650
debugLvl = JSON::Value(Util::printDebugLevel).asString();

src/controller/controller_capabilities.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,11 @@ namespace Controller{
319319
}
320320
}
321321
#else
322-
// Mist::OutHTTP
323-
// Mist::OutRTMP
324-
// Mist::inputBuffer
325-
capabilities["inputs"]["Buffer"] = JSON::fromString(Mist::inputBuffer::capa.toString());
326-
capabilities["connectors"]["HLS"] = JSON::fromString(Mist::OutHLS::capa.toString());
327-
capabilities["connectors"]["HTTP"] = JSON::fromString(Mist::OutHTTP::capa.toString());
328-
capabilities["connectors"]["RTMP"] = JSON::fromString(Mist::OutRTMP::capa.toString());
322+
// produced with e.g. `./MistOutHLS -j | jq '. | tostring'`
323+
capabilities["inputs"]["Buffer"] = JSON::fromString("{\"desc\":\"This input type is both used for push- and pull-based streams. It provides a buffer for live media data. The push://[host][@password] style source allows all enabled protocols that support push input to accept a push into MistServer, where you can accept incoming streams from everyone, based on a set password, and/or use hostname/IP whitelisting.\",\"name\":\"Buffer\",\"non-provider\":true,\"optional\":{\"DVR\":{\"default\":50000,\"help\":\"The target available buffer time for this live stream, in milliseconds. This is the time available to seek around in, and will automatically be extended to fit whole keyframes as well as the minimum duration needed for stable playback.\",\"name\":\"Buffer time (ms)\",\"option\":\"--buffer\",\"type\":\"uint\"},\"cut\":{\"default\":0,\"help\":\"Any timestamps before this will be cut from the live buffer.\",\"name\":\"Cut time (ms)\",\"option\":\"--cut\",\"type\":\"uint\"},\"debug\":{\"help\":\"The debug level at which messages need to be printed.\",\"name\":\"debug\",\"option\":\"--debug\",\"type\":\"debug\"},\"fallback_stream\":{\"default\":\"\",\"help\":\"Alternative stream to load for playback when there is no active broadcast\",\"name\":\"Fallback stream\",\"type\":\"str\"},\"inputtimeout\":{\"default\":30,\"help\":\"How long the input should remain loaded without activity\",\"name\":\"Input inactivity timeout\",\"option\":\"--inputtimeout\",\"type\":\"uint\",\"unit\":\"s\"},\"maxkeepaway\":{\"default\":45000,\"help\":\"Maximum distance in milliseconds to fall behind the live point for stable playback.\",\"name\":\"Maximum live keep-away distance\",\"option\":\"--resume\",\"type\":\"uint\"},\"pagetimeout\":{\"default\":15,\"help\":\"For bufferless or live inputs like HLS, set the timeout in seconds for old, inactive pages to be deleted. A longer value results in more memory usage, but ensures that recently buffered data stays in memory for longer\",\"name\":\"Memory page timeout\",\"option\":\"--pagetimeout\",\"type\":\"uint\"},\"resume\":{\"default\":0,\"help\":\"If enabled, the buffer will linger after source disconnect to allow resuming the stream later. If disabled, the buffer will instantly close on source disconnect.\",\"name\":\"Resume support\",\"option\":\"--resume\",\"select\":[[\"0\",\"Disabled\"],[\"1\",\"Enabled\"]],\"type\":\"select\"},\"segmentsize\":{\"default\":1900,\"help\":\"Target time duration in milliseconds for segments.\",\"name\":\"Segment size (ms)\",\"option\":\"--segment-size\",\"type\":\"uint\"}},\"priority\":9,\"source_match\":\"push://*\",\"version\":\"3.3\"}");
324+
capabilities["connectors"]["HLS"] = JSON::fromString("{\"codecs\":[[[\"+HEVC\"],[\"+H264\"],[\"+MPEG2\"],[\"+AAC\"],[\"+MP3\"],[\"+AC3\"],[\"+MP2\"],[\"+subtitle\"]]],\"deps\":\"HTTP\",\"desc\":\"Segmented streaming in Apple (TS-based) format over HTTP ( = HTTP Live Streaming)\",\"exceptions\":{\"codec:HEVC\":[[\"blacklist\"]],\"codec:MP3\":[[\"blacklist\",[\"Mozilla/\"]],[\"whitelist\",[\"iPad\",\"iPhone\",\"iPod\",\"MacIntel\",\"Edge\"]]]},\"forward\":{\"ip\":{\"help\":\"Data to pretend arrived on the socket before parsing the socket.\",\"name\":\"Previous request\",\"option\":\"--prequest\",\"type\":\"str\"},\"streamname\":{\"help\":\"What streamname to serve.\",\"name\":\"Stream\",\"option\":\"--stream\",\"type\":\"str\"}},\"friendly\":\"Apple segmented over HTTP (HLS)\",\"methods\":[{\"handler\":\"http\",\"hrn\":\"HLS (TS)\",\"priority\":9,\"type\":\"html5/application/vnd.apple.mpegurl\"}],\"name\":\"HLS\",\"optional\":{\"chunkpath\":{\"default\":\"\",\"help\":\"Chunks will be served from this path.\",\"name\":\"Prepend path for chunks\",\"option\":\"--chunkpath\",\"short\":\"e\",\"type\":\"str\"},\"debug\":{\"help\":\"The debug level at which messages need to be printed.\",\"name\":\"debug\",\"option\":\"--debug\",\"type\":\"debug\"},\"default_track_sorting\":{\"default\":\"\",\"help\":\"What tracks are selected first when no specific track selector is used for playback.\",\"name\":\"Default track sorting\",\"option\":\"--default_track_sorting\",\"select\":[[\"\",\"Default (last added for live, first added for VoD)\"],[\"bps_lth\",\"Bit rate, low to high\"],[\"bps_htl\",\"Bit rate, high to low\"],[\"id_lth\",\"Track ID, low to high\"],[\"id_htl\",\"Track ID, high to low\"],[\"res_lth\",\"Resolution, low to high\"],[\"res_htl\",\"Resolution, high to low\"]],\"short\":\"S\",\"type\":\"select\"},\"listlimit\":{\"default\":0,\"help\":\"Maximum number of parts in live playlists. (0 = infinite)\",\"name\":\"Live playlist limit\",\"option\":\"--list-limit\",\"type\":\"uint\"},\"nonchunked\":{\"help\":\"Disables chunked transfer encoding, forcing per-segment buffering. Reduces performance significantly, but increases compatibility somewhat.\",\"name\":\"Send whole segments\",\"option\":\"--nonchunked\"},\"username\":{\"default\":\"root\",\"help\":\"Username to drop privileges to - default if unprovided means do not drop privileges\",\"name\":\"Username\",\"option\":\"--username\",\"short\":\"u\",\"type\":\"str\"}},\"url_prefix\":\"/hls/$/\",\"url_rel\":\"/hls/$/index.m3u8\",\"version\":\"3.3\"}");
325+
capabilities["connectors"]["HTTP"] = JSON::fromString("{\"codecs\":[null],\"desc\":\"HTTP connection handler, provides all enabled HTTP-based outputs\",\"forward\":{\"ip\":{\"help\":\"Data to pretend arrived on the socket before parsing the socket.\",\"name\":\"Previous request\",\"option\":\"--prequest\",\"type\":\"str\"},\"streamname\":{\"help\":\"What streamname to serve.\",\"name\":\"Stream\",\"option\":\"--stream\",\"type\":\"str\"}},\"friendly\":\"HTTP\",\"name\":\"HTTP\",\"optional\":{\"certbot\":{\"default\":\"\",\"help\":\"Automatically set by the MistUtilCertbot authentication hook for certbot. Not intended to be set manually.\",\"name\":\"Certbot validation token\",\"option\":\"--certbot\",\"short\":\"C\",\"type\":\"str\"},\"debug\":{\"help\":\"The debug level at which messages need to be printed.\",\"name\":\"debug\",\"option\":\"--debug\",\"type\":\"debug\"},\"default_track_sorting\":{\"default\":\"\",\"help\":\"What tracks are selected first when no specific track selector is used for playback.\",\"name\":\"Default track sorting\",\"option\":\"--default_track_sorting\",\"select\":[[\"\",\"Default (last added for live, first added for VoD)\"],[\"bps_lth\",\"Bit rate, low to high\"],[\"bps_htl\",\"Bit rate, high to low\"],[\"id_lth\",\"Track ID, low to high\"],[\"id_htl\",\"Track ID, high to low\"],[\"res_lth\",\"Resolution, low to high\"],[\"res_htl\",\"Resolution, high to low\"]],\"short\":\"S\",\"type\":\"select\"},\"interface\":{\"default\":\"0.0.0.0\",\"help\":\"Address of the interface to listen on\",\"name\":\"Interface\",\"option\":\"--interface\",\"short\":\"i\",\"type\":\"str\"},\"nostreamtext\":{\"default\":\"\",\"help\":\"Text or HTML to display when streams are unavailable.\",\"name\":\"Stream unavailable text\",\"option\":\"--nostreamtext\",\"type\":\"str\"},\"port\":{\"default\":8080,\"help\":\"TCP port to listen on\",\"name\":\"TCP port\",\"option\":\"--port\",\"short\":\"p\",\"type\":\"uint\"},\"pubaddr\":{\"default\":\"\",\"help\":\"Full public address this output is available as, if being proxied\",\"name\":\"Public address\",\"option\":\"--public-address\",\"type\":\"inputlist\"},\"username\":{\"default\":\"root\",\"help\":\"Username to drop privileges to - default if unprovided means do not drop privileges\",\"name\":\"Username\",\"option\":\"--username\",\"short\":\"u\",\"type\":\"str\"},\"wrappers\":{\"allowed\":[\"html5\",\"hlsjs\",\"videojs\",\"dashjs\",\"webrtc\",\"mews\",\"rawws\",\"flv\",\"flash_strobe\"],\"default\":\"\",\"help\":\"Which players are attempted and in what order.\",\"name\":\"Active players\",\"option\":\"--wrappers\",\"short\":\"w\",\"type\":\"ord_multi_sel\"}},\"protocol\":\"http://\",\"provides\":\"HTTP\",\"url_match\":[\"/crossdomain.xml\",\"/clientaccesspolicy.xml\",\"/$.html\",\"/favicon.ico\",\"/$.smil\",\"/info_$.js\",\"/json_$.js\",\"/player.js\",\"/videojs.js\",\"/dashjs.js\",\"/webrtc.js\",\"/flv.js\",\"/hlsjs.js\",\"/libde265.js\",\"/skins/default.css\",\"/skins/dev.css\",\"/skins/videojs.css\",\"/embed_$.js\",\"/flashplayer.swf\",\"/oldflashplayer.swf\"],\"url_prefix\":\"/.well-known/\",\"url_rel\":\"/$.html\",\"version\":\"3.3\"}");
326+
capabilities["connectors"]["RTMP"] = JSON::fromString("{\"codecs\":[[[\"H264\",\"H263\",\"VP6\",\"VP6Alpha\",\"ScreenVideo2\",\"ScreenVideo1\",\"JPEG\"],[\"AAC\",\"MP3\",\"Speex\",\"Nellymoser\",\"PCM\",\"ADPCM\",\"ALAW\",\"ULAW\"]]],\"deps\":\"\",\"desc\":\"Real time streaming over Adobe RTMP\",\"friendly\":\"RTMP\",\"incoming_push_url\":\"rtmp://$host:$port/$password/$stream\",\"methods\":[{\"handler\":\"rtmp\",\"hrn\":\"RTMP\",\"player_url\":\"/flashplayer.swf\",\"priority\":7,\"type\":\"flash/10\"}],\"name\":\"RTMP\",\"optional\":{\"acceptable\":{\"default\":0,\"help\":\"Whether to allow only incoming pushes (2), only outgoing pulls (1), or both (0, default)\",\"name\":\"Acceptable connection types\",\"option\":\"--acceptable\",\"select\":[[0,\"Allow both incoming and outgoing connections\"],[1,\"Allow only outgoing connections\"],[2,\"Allow only incoming connections\"]],\"short\":\"T\",\"type\":\"select\"},\"debug\":{\"help\":\"The debug level at which messages need to be printed.\",\"name\":\"debug\",\"option\":\"--debug\",\"type\":\"debug\"},\"default_track_sorting\":{\"default\":\"\",\"help\":\"What tracks are selected first when no specific track selector is used for playback.\",\"name\":\"Default track sorting\",\"option\":\"--default_track_sorting\",\"select\":[[\"\",\"Default (last added for live, first added for VoD)\"],[\"bps_lth\",\"Bit rate, low to high\"],[\"bps_htl\",\"Bit rate, high to low\"],[\"id_lth\",\"Track ID, low to high\"],[\"id_htl\",\"Track ID, high to low\"],[\"res_lth\",\"Resolution, low to high\"],[\"res_htl\",\"Resolution, high to low\"]],\"short\":\"S\",\"type\":\"select\"},\"interface\":{\"default\":\"0.0.0.0\",\"help\":\"Address of the interface to listen on\",\"name\":\"Interface\",\"option\":\"--interface\",\"short\":\"i\",\"type\":\"str\"},\"maxkbps\":{\"default\":0,\"help\":\"Maximum bitrate to allow in the ingest direction, in kilobits per second.\",\"name\":\"Max. kbps\",\"option\":\"--maxkbps\",\"short\":\"K\",\"type\":\"uint\"},\"port\":{\"default\":1935,\"help\":\"TCP port to listen on\",\"name\":\"TCP port\",\"option\":\"--port\",\"short\":\"p\",\"type\":\"uint\"},\"username\":{\"default\":\"root\",\"help\":\"Username to drop privileges to - default if unprovided means do not drop privileges\",\"name\":\"Username\",\"option\":\"--username\",\"short\":\"u\",\"type\":\"str\"}},\"push_parameters\":{\"append\":{\"format\":\"set_or_unset\",\"help\":\"If set to any value, will (if possible) append to an existing file, rather than overwriting it\",\"name\":\"Append to file\",\"sort\":\"bf\",\"type\":\"bool\"},\"audio\":{\"help\":\"Override which audio tracks of the stream should be selected\",\"name\":\"Audio track(s)\",\"sort\":\"aa\",\"type\":\"string\",\"validate\":[\"track_selector\"]},\"duration\":{\"disable\":[\"recstop\",\"stop\"],\"help\":\"How much media time to push, in seconds. Internally overrides \\\"recstop\\\"\",\"name\":\"Duration of push\",\"sort\":\"bi\",\"type\":\"int\",\"unit\":\"s\"},\"m3u8\":{\"help\":\"If set, will write a m3u8 playlist file for the segments to the given path (relative from the first segment path). When this parameter is used, at least one of the variables $segmentCounter or $currentMediaTime must be part of the segment path (to keep segments from overwriting each other). The \\\"Split interval\\\" parameter will default to 60 seconds when using this option.\",\"name\":\"Playlist path (relative to segments)\",\"sort\":\"apa\",\"type\":\"string\"},\"maxEntries\":{\"help\":\"When writing a playlist, delete oldest segment entries once this entry count has been reached (and, if possible, also delete said segments themselves). When set to 0 or left empty, does not delete.\",\"name\":\"Playlist max entries\",\"sort\":\"apc\",\"type\":\"int\"},\"maxwaittrackms\":{\"default\":\"5s, or 120s when using a non-default GOP count\",\"help\":\"When waiting for GOPs on the main track, give up when this much data is available in the main track buffer\",\"name\":\"Max buffer duration for GOP count wait\",\"sort\":\"be\",\"type\":\"int\",\"unit\":\"ms\"},\"noendlist\":{\"format\":\"set_or_unset\",\"help\":\"If set, does not write #X-EXT-ENDLIST when finalizing the playlist on exit\",\"name\":\"Don't end playlist\",\"sort\":\"bfa\",\"type\":\"bool\"},\"pushdelay\":{\"disable\":[\"realtime\",\"start\"],\"help\":\"Ensures the stream is always delayed by at least this many seconds. Internally overrides the \\\"realtime\\\" and \\\"start\\\" parameters\",\"name\":\"Push delay\",\"sort\":\"bg\",\"type\":\"int\",\"unit\":\"s\"},\"rate\":{\"default\":\"1\",\"help\":\"Multiplier for the playback speed rate, or 0 to not limit\",\"name\":\"Playback rate\",\"sort\":\"ba\",\"type\":\"int\"},\"realtime\":{\"format\":\"set_or_unset\",\"help\":\"If set to any value, removes the rate override to unlimited normally applied to push outputs\",\"name\":\"Don't speed up output\",\"sort\":\"bb\",\"type\":\"bool\"},\"recstart\":{\"file_only\":true,\"help\":\"What internal media timestamp to start from\",\"name\":\"Media timestamp to start from\",\"sort\":\"bp\",\"type\":\"int\",\"unit\":\"s\"},\"recstartunix\":{\"disable\":[\"recstart\"],\"file_only\":true,\"help\":\"What unix timestamp to start from\",\"name\":\"Unix timestamp to start from\",\"sort\":\"br\",\"type\":\"unixtime\",\"unit\":\"s\"},\"recstop\":{\"file_only\":true,\"help\":\"What internal media timestamp to stop at\",\"name\":\"Media timestamp to stop at\",\"sort\":\"bo\",\"type\":\"int\",\"unit\":\"s\"},\"recstopunix\":{\"disable\":[\"recstop\"],\"file_only\":true,\"help\":\"What unix timestamp to stop at\",\"name\":\"Unix timestamp to stop at\",\"sort\":\"bq\",\"type\":\"unixtime\",\"unit\":\"s\"},\"split\":{\"help\":\"Performs a gapless restart of the recording every this many seconds. Always aligns to the next keyframe after this duration, to ensure each recording is fully playable. When set to zero (the default) will not split at all.\",\"name\":\"Split interval\",\"sort\":\"bh\",\"type\":\"int\",\"unit\":\"s\"},\"start\":{\"help\":\"What internal media timestamp to start from\",\"name\":\"Media timestamp to start from\",\"prot_only\":true,\"sort\":\"bl\",\"type\":\"int\",\"unit\":\"s\"},\"startunix\":{\"disable\":[\"start\"],\"help\":\"What unix timestamp to start from\",\"name\":\"Unix timestamp to start from\",\"prot_only\":true,\"sort\":\"bn\",\"type\":\"unixtime\",\"unit\":\"s\"},\"stop\":{\"help\":\"What internal media timestamp to stop at\",\"name\":\"Media timestamp to stop at\",\"prot_only\":true,\"sort\":\"bk\",\"type\":\"int\",\"unit\":\"s\"},\"stopunix\":{\"disable\":[\"stop\"],\"help\":\"What unix timestamp to stop at\",\"name\":\"Unix timestamp to stop at\",\"prot_only\":true,\"sort\":\"bm\",\"type\":\"unixtime\",\"unit\":\"s\"},\"subtitle\":{\"help\":\"Override which subtitle tracks of the stream should be selected\",\"name\":\"Subtitle track(s)\",\"sort\":\"ac\",\"type\":\"string\",\"validate\":[\"track_selector\"]},\"targetAge\":{\"help\":\"When writing a playlist, delete segment entries that are more than this many seconds old from the playlist (and, if possible, also delete said segments themselves). When set to 0 or left empty, does not delete.\",\"name\":\"Playlist target age\",\"sort\":\"apb\",\"type\":\"int\",\"unit\":\"s\"},\"unmask\":{\"format\":\"set_or_unset\",\"help\":\"If set to any value, removes any applied track masking before selecting tracks, acting as if no mask was applied at all\",\"name\":\"Unmask tracks\",\"sort\":\"bc\",\"type\":\"bool\"},\"video\":{\"help\":\"Override which video tracks of the stream should be selected\",\"name\":\"Video track(s)\",\"sort\":\"ab\",\"type\":\"string\",\"validate\":[\"track_selector\"]},\"waittrackcount\":{\"default\":2,\"help\":\"Before starting, wait until this number of GOPs is available in the main selected track\",\"name\":\"Wait for GOP count\",\"sort\":\"bd\",\"type\":\"int\"}},\"push_urls\":[\"rtmp://*\",\"rtmps://*\"],\"url_rel\":\"/play/$\",\"version\":\"3.3\"}");
329327
#endif
330328
}
331329

0 commit comments

Comments
 (0)