Linux平台x86_64|aarch64架构如何实现轻量级RTSP服务

技术背景

我们在做Linux平台x86_64架构或aarch64架构的推送模块的时候,有公司提出这样的技术需求,希望在Linux平台,实现轻量级RTSP服务,实现对摄像头或屏幕对外RTSP拉流,同步到大屏上去。

技术实现

废话不多说,直接上代码,先调用start_rtsp_server()指定端口号,启动RTSP服务。

	LogInit();

	NT_SmartPublisherSDKAPI push_api;
	if (!PushSDKInit(push_api))
	{
		XDestroyWindow(display, sub_wid);
		XDestroyWindow(display, main_wid);
		XCloseDisplay(display);

		return 0;
	}

	// auto rtsp_server_handle = start_rtsp_server(&push_api, 8554, "test", "12345");
	auto rtsp_server_handle = start_rtsp_server(&push_api, 8554, "", "");
	if (nullptr == rtsp_server_handle) {
		fprintf(stderr, "start_rtsp_server failed.\n");

		XDestroyWindow(display, sub_wid);
		XDestroyWindow(display, main_wid);
		XCloseDisplay(display);

		push_api.UnInit();

		return 0;
	}

	auto push_handle = open_config_instance(&push_api, 20);
	if (nullptr == push_handle) {
		fprintf(stderr, "open_config_instance failed.\n");

		XDestroyWindow(display, sub_wid);
		XDestroyWindow(display, main_wid);
		XCloseDisplay(display);

		stop_rtsp_server(&push_api, rtsp_server_handle);

		push_api.UnInit();

		return 0;
	}

PushSDKInit()实现如下:

	/*
     * publisherdemo.cpp
     * Author: daniusdk.com
     */
    bool PushSDKInit(NT_SmartPublisherSDKAPI& push_api)
	{
		memset(&push_api, 0, sizeof(push_api));
		NT_GetSmartPublisherSDKAPI(&push_api);

		auto ret = push_api.Init(0, nullptr);
		if (NT_ERC_OK != ret)
		{
			fprintf(stderr, "push_api.Init failed!\n");
			return false;
		}
		else
		{
			fprintf(stdout, "push_api.Init ok!\n");
		}

		return true;
	}

启动RTSP服务对应的代码如下:

	NT_HANDLE start_rtsp_server(NT_SmartPublisherSDKAPI* push_api, int port, std::string user_name, std::string password) {

		NT_HANDLE rtsp_server_handle = nullptr;
		if (NT_ERC_OK != push_api->OpenRtspServer(&rtsp_server_handle, 0)) {
			fprintf(stderr, "OpenRtspServer failed\n");
			return nullptr;
		}

		if (nullptr == rtsp_server_handle) {
			fprintf(stderr, "rtsp_server_handle is null\n");
			return nullptr;
		}

		if (NT_ERC_OK != push_api->SetRtspServerPort(rtsp_server_handle, port)) {
			push_api->CloseRtspServer(rtsp_server_handle);
			return nullptr;
		}

		if (!user_name.empty() && !password.empty())
			push_api->SetRtspServerUserNamePassword(rtsp_server_handle, user_name.c_str(), password.c_str());

		if (NT_ERC_OK == push_api->StartRtspServer(rtsp_server_handle, 0))
			return rtsp_server_handle;

		fprintf(stderr, "StartRtspServer failed\n");
		push_api->CloseRtspServer(rtsp_server_handle);
		
		return nullptr;
	}

open_config_instance()实现如下,可以获取摄像头或屏幕数据,并做基础的编码等参数配置:

	NT_HANDLE open_config_instance(NT_SmartPublisherSDKAPI* push_api, int dst_fps) {
		NT_INT32 pulse_device_number = 0;
		if (NT_ERC_OK == push_api->GetAuidoInputDeviceNumber(2, &pulse_device_number))
		{
			fprintf(stdout, "[daniusdk.com]Pulse device num:%d\n", pulse_device_number);
			char device_name[512];

			for (auto i = 0; i < pulse_device_number; ++i)
			{
				if (NT_ERC_OK == push_api->GetAuidoInputDeviceName(2, i, device_name, 512))
				{
					fprintf(stdout, "[daniusdk.com]index:%d name:%s\n", i, device_name);
				}
			}
		}

		NT_INT32 alsa_device_number = 0;
		if (pulse_device_number < 1)
		{
			if (NT_ERC_OK == push_api->GetAuidoInputDeviceNumber(1, &alsa_device_number))
			{
				fprintf(stdout, "Alsa device num:%d\n", alsa_device_number);
				char device_name[512];
				for (auto i = 0; i < alsa_device_number; ++i)
				{
					if (NT_ERC_OK == push_api->GetAuidoInputDeviceName(1, i, device_name, 512))
					{
						fprintf(stdout, "[daniusdk.com]index:%d name:%s\n", i, device_name);
					}
				}
			}
		}

		NT_INT32 capture_speaker_flag = 0;
		if (NT_ERC_OK == push_api->IsCanCaptureSpeaker(2, &capture_speaker_flag))
		{
			if (capture_speaker_flag)
				fprintf(stdout, "[daniusdk.com]Support speaker capture\n");
			else
				fprintf(stdout, "[daniusdk.com]UnSupport speaker capture\n");
		}

		NT_INT32 is_support_window_capture = 0;
		if (NT_ERC_OK == push_api->IsCaptureXWindowSupported(NULL, &is_support_window_capture))
		{
			if (is_support_window_capture)
				fprintf(stdout, "[daniusdk.com]Support window capture\n");
			else
				fprintf(stdout, "[daniusdk.com]UnSupport window capture\n");
		}

		if (is_support_window_capture)
		{
			NT_INT32 win_count = 0;
			if (NT_ERC_OK == push_api->UpdateCaptureXWindowList(NULL, &win_count) && win_count > 0)
			{

				fprintf(stdout, "X Capture Winows list++\n");

				for (auto i = 0; i < win_count; ++i)
				{
					NT_UINT64 wid;
					char title[512];

					if (NT_ERC_OK == push_api->GetCaptureXWindowInfo(i, &wid, title, sizeof(title) / sizeof(char)))
					{
						x_win_list.push_back(wid);
						fprintf(stdout, "wid:%llu, title:%s\n", wid, title);
					}
				}

				fprintf(stdout, "[daniusdk.com]X Capture Winows list--\n");
			}
		}

		std::vector<CameraInfo> cameras;
		GetCameraInfo(push_api, cameras);

		if (!cameras.empty())
		{
			fprintf(stdout, "cameras count:%d\n", (int)cameras.size());

			for (const auto& c : cameras)
			{
				fprintf(stdout, "camera name:%s, id:%s, cap_num:%d\n", c.name_.c_str(), c.id_.c_str(), (int)c.capabilities_.size());

				for (const auto& i : c.capabilities_)
				{
					fprintf(stdout, "[daniusdk.com]cap w:%d, h:%d, fps:%d\n", i.width_, i.height_, i.max_frame_rate_);
				}
			}
		}

		NT_UINT32 auido_option = NT_PB_E_AUDIO_OPTION_NO_AUDIO;

		if (pulse_device_number > 0 || alsa_device_number > 0)
		{
			auido_option = NT_PB_E_AUDIO_OPTION_CAPTURE_MIC;
		}
		else if (capture_speaker_flag)
		{
			auido_option = NT_PB_E_AUDIO_OPTION_CAPTURE_SPEAKER;
		}

		//auido_option = NT_PB_E_AUDIO_OPTION_CAPTURE_MIC_SPEAKER_MIXER;

		NT_UINT32 video_option = NT_PB_E_VIDEO_OPTION_SCREEN;

		if (!cameras.empty())
		{
			video_option = NT_PB_E_VIDEO_OPTION_CAMERA;
		}
		else if (is_support_window_capture)
		{
			video_option = NT_PB_E_VIDEO_OPTION_WINDOW;
		}

		// video_option = NT_PB_E_VIDEO_OPTION_LAYER;

		//video_option = NT_PB_E_VIDEO_OPTION_NO_VIDEO;

		NT_HANDLE push_handle = nullptr;

		//if (NT_ERC_OK != push_api->Open(&push_handle, NT_PB_E_VIDEO_OPTION_LAYER, NT_PB_E_AUDIO_OPTION_CAPTURE_SPEAKER, 0, NULL))
		if (NT_ERC_OK != push_api->Open(&push_handle, video_option, auido_option, 0, NULL))
		{
			return nullptr;
		}

		push_api->SetEventCallBack(push_handle, nullptr, OnSDKEventHandle);

		//push_api->SetXDisplayName(push_handle, ":0");
		//push_api->SetXDisplayName(push_handle, NULL);

		// 视频层配置方式
		if (NT_PB_E_VIDEO_OPTION_LAYER == video_option)
		{
			std::vector<std::shared_ptr<nt_pb_sdk::layer_conf_wrapper_base> > layer_confs;

			auto index = 0;

			 第0层填充RGBA矩形, 目的是保证帧率, 颜色就填充全黑
			auto rgba_layer_c0 = std::make_shared<nt_pb_sdk::RGBARectangleLayerConfigWrapper>(index++, true, 0, 0, 1280, 720);

			rgba_layer_c0->conf_.red_ = 200;
			rgba_layer_c0->conf_.green_ = 200;
			rgba_layer_c0->conf_.blue_ = 200;
			rgba_layer_c0->conf_.alpha_ = 255;

			layer_confs.push_back(rgba_layer_c0);

			// 第一层为桌面层
			//auto screen_layer_c1 = std::make_shared<nt_pb_sdk::ScreenLayerConfigWrapper>(index++, true, 0, 0, 1280, 720);

			//screen_layer_c1->conf_.scale_filter_mode_ = 3;

			//layer_confs.push_back(screen_layer_c1);

			 第一层为窗口
			if (!x_win_list.empty())
			{
				auto window_layer_c1 = std::make_shared<nt_pb_sdk::WindowLayerConfigWrapper>(index++, true, 0, 0, 640, 360);

				window_layer_c1->conf_.xwindow_ = x_win_list.back();

				layer_confs.push_back(window_layer_c1);
			}

			 摄像头层
			if (!cameras.empty())
			{
				auto camera_layer_c1 = std::make_shared<nt_pb_sdk::CameraLayerConfigWrapper>(index++, true,
					640, 0, 640, 360);

				strcpy(camera_layer_c1->conf_.device_unique_id_, cameras.front().id_.c_str());

				camera_layer_c1->conf_.is_flip_horizontal_ = 0;
				camera_layer_c1->conf_.is_flip_vertical_ = 0;
				camera_layer_c1->conf_.rotate_degress_ = 0;

				layer_confs.push_back(camera_layer_c1);

				if (cameras.size() > 1)
				{
					auto camera_layer_c2 = std::make_shared<nt_pb_sdk::CameraLayerConfigWrapper>(index++, true,
						640, 0, 320, 240);

					strcpy(camera_layer_c2->conf_.device_unique_id_, cameras.back().id_.c_str());

					camera_layer_c2->conf_.is_flip_horizontal_ = 0;
					camera_layer_c2->conf_.is_flip_vertical_ = 0;
					camera_layer_c2->conf_.rotate_degress_ = 0;

					layer_confs.push_back(camera_layer_c2);
				}
			}

			auto image_layer1 = std::make_shared<nt_pb_sdk::ImageLayerConfigWrapper>(index++, true, 650, 120, 324, 300);

			strcpy(image_layer1->conf_.file_name_utf8_, "./testpng/tca.png");

			layer_confs.push_back(image_layer1);

			auto image_layer2 = std::make_shared<nt_pb_sdk::ImageLayerConfigWrapper>(index++, true, 120, 380, 182, 138);

			strcpy(image_layer2->conf_.file_name_utf8_, "./testpng/t4.png");

			layer_confs.push_back(image_layer2);

			std::vector<const NT_PB_LayerBaseConfig* > layer_base_confs;

			for (const auto& i : layer_confs)
			{
				layer_base_confs.push_back(i->getBase());
			}

			if (NT_ERC_OK != push_api->SetLayersConfig(push_handle, 0, layer_base_confs.data(),
				layer_base_confs.size(), 0, nullptr))
			{
				push_api->Close(push_handle);
				push_handle = nullptr;
				return nullptr;
			}
		}

		// push_api->SetScreenClip(push_handle, 0, 0, 1280, 720);

		if (video_option == NT_PB_E_VIDEO_OPTION_CAMERA)
		{
			if (!cameras.empty())
			{
				push_api->SetVideoCaptureDeviceBaseParameter(push_handle, cameras.front().id_.c_str(),
					640, 480);

				//push_api->FlipVerticalCamera(push_handle, 1);
				//push_api->FlipHorizontalCamera(push_handle, 1);
				//push_api->RotateCamera(push_handle, 0);
			}
		}

		if (video_option == NT_PB_E_VIDEO_OPTION_WINDOW)
		{
			if (!x_win_list.empty())
			{
				//push_api->SetCaptureXWindow(push_handle, x_win_list[0]);
				push_api->SetCaptureXWindow(push_handle, x_win_list.back());
			}
		}

		push_api->SetFrameRate(push_handle, dst_fps); // 帧率设置

		push_api->SetVideoEncoder(push_handle, 0, 1, NT_MEDIA_CODEC_ID_H264, 0);

		push_api->SetVideoBitRate(push_handle, 2000);  // 平均码率2000kbps
		push_api->SetVideoQuality(push_handle, 26);
		push_api->SetVideoMaxBitRate(push_handle, 4000); // 最大码率4000kbps

		// openh264 配置特定参数
		push_api->SetVideoEncoderSpecialInt32Option(push_handle, "usage_type", 0); //0是摄像头编码, 1是屏幕编码
		push_api->SetVideoEncoderSpecialInt32Option(push_handle, "rc_mode", 1); // 0是质量模式, 1是码率模式
		push_api->SetVideoEncoderSpecialInt32Option(push_handle, "enable_frame_skip", 0); // 0是关闭跳帧, 1是打开跳帧

		push_api->SetVideoKeyFrameInterval(push_handle, dst_fps * 2); // 关键帧间隔
		push_api->SetVideoEncoderProfile(push_handle, 3); // H264 high
		push_api->SetVideoEncoderSpeed(push_handle, 3); // 编码速度设置到3

		if (pulse_device_number > 0)
		{
			push_api->SetAudioInputLayer(push_handle, 2);
			push_api->SetAuidoInputDeviceId(push_handle, 0);
		}
		else if (alsa_device_number > 0)
		{
			push_api->SetAudioInputLayer(push_handle, 1);
			push_api->SetAuidoInputDeviceId(push_handle, 0);
		}

		push_api->SetEchoCancellation(push_handle, 1, 0);
		push_api->SetNoiseSuppression(push_handle, 1);
		push_api->SetAGC(push_handle, 1);
		push_api->SetVAD(push_handle, 1);

		push_api->SetInputAudioVolume(push_handle, 0, 1.0);
		push_api->SetInputAudioVolume(push_handle, 1, 0.2);

		// 音频配置
		push_api->SetPublisherAudioCodecType(push_handle, 1);
		//push_api->SetMute(push_handle, 1);

		return push_handle;
	}

发布RTSP流实现如下:

	bool start_rtsp_stream(NT_SmartPublisherSDKAPI* push_api, NT_HANDLE rtsp_server_handle, NT_HANDLE handle, const std::string stream_name) {

		push_api->SetRtspStreamName(handle, stream_name.c_str());

		push_api->ClearRtspStreamServer(handle);

		push_api->AddRtspStreamServer(handle, rtsp_server_handle, 0);
		
		if (NT_ERC_OK != push_api->StartRtspStream(handle, 0))
			return false;

		return true;
	}

如果需要本地摄像头或者屏幕预览数据,调研预览接口即可:

	// 开启预览,也可以不开启, 根据需求来
	push_api.SetPreviewXWindow(push_handle, "", sub_wid);
	push_api.StartPreview(push_handle, 0, nullptr);

如需停止:

	fprintf(stdout, "StopRtspStream++\n");

	push_api.StopRtspStream(push_handle);
	
	fprintf(stdout, "StopRtspStream--\n");

	fprintf(stdout, "stop_rtsp_server++\n");

	stop_rtsp_server(&push_api, rtsp_server_handle);

	fprintf(stdout, "stop_rtsp_server--\n");

	push_api.StopPreview(push_handle);

	// push_api.StopPublisher(push_handle);

	push_api.Close(push_handle);

	push_handle = nullptr;

	XDestroyWindow(display, sub_wid);
	XDestroyWindow(display, main_wid);
	XCloseDisplay(display);

	push_api.UnInit();

总结

Linux平台arm64实现轻量级RTSP服务,目前实现的功能如下:

  • 音频编码:AAC;
  • 视频编码:H.264;
  • 协议:RTSP;
  • [音视频]支持纯音频/纯视频/音视频推送;
  • 支持X11屏幕采集;
  • 支持部分V4L2摄像头设备采集;
  • [屏幕/V4L2摄像头]支持帧率、关键帧间隔(GOP)、码率(bit-rate)设置;
  • [V4L2摄像头]支持V4L2摄像头设备选择(设备文件名范围:[/dev/video0, /dev/video63])、分辨率设置、帧率设置;
  • [V4L2摄像头]支持水平反转、垂直反转、0° 90° 180° 270°旋转;
  • [音频]支持基于alsa-lib接口的音频采集;
  • [音频]支持基于libpulse接口采集本机PulseAudio服务音频;
  • [预览]支持实时预览; 支持RTSP端口设置;
  • 支持RTSP鉴权用户名、密码设置;
  • 支持获取当前RTSP服务会话连接数;
  • 支持x64_64架构、aarch64架构(需要glibc-2.21及以上版本的Linux系统, 需要libX11.so.6, 需要GLib–2.0, 需安装 libstdc++.so.6.0.21、GLIBCXX_3.4.21、 CXXABI_1.3.9)。

配合我们的RTSP播放器,可轻松实现150-400ms低延迟体验,感兴趣的开发者,可以单独跟我沟通。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/774340.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

gen_region_line 生成直线

gen_region_line (Operator) Name 名称 gen_region_line — Store input lines as regions.将输入行存储为region。 生成直线&#xff0c;直线区域 Signature 签名 gen_region_line( : RegionLines : BeginRow, BeginCol, EndRow, EndCol : ) Description 描述 运算符ge…

JavaScript基础知识5(对象)

JavaScript基础知识5&#xff08;对象&#xff09; 对象创建对象使用对象字面量使用 new Object() 访问和修改属性点表示法方括号表示法 动态添加和删除属性添加属性删除属性 对象方法对象的遍历常用属性和方法数学常量数学函数三角函数 使用示例生成随机整数计算圆的面积求最大…

yolov8-seg分割模型TensorRt部署,去掉torch

已完成的yolov8-seg分割模型TensorRt部署 准备下载yolov8-seg模型转化为onnx和trt推理写好的推理接口 准备 https://github.com/songjiahao-wq/yolov8_seg_trtinference.git下载代码 安装TensorRt8.6版本&#xff0c;以及pip install -r requirements.txt 下载yolov8-seg模型…

Kafka系列之Kafka知识超强总结

一、Kafka简介 Kafka是什么 Kafka是一种高吞吐量的分布式发布订阅消息系统&#xff08;消息引擎系统&#xff09;&#xff0c;它可以处理消费者在网站中的所有动作流数据。 这种动作&#xff08;网页浏览&#xff0c; 搜索和其他用户的行动&#xff09;是在现代网络上的许多社…

个人引导页+音乐炫酷播放器(附加源码)

个人引导页音乐炫酷播放器 效果图部分源码完整源码领取下期更新内容 效果图 部分源码 //网站动态标题开始 var OriginTitile document.title, titleTime; document.addEventListener("visibilitychange", function() {if (document.hidden) {document.title "…

为什么英智智能宝能让律师工作事半功倍

大语言模型能够极大提高人们的知识理解能力和知识服务能力&#xff0c;法律服务是典型的知识服务领域&#xff0c;据悉律师有38%的任务都是重复性工作&#xff0c;这些任务有潜力被大模型替代。 但在法律行业中的高度专业且复杂的问题时&#xff0c;通用型大模型的回答虽能提供…

Dungeonborne卡顿怎么办 快速解决Dungeonborne卡顿问题

随着Dungeonborne游戏剧情的深入&#xff0c;玩家将逐渐解锁更多的地图和副本&#xff0c;每个区域都有其独特的生态和敌人。在探索的过程中&#xff0c;玩家不仅可以获得强大的装备和道具&#xff0c;还能结识到志同道合的伙伴&#xff0c;共同面对更强大的敌人。不过也有玩家…

谷粒商城学习笔记-05-项目微服务划分图

文章目录 一&#xff0c;商城业务服务-前端服务二&#xff0c;商城业务服务-后端服务三&#xff0c;存储服务四&#xff0c;第三方服务五&#xff0c;服务治理六&#xff0c;日志七&#xff0c;监控预警系统1&#xff0c;Prometheus2&#xff0c;Grafana3&#xff0c;Prometheu…

奥能电源应邀参加2024年顺丰创π创新大会

企业动态&#xff5c;杭州奥能董事长陈虹先生和常务副总金晖女士受邀出席创π-产业科技创新大会&#xff0c;深入探讨“双碳”目标下的产业转型与技术创新 近日&#xff0c;杭州奥能董事长陈虹先生和常务副总金晖女士应邀出席了在杭州举办的创π-产业科技创新大会。本次大会以产…

嵌入式学习——硬件(UART)——day55

1. UART 1.1 定义 UART&#xff08;Universal Asynchronous Receiver/Transmitter&#xff0c;通用异步收发器&#xff09;是一种用于串行通信的硬件设备或模块。它的主要功能是将数据在串行和并行格式之间进行转换。UART通常用于计算机与外围设备或嵌入式系统之间的数据传输。…

Git仓库介绍

1. Github GitHub 本身是一个基于云端的代码托管平台&#xff0c;它提供的是远程服务&#xff0c;而不是一个可以安装在本地局域网的应用程序。因此&#xff0c;GitHub 不可以直接在本地局域网进行安装。 简介&#xff1a;GitHub是最流行的代码托管平台&#xff0c;提供了大量…

【Android源码】Gerrit上传Android源码

关于Gerrit的安装参考下面链接 【Android源码】Gerrit安装 要实现上传Android源码&#xff0c;需要经历以下几步&#xff1a; 下载Android代码创建源码仓库创建manifests仓库上传源码其他电脑下载源码 要证明Gerrit中的源码真实可用&#xff0c;肯定是以其他人能真正共享到代…

C++(第五天----多继承、虚继承、虚函数、虚表)

一、继承对象的内存空间 构造函数调用顺序&#xff0c;先调用父类&#xff0c;再调用子类 #include<iostream>using namespace std;//基类 父类 class Base{ public: //公有权限 类的外部 类的内部 Base(){cout<<"Base()"<<endl;}Base(int …

笔记本电脑升级实战手册[2]:清灰换硅脂

文章目录 前言&#xff1a;一、开盖拆卸二、清灰指南1. 电脑内部清灰2. 风扇清灰3. 清理散热铜管 三、更换硅脂总结&#xff1a; 前言&#xff1a; 这是笔记本电脑升级实战手册的第二篇文章&#xff0c;本篇主要是对电脑进行清灰换硅脂的处理的分享&#xff0c;使用电脑是华硕…

晨持绪电商:大学毕业生投资抖音网店怎么样

在这个数字化飞速发展的时代&#xff0c;传统的职业路径已不再是唯一的选择。对于充满激情和创意的大学毕业生来说&#xff0c;投资抖音网店或许是一个颇具前景的选择。 抖音作为一个流量巨大的社交媒体平台&#xff0c;为年轻人提供了一个展示自我、推广产品的绝佳舞台。与传统…

创新引领,构筑产业新高地

在数字经济的浪潮中&#xff0c;成都树莓集团以创新驱动为核心&#xff0c;通过整合行业资源、优化服务、培养数字产业人才等措施&#xff0c;致力于打造产业高地&#xff0c;推动地方经济的高质量发展。 一、创新驱动&#xff0c;引领产业发展 1、引入新技术、新模式&#xf…

平安养老险宿州中心支公司积极参与“78奋力前行”集体健步行活动

7月3日&#xff0c;平安养老保险股份有限公司&#xff08;以下简称“平安养老险”&#xff09;宿州中心支公司组织员工参加由宿州市保险行业协会2024年“78奋力前行”线下集体健步行活动。 平安养老险宿州中心支公司员工高举公司旗帜&#xff0c;与同业伙伴一起出发&#xff0…

maven设置阿里云镜像源(加速)

一、settings.xml介绍 settings.xml是maven的全局配置文件&#xff0c;maven的配置文件存在三个地方 项目中的pom.xml&#xff0c;这个是pom.xml所在项目的局部配置文件用户配置&#xff1a;${user.home}/.m2/settings.xml全局配置&#xff1a;${M2_HOME}/conf/settings.xml 优…

数据库国产化之路(一)

数据库国产化之路(一) 1、前言&#xff1a;适配海量数据库过程中的一些记录&#xff0c;备忘用 2、海量数据库基于的pg版本&#xff0c;查看PG_VERSION文件为9.2。 3、MySQL中的IF函数替代&#xff0c;一开始的方案是从网上找了个if函数&#xff0c;后来发现CASE WHEN其实能完成…

手把手教你生成一幅好看的AI图片

很多人看到别人用SD生成出来的图片感到非常的羡慕&#xff0c;因为即使给了他们最好的SD软件&#xff0c;他们也是词穷&#xff0c;不知道该如何去描述要生成的图片。 别急&#xff0c;这篇文章会一步步的教会你怎么才能生成一个好看的AI图片。 跟着我&#xff0c;别走丢。 …