WebRTC音视频通话-RTC直播本地视频及相册视频文件

news2025/4/28 12:27:08

WebRTC音视频通话-RTC直播本地视频及相册视频文件

WebRTC音视频通话-RTC直播本地视频文件效果图如下
在这里插入图片描述

WebRTC音视频通话-RTC直播本地视频文件时候,用到了AVPlayer、CADisplayLink。

一、通过AVPlayer播放本地视频

  • AVPlayer是什么?

AVPlayer是基于AVFoundation框架的一个类,很接近底层,灵活性强,可以自定义视频播放样式。

  • AVPlayerLayer是什么?

AVPlayerLayer是视频播放时候的画面展示层。

  • CADisplayLink是什么?

CADisplayLink和NSTimer一样,是一个定时器。但是CADisplayLink会和屏幕的刷新率始终保持一致(很多时候会使用CADisplayLink来检测屏幕的帧率)。

  • AVPlayerItemVideoOutput是什么?

AVPlayerItemVideoOutput是PlayerItem视频的输出,通过AVPlayerItemVideoOutput可以获取视频的CVPixelBufferRef

下面就实现本地视频播放过程中结合ossrs进行WebRTC直播。

AVPlayer设置播放本地视频

 AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithURL:[NSURL fileURLWithPath:videoPath]];
 (void)reloadPlayItem:(AVPlayerItem *)playerItem {
    self.playerItem = playerItem;
    [self initPlayerVideoOutput];
        
    self.player = [AVPlayer playerWithPlayerItem:self.playerItem];
}

开始配置播放展示AVPlayerLayer

- (void)startPlay {
    if (self.isPlaying) {
        return;
    }
    
    AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
    self.playerLayer = playerLayer;
    self.playerLayer.backgroundColor = [UIColor clearColor].CGColor;
    self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
    
    [self.superView.layer addSublayer:self.playerLayer];
    self.playerLayer.frame = self.superView.bounds;

    [self.player seekToTime:CMTimeMake(0, 1)];
    [self.player play];
    [self startAnimating];
}

通过KVO监控播放器状态

/**
 *  通过KVO监控播放器状态
 */
- (void)observeValueForKeyPath:(NSString *)keyPath {
    DebugLog(@"observeValueForKeyPath:%@", keyPath);
    
    AVPlayerItem *videoItem = self.playerItem;
    if ([keyPath isEqualToString:@"timeControlStatus"]) {
        
        /**
         typedef NS_ENUM(NSInteger, AVPlayerTimeControlStatus) {
             AVPlayerTimeControlStatusPaused = 0,
             AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate = 1,
             AVPlayerTimeControlStatusPlaying = 2
         } API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
         */
        // 监听播放器timeControlStatus 指示当前是否正在播放,无限期暂停播放,或在等待适当的网络条件时暂停播放
        if (@available(iOS 10.0, *)) {
            switch (self.player.timeControlStatus) {
                case AVPlayerTimeControlStatusPaused: {
                    NSLog(@"AVPlayerTimeControlStatusPaused");
                    // 暂停
                    self.isPlaying = NO;
                }
                    break;
                case AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate: {
                    NSLog(@"AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate");
                    // 等待
                }
                    break;
                case AVPlayerTimeControlStatusPlaying: {
                    NSLog(@"AVPlayerTimeControlStatusPlaying");
                    // 播放
                    self.isPlaying = YES;
                }
                    break;
                default:
                    break;
            }
        } else {
            // Fallback on earlier versions
        }
    }
}

设置关键的AVPlayerItemVideoOutput

- (void)initPlayerVideoOutput {
    //输出yuv 420格式
    NSDictionary *pixBuffAttributes = @{(id)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange)};
    AVPlayerItemVideoOutput *output = [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:pixBuffAttributes];
    [self.playerItem addOutput:output];
    self.playerItemVideoOutput = output;
    
    [self.playerItemVideoOutput setDelegate:self queue:dispatch_get_main_queue()];
    
    // 如果将 AVPlayerItemVideoOutput 类的输出(对于 suppressesPlayerRendering 的值为 YES)添加到 AVPlayerItem,则该项目的视频媒体将不会由 AVPlayer 呈现,而音频媒体、字幕媒体和其他类型的媒体(如果存在) , 将被渲染。
    self.playerItemVideoOutput.suppressesPlayerRendering = NO;
}

之后通过displayLink开启实时调用AVPlayerItemVideoOutput得到视频画面CVPixelBufferRef

#pragma mark - DisplayLink
- (void)startDisplayLink {
    if (self.displayLink) {
        return;
    }
    self.displayLink = [CADisplayLink displayLinkWithTarget:[YYWeakProxy proxyWithTarget:self]
     selector:@selector(handleDisplayLink:)];
    [self.displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    // self.displayLink.preferredFramesPerSecond = 2;
    self.displayLink.paused = NO;
}

- (void)handleDisplayLink:(CADisplayLink *)displayLink {
    //do something
    CMTime outputItemTime = kCMTimeInvalid;
    CFTimeInterval nextVSync = ([displayLink timestamp] + [displayLink duration]);
    outputItemTime = [[self playerItemVideoOutput] itemTimeForHostTime:nextVSync];
    if ([[self playerItemVideoOutput] hasNewPixelBufferForItemTime:outputItemTime]) {
        CVPixelBufferRef pixelBuffer = NULL;
        pixelBuffer = [[self playerItemVideoOutput] copyPixelBufferForItemTime:outputItemTime itemTimeForDisplay:NULL];
        // ..... do something with pixbuffer
        if (self.delegate && [self.delegate respondsToSelector:@selector(videoLivePlayerPixelBufferRef:)]) {
            [self.delegate videoLivePlayerPixelBufferRef:pixelBuffer];
        }
        
        if (pixelBuffer != NULL) {
            CFRelease(pixelBuffer);
        }
    }
}

- (void)stopDisplayLink {
    [self.displayLink invalidate];
    self.displayLink = nil;
}

这样在播放过程中,通过CADisplayLink获取到CVPixelBufferRef,之后使用WebRTC来进行直播。

完整播放视频过程中获得CVPixelBufferRef代码如下

SDVideoLivePlayer.h

#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>

@protocol SDVideoLivePlayerDelegate;
@interface SDVideoLivePlayer : NSObject

@property (nonatomic, strong) UIView *superView;

@property (nonatomic, weak) id<SDVideoLivePlayerDelegate> delegate;

- (instancetype)initWithSuperView:(UIView *)superView;

- (void)reloadPlayItem:(AVPlayerItem *)playerItem;

/// 开始播放
- (void)startPlay;

/// 结束播放
- (void)stopPlay;

@end

@protocol SDVideoLivePlayerDelegate <NSObject>

- (void)videoLivePlayerPixelBufferRef:(CVPixelBufferRef)pixelBufferRef;

@end

SDVideoLivePlayer.m

#import "SDVideoLivePlayer.h"

@interface SDVideoLivePlayer ()<AVPlayerItemOutputPullDelegate> {

}

@property (nonatomic, strong) AVPlayer *player;
@property (nonatomic, strong) AVPlayerLayer *playerLayer;
@property (nonatomic, strong) AVPlayerItem *playerItem;
@property (nonatomic, assign) BOOL isPlaying;
@property (nonatomic, strong) AVPlayerItemVideoOutput *playerItemVideoOutput;
@property (nonatomic, strong) CADisplayLink *displayLink;

@end

@implementation SDVideoLivePlayer

- (instancetype)initWithSuperView:(UIView *)superView
{
    self = [super init];
    if (self) {
        self.superView = superView;
        self.isPlaying = NO;
        [self addNotifications];
        [self initPlayerVideoOutput];
    }
    return self;
}

- (void)initPlayerVideoOutput {
    //输出yuv 420格式
    NSDictionary *pixBuffAttributes = @{(id)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange)};
    AVPlayerItemVideoOutput *output = [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:pixBuffAttributes];
    [self.playerItem addOutput:output];
    self.playerItemVideoOutput = output;
    
    [self.playerItemVideoOutput setDelegate:self queue:dispatch_get_main_queue()];
    
    // 如果将 AVPlayerItemVideoOutput 类的输出(对于 suppressesPlayerRendering 的值为 YES)添加到 AVPlayerItem,则该项目的视频媒体将不会由 AVPlayer 呈现,而音频媒体、字幕媒体和其他类型的媒体(如果存在) , 将被渲染。
    self.playerItemVideoOutput.suppressesPlayerRendering = NO;
}

- (void)reloadPlayItem:(AVPlayerItem *)playerItem {
    
    self.playerItem = playerItem;
    [self initPlayerVideoOutput];
        
    self.player = [AVPlayer playerWithPlayerItem:self.playerItem];
}

- (void)startPlay {
    if (self.isPlaying) {
        return;
    }
    
    AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
    self.playerLayer = playerLayer;
    self.playerLayer.backgroundColor = [UIColor clearColor].CGColor;
    self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
    
    [self.superView.layer addSublayer:self.playerLayer];
    self.playerLayer.frame = self.superView.bounds;

    [self.player seekToTime:CMTimeMake(0, 1)];
    [self.player play];
    [self startAnimating];
}

- (void)stopPlay {
    self.isPlaying = NO;
    [self.player pause];
    [self stopAnimating];
}

/**
 *  通过KVO监控播放器状态
 */
- (void)observeValueForKeyPath:(NSString *)keyPath {
    DebugLog(@"observeValueForKeyPath:%@", keyPath);
    
    AVPlayerItem *videoItem = self.playerItem;
    if ([keyPath isEqualToString:@"timeControlStatus"]) {
        
        /**
         typedef NS_ENUM(NSInteger, AVPlayerTimeControlStatus) {
             AVPlayerTimeControlStatusPaused = 0,
             AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate = 1,
             AVPlayerTimeControlStatusPlaying = 2
         } API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
         */
        // 监听播放器timeControlStatus 指示当前是否正在播放,无限期暂停播放,或在等待适当的网络条件时暂停播放
        if (@available(iOS 10.0, *)) {
            switch (self.player.timeControlStatus) {
                case AVPlayerTimeControlStatusPaused: {
                    NSLog(@"AVPlayerTimeControlStatusPaused");
                    // 暂停
                    self.isPlaying = NO;
                }
                    break;
                case AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate: {
                    NSLog(@"AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate");
                    // 等待
                }
                    break;
                case AVPlayerTimeControlStatusPlaying: {
                    NSLog(@"AVPlayerTimeControlStatusPlaying");
                    // 播放
                    self.isPlaying = YES;
                }
                    break;
                default:
                    break;
            }
        } else {
            // Fallback on earlier versions
        }
    }
}

- (void)audioSessionInterrupted:(NSNotification *)notification{
    //通知类型
    NSDictionary * info = notification.userInfo;
    if ([[info objectForKey:AVAudioSessionInterruptionTypeKey] integerValue] == 1) {
        [self.player pause];
    } else {
        [self.player play];
    }
}

- (void)startAnimating {
    [self startDisplayLink];
    self.displayLink.paused = NO;
}

- (void)stopAnimating {
    self.displayLink.paused = YES;
    [self stopDisplayLink];
}

- (void)pauseAnimating {
    self.displayLink.paused = YES;
    [self stopDisplayLink];
}

- (void)resumeAnimating {
    if (!self.displayLink) {
        [self startDisplayLink];
    }
    self.displayLink.paused = NO;
}

#pragma mark - DisplayLink
- (void)startDisplayLink {
    if (self.displayLink) {
        return;
    }
    self.displayLink = [CADisplayLink displayLinkWithTarget:[YYWeakProxy proxyWithTarget:self]
     selector:@selector(handleDisplayLink:)];
    [self.displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    // self.displayLink.preferredFramesPerSecond = 2;
    self.displayLink.paused = NO;
}

- (void)handleDisplayLink:(CADisplayLink *)displayLink {
    //do something
    CMTime outputItemTime = kCMTimeInvalid;
    CFTimeInterval nextVSync = ([displayLink timestamp] + [displayLink duration]);
    outputItemTime = [[self playerItemVideoOutput] itemTimeForHostTime:nextVSync];
    if ([[self playerItemVideoOutput] hasNewPixelBufferForItemTime:outputItemTime]) {
        CVPixelBufferRef pixelBuffer = NULL;
        pixelBuffer = [[self playerItemVideoOutput] copyPixelBufferForItemTime:outputItemTime itemTimeForDisplay:NULL];
        // ..... do something with pixbuffer
        if (self.delegate && [self.delegate respondsToSelector:@selector(videoLivePlayerPixelBufferRef:)]) {
            [self.delegate videoLivePlayerPixelBufferRef:pixelBuffer];
        }
        
        if (pixelBuffer != NULL) {
            CFRelease(pixelBuffer);
        }
    }
}

- (void)stopDisplayLink {
    [self.displayLink invalidate];
    self.displayLink = nil;
}

#pragma mark - AVPlayerItemOutputPullDelegate
- (void)outputMediaDataWillChange:(AVPlayerItemOutput *)sender {
    [self stopPlay];
}

#pragma mark - Observers
- (void)addNotifications {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(replay:) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
    
    // 音频播放被中断
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(audioSessionInterrupted:) name:AVAudioSessionInterruptionNotification object:nil];
    
    __weak typeof(self) weakSelf = self;
    if (@available(iOS 10.0, *)) {
        [self.KVOController observe:self.player keyPath:@"timeControlStatus" options:NSKeyValueObservingOptionOld|NSKeyValueObservingOptionNew block:^(id  _Nullable observer, id  _Nonnull object, NSDictionary<NSString *,id> * _Nonnull change) {
            __strong typeof(weakSelf) strongSelf = weakSelf;
            [strongSelf observeValueForKeyPath:@"timeControlStatus"];
        }];
    }
}

- (void)removeNotifications {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [self.KVOController unobserveAll];
}

- (void)replay:(NSNotification *)notification {
    if (notification.object == self.player.currentItem) {
        [self.player seekToTime:CMTimeMake(0, 1)];
        [self.player play];
    }
}

- (void)dealloc {
    [self removeNotifications];
}

@end

二、获取相册视频

获取相册视频代码如下,得到AVPlayerItem,调用- (void)reloadPlayItem:(AVPlayerItem *)playerItem;

- (void)startPlayAlbumVideo:(SDMediaModel *)mediaModel {
    if (!(mediaModel && mediaModel.phasset)) {
        return;
    }
    __weak typeof(self) weakSelf = self;
    [[PhotoKitManager shareInstance] requestPlayerItemForVideo:mediaModel.phasset completion:^(AVPlayerItem *playerItem) {
        __strong typeof(weakSelf) strongSelf = weakSelf;
        [strongSelf.videoLivePlayer reloadPlayItem:playerItem];
        [strongSelf.videoLivePlayer startPlay];
    } failure:^{
        __strong typeof(weakSelf) strongSelf = weakSelf;
    }];
}

三、WebRTC来进行RTC直播视频

CADisplayLink获取到CVPixelBufferRef,我们使用WebRTC来进行直播,相当于我们直播我们预先准备好的一个视频。
在之前实现了GPUImage视频通话视频美颜滤镜,这里用到了RTCVideoFrame,我们需要将得到的视频的CVPixelBufferRef,通过封装成RTCVideoFrame,通过调用RTCVideoSource的didCaptureVideoFrame方法实现最终的效果。

RTCVideoSource设置如下

- (RTCVideoTrack *)createVideoTrack {
    RTCVideoSource *videoSource = [self.factory videoSource];
    self.localVideoSource = videoSource;

    // 如果是模拟器
    if (TARGET_IPHONE_SIMULATOR) {
        if (@available(iOS 10, *)) {
            self.videoCapturer = [[RTCFileVideoCapturer alloc] initWithDelegate:self];
        } else {
            // Fallback on earlier versions
        }
    } else{
        self.videoCapturer = [[RTCCameraVideoCapturer alloc] initWithDelegate:self];
    }
    
    RTCVideoTrack *videoTrack = [self.factory videoTrackWithSource:videoSource trackId:@"video0"];
    
    return videoTrack;
}


- (void)createMediaSenders {
    if (!self.isPublish) {
        return;
    }
    
    NSString *streamId = @"stream";
    
    // Audio
    RTCAudioTrack *audioTrack = [self createAudioTrack];
    self.localAudioTrack = audioTrack;
    
    RTCRtpTransceiverInit *audioTrackTransceiver = [[RTCRtpTransceiverInit alloc] init];
    audioTrackTransceiver.direction = RTCRtpTransceiverDirectionSendOnly;
    audioTrackTransceiver.streamIds = @[streamId];
    
    [self.peerConnection addTransceiverWithTrack:audioTrack init:audioTrackTransceiver];
    
    // Video
    RTCVideoTrack *videoTrack = [self createVideoTrack];
    self.localVideoTrack = videoTrack;
    RTCRtpTransceiverInit *videoTrackTransceiver = [[RTCRtpTransceiverInit alloc] init];
    videoTrackTransceiver.direction = RTCRtpTransceiverDirectionSendOnly;
    videoTrackTransceiver.streamIds = @[streamId];
    [self.peerConnection addTransceiverWithTrack:videoTrack init:videoTrackTransceiver];
}

详细内容请看iOS端调用ossrs音视频通话部分。

将得到的视频的CVPixelBufferRef,通过封装成RTCVideoFrame,再通过调用RTCVideoSource的didCaptureVideoFrame方法。

- (RTCVideoFrame *)webRTCClient:(WebRTCClient *)client didCaptureVideoFrame:(RTCVideoFrame *)frame videoPixelBufferRef:(CVPixelBufferRef)videoPixelBufferRef {
    RTCCVPixelBuffer *rtcPixelBuffer =
    [[RTCCVPixelBuffer alloc] initWithPixelBuffer:videoPixelBufferRef];
    RTCVideoFrame *rtcVideoFrame =
    [[RTCVideoFrame alloc] initWithBuffer:rtcPixelBuffer
                                 rotation:frame.rotation
                              timeStampNs:frame.timeStampNs];
    return rtcVideoFrame;
}

使用RTCVideoSource调用didCaptureVideoFrame

[self.localVideoSource capturer:capturer didCaptureVideoFrame:frame];

其他
之前搭建ossrs服务,可以查看:https://blog.csdn.net/gloryFlow/article/details/132257196
之前实现iOS端调用ossrs音视频通话,可以查看:https://blog.csdn.net/gloryFlow/article/details/132262724
之前WebRTC音视频通话高分辨率不显示画面问题,可以查看:https://blog.csdn.net/gloryFlow/article/details/132262724
修改SDP中的码率Bitrate,可以查看:https://blog.csdn.net/gloryFlow/article/details/132263021
GPUImage视频通话视频美颜滤镜,可以查看:https://blog.csdn.net/gloryFlow/article/details/132265842

四、小结

WebRTC音视频通话-RTC直播本地视频文件。主要用到AVPlayer播放视频,AVPlayerItemVideoOutput得到CVPixelBufferRef,将处理后的CVPixelBufferRef生成RTCVideoFrame,通过调用WebRTC的localVideoSource中实现的didCaptureVideoFrame方法。内容较多,描述可能不准确,请见谅。

本文地址:https://blog.csdn.net/gloryFlow/article/details/132267068

学习记录,每天不停进步。

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

进程间的通信

进程的通信&#xff0c;光是听概念就知道这是一个非常重要的知识点&#xff0c;但是之前学习的概念其实都无法实现真正意义上的进程间的通信&#xff1a; 子进程调用exit或Exit或_exit&#xff0c;然后父进程通过wait可以知道其状态&#xff0c;这虽然实现了消息的传递&#x…

【图像分类】理论篇(2)经典卷积神经网络 Lenet~Densenet

1、卷积运算 在二维卷积运算中&#xff0c;卷积窗口从输入张量的左上角开始&#xff0c;从左到右、从上到下滑动。 当卷积窗口滑动到新一个位置时&#xff0c;包含在该窗口中的部分张量与卷积核张量进行按元素相乘&#xff0c;得到的张量再求和得到一个单一的标量值&#xff0c…

算法与数据结构(二十三)动态规划设计:最长递增子序列

注&#xff1a;此文只在个人总结 labuladong 动态规划框架&#xff0c;仅限于学习交流&#xff0c;版权归原作者所有&#xff1b; 也许有读者看了前文 动态规划详解&#xff0c;学会了动态规划的套路&#xff1a;找到了问题的「状态」&#xff0c;明确了 dp 数组/函数的含义&a…

二叉树的存储结构(顺序存储)—— 数据结构与算法

&#x1f636;‍&#x1f32b;️Take your time ! &#x1f636;‍&#x1f32b;️ &#x1f4a5;个人主页&#xff1a;&#x1f525;&#x1f525;&#x1f525;大魔王&#x1f525;&#x1f525;&#x1f525; &#x1f4a5;代码仓库&#xff1a;&#x1f525;&#x1f525;魔…

《雷达像智能识别对抗研究进展》阅读记录

&#xff08;1&#xff09;引言 ​ 神经网络通常存在鲁棒性缺陷&#xff0c;易受到对抗攻击的威胁。攻击者可以隐蔽的诱导雷达智能目标识别做出错误预测&#xff0c;如&#xff1a; ​ a图是自行车&#xff0c;加上对抗扰动后神经网络就会将其识别为挖掘机。 &#xff08;2&a…

一探Linux下的七大进程状态

文章目录 一、前言二、操作系统学科下的进程状态1、运行状态2、阻塞状态3、挂起状态 三、Linux下的7种进程状态1、运行状态R2、浅度睡眠状态S3、深度睡眠状态D一场有趣的官司 4、停止状态T5、进程跟踪状态t6、死亡状态X7、僵死状态Z —— 两个特殊进程① 僵尸进程② 孤儿进程 四…

算法竞赛备赛之搜索与图论训练提升,暑期集训营培训

目录 1.DFS和BFS 1.1.DFS深度优先搜索 1.2.BFS广度优先搜索 2.树与图的遍历&#xff1a;拓扑排序 3.最短路 3.1.迪杰斯特拉算法 3.2.贝尔曼算法 3.3.SPFA算法 3.4.多源汇最短路Floy算法 4.最小生成树 4.1.普利姆算法 4.2.克鲁斯卡尔算法 5.二分图&#xff1a;染色法…

嵌入式学习之strcpy、memset、realloc、malloc使用方法

今天主要针对C语言的strcpy memset realloc mallooc函数进行了学习。 char* strcpy(char* destination,const char* source); void memset ( void *s , char ch, unsigned n )&#xff1b; void* realloc(void* memblock, size_t size)&#xff1b; void *malloc(size_t si…

tkinter打造三维绘图系统,附源代码

文章目录 输入数据加载数据绘图函数源代码 Python绘图系统系列&#xff1a;将matplotlib嵌入到tkinter 简单的绘图系统 数据导入 输入数据 三维绘图需要一个新的坐标变量&#xff0c;设置为z&#xff0c;这个改改UI就可以办到&#xff0c;并不困难。但是&#xff0c;此前用于…

git安装介绍

一、分布式版本控制系统Git概述 1.1 分布式版本控制系统Git介绍 版本控制定义 记录和跟踪项目中各文件内容的改动变化 保存项目的版本历史&#xff0c;以及改动原因&#xff0c;从而让用户能够查看各个历史版本 版本控制系统也是帮助人员进行协作开发的利器 为什么需要版本…

WebRTC音视频通话-WebRTC本地视频通话使用ossrs服务搭建

iOS开发-ossrs服务WebRTC本地视频通话服务搭建 之前开发中使用到了ossrs&#xff0c;这里记录一下ossrs支持的WebRTC本地服务搭建。 一、ossrs是什么&#xff1f; ossrs是什么呢&#xff1f; SRS(Simple Realtime Server)是一个简单高效的实时视频服务器&#xff0c;支持RTM…

福康源:用孝道温暖每一个心灵,共筑幸福健康新人生!

福康源&#xff1a;用孝道温暖每一个心灵&#xff0c;共筑幸福健康新人生 孝道的光芒&#xff1a;福康源的初心 在浮躁的现代社会&#xff0c;孝道的力量正被越来越多的人忽略。然而&#xff0c;福康源的初心却始终坚守孝顺的真谛。孝道不仅是对父母的敬爱&#xff0c;更是一种…

【解析postman工具的使用---基础篇】

postman前端请求详解 主界面1.常见类型的接口请求1.1 查询参数的接口请求1.1.1 什么是查询参数?1.1.2 postman如何请求 1.2 ❤表单类型的接口请求1.2.1 复习下http请求1.2.2❤ 什么是表单 1.3 上传文件的表单请求1.4❤ json类型的接口请求 2. 响应接口数据分析2.1 postman的响…

程序设计 树基础

✅作者简介&#xff1a;人工智能专业本科在读&#xff0c;喜欢计算机与编程&#xff0c;写博客记录自己的学习历程。 &#x1f34e;个人主页&#xff1a;小嗷犬的个人主页 &#x1f34a;个人网站&#xff1a;小嗷犬的技术小站 &#x1f96d;个人信条&#xff1a;为天地立心&…

Lorilla LLM - 面向API调用生成的专用AI大模型

Gorilla 是一种先进的大型语言模型 (LLM)&#xff0c;旨在与各种 API 有效交互&#xff0c;从而增强 LLM 在实际应用中的功能。 Gorilla LLM的相关链接&#xff1a;官网 | github | 论文。 推荐&#xff1a;用 NSDT编辑器 快速搭建可编程3D场景 1、Gorilla LLM简介 通过使用自…

CentOS 项目作出声明,宣称自家 Linux 社区 “始终向所有人开放”

导读在红帽 RHEL 开源事件后&#xff0c;许多兼容 RHEL 的发行版最近都进行了表态&#xff0c;CentOS 项目也在日前作出了声明&#xff0c;宣称自家社区 “始终向所有人开放”。 据悉&#xff0c;CentOS 项目董事会日前在官方博客发布了一则公告&#xff0c;内容主要涉及“ Ce…

拒绝摆烂!C语言练习打卡第一天

&#x1f525;博客主页&#xff1a;小王又困了 &#x1f4da;系列专栏&#xff1a;每日一练 &#x1f31f;人之为学&#xff0c;不日近则日退 ❤️感谢大家点赞&#x1f44d;收藏⭐评论✍️ &#x1f5d2;️前言&#xff1a; 在前面我们学习完C语言的所以知识&#xff0c;当…

LangChain手记 Models,Prompts and Parsers

整理并翻译自DeepLearning.AILangChain的官方课程&#xff1a;Models,Prompts and Parsers 模型&#xff0c;提示词和解析器&#xff08;Models, Prompts and Parsers&#xff09; 模型&#xff1a;大语言模型提示词&#xff1a;构建传递给模型的输入的方式解析器&#xff1a;…

NAS搭建指南二——影视资源中心

1. 刮削 这一部分是利用 tinyMediaManager 进行影视资源的评分、简介以及图片的搜集工作tinyMediaManager 官方网站地址下载及安装过程&#xff1a;略我的主要修改的设置项如下所示&#xff1a; 使用方法&#xff1a; a. 点击更新媒体库 b. 选择影片–>右键单击–>…

Ubuntu 20.04(服务器版)安装 Anaconda

0、Anaconda介绍 Anaconda是一个开源的Python发行版本&#xff0c;包含了包括Python、Conda、科学计算库等180多个科学包及其依赖项。因此&#xff0c;安装了Anaconda就不用再单独安装CUDA、Python等。 CUDA&#xff0c;在进行深度学习的时候&#xff0c;需要用到GPU&#xf…