开启rtsp端口

nx_mplive
liuguijing 2 months ago
parent 4a71482346
commit cc709a87c7

@ -312,7 +312,7 @@ int start_main(int argc,char *argv[]) {
listen_ip = "0.0.0.0"; listen_ip = "0.0.0.0";
uint16_t shellPort = 0; // mINI::Instance()[Shell::kPort]; uint16_t shellPort = 0; // mINI::Instance()[Shell::kPort];
uint16_t rtspPort = 0; // mINI::Instance()[Rtsp::kPort]; uint16_t rtspPort = mINI::Instance()[Rtsp::kPort];
uint16_t rtspsPort = 0; // mINI::Instance()[Rtsp::kSSLPort]; uint16_t rtspsPort = 0; // mINI::Instance()[Rtsp::kSSLPort];
uint16_t rtmpPort = mINI::Instance()[Rtmp::kPort]; uint16_t rtmpPort = mINI::Instance()[Rtmp::kPort];
uint16_t rtmpsPort = 0; // mINI::Instance()[Rtmp::kSSLPort]; uint16_t rtmpsPort = 0; // mINI::Instance()[Rtmp::kSSLPort];
@ -402,7 +402,7 @@ int start_main(int argc,char *argv[]) {
InfoL << "已启动http hook 接口"; InfoL << "已启动http hook 接口";
try { try {
// rtsp服务器端口默认554 [AUTO-TRANSLATED:07937d81] // rtsp服务器端口默 认554 [AUTO-TRANSLATED:07937d81]
// rtsp server, default port 554 // rtsp server, default port 554
if (rtspPort) { rtspSrv->start<RtspSession>(rtspPort, listen_ip); } if (rtspPort) { rtspSrv->start<RtspSession>(rtspPort, listen_ip); }
// rtsps服务器端口默认322 [AUTO-TRANSLATED:e8a9fd71] // rtsps服务器端口默认322 [AUTO-TRANSLATED:e8a9fd71]

@ -187,9 +187,9 @@ JNI_API(jboolean, startServer, jstring ini_dir){
mINI::Instance()["http.port"] = 8080; mINI::Instance()["http.port"] = 8080;
mINI::Instance()["http.sslport"] = 8443; mINI::Instance()["http.sslport"] = 8443;
mINI::Instance()["rtsp.port"] = 8554; mINI::Instance()["rtsp.port"] = 8554;
mINI::Instance()["rtsp.port"] = 0; // mINI::Instance()["rtsp.port"] = 0;
mINI::Instance()["rtsp.sslport"] = 8332; mINI::Instance()["rtsp.sslport"] = 8332;
mINI::Instance()["rtsp.sslport"] = 0; // mINI::Instance()["rtsp.sslport"] = 0;
mINI::Instance()["general.enableVhost"] = 0; mINI::Instance()["general.enableVhost"] = 0;
for (auto &pr : mINI::Instance()) { for (auto &pr : mINI::Instance()) {
//替换hook默认地址 //替换hook默认地址

@ -195,28 +195,28 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
if (autoStart != 0) { if (autoStart != 0) {
startRTMPServer(); startRTMPServer();
mHandler.postDelayed(new Runnable() { // mHandler.postDelayed(new Runnable() {
@Override // @Override
public void run() { // public void run() {
// rtmpUrl = "rtmp://61.169.135.146/live/0"; //// rtmpUrl = "rtmp://61.169.135.146/live/0";
SharedPreferences.Editor editor = sp.edit(); // SharedPreferences.Editor editor = sp.edit();
editor.putString("rtmpUrl", rtmpUrl); // editor.putString("rtmpUrl", rtmpUrl);
editor.apply(); // editor.apply();
efu.setText(rtmpUrl + "rotation= " + rotation + " cameraid=" + cameraId + " auto=" + autoStart); // efu.setText(rtmpUrl + "rotation= " + rotation + " cameraid=" + cameraId + " auto=" + autoStart);
// efu.setText(rtmpUrl + " cameraid=" + cameraId + " auto=" + autoStart); // // efu.setText(rtmpUrl + " cameraid=" + cameraId + " auto=" + autoStart);
efu.setText(rtmpUrl); // efu.setText(rtmpUrl);
mPublisher.startPublish(rtmpUrl); // mPublisher.startPublish(rtmpUrl);
if (btnSwitchEncoder.getText().toString().contentEquals("soft encoder")) { // if (btnSwitchEncoder.getText().toString().contentEquals("soft encoder")) {
// Toast.makeText(getApplicationContext(), "Use hard encoder", Toast.LENGTH_SHORT).show(); // // Toast.makeText(getApplicationContext(), "Use hard encoder", Toast.LENGTH_SHORT).show();
} else { // } else {
Toast.makeText(getApplicationContext(), "Use soft encoder", Toast.LENGTH_SHORT).show(); // Toast.makeText(getApplicationContext(), "Use soft encoder", Toast.LENGTH_SHORT).show();
} // }
btnPublish.setText("stop"); // btnPublish.setText("stop");
btnSwitchEncoder.setEnabled(false); // btnSwitchEncoder.setEnabled(false);
btnPause.setEnabled(true); // btnPause.setEnabled(true);
mPublisher.switchCameraFace(cameraId, rotation); // mPublisher.switchCameraFace(cameraId, rotation);
} // }
}, 500); // }, 500);
} else { } else {
mPublisher.switchCameraFace(cameraId, rotation); mPublisher.switchCameraFace(cameraId, rotation);
} }

Loading…
Cancel
Save