当前位置: 首页 > news >正文

access 网站后台开发公司房产销售合同中必须明确哪些事项?

access 网站后台,开发公司房产销售合同中必须明确哪些事项?,asp做的网站后台怎么进去,dw网页制作详细步骤景颇族AVCaptureSession配置采集行为并协调从输入设备到采集输出的数据流。要执行实时音视频采集#xff0c;需要实例化采集会话并添加适当的输入和输出。 AVCaptureSession#xff1a;管理输入输出音视频流AVCaptureDevice#xff1a;相机硬件的接口#xff0c;用于控制硬件特性…AVCaptureSession配置采集行为并协调从输入设备到采集输出的数据流。要执行实时音视频采集需要实例化采集会话并添加适当的输入和输出。 AVCaptureSession管理输入输出音视频流AVCaptureDevice相机硬件的接口用于控制硬件特性诸如镜头的位置(前后摄像头)、曝光、闪光灯等。AVCaptureInput配置输入设备提供来自设备的数据AVCaptureOutput管理输出的音视频数据流AVCaptureConnection输入与输出的连接AVCaptureVideoPreviewLayer显示当前相机正在采集的状况AVAssetWriter将媒体数据写入到容器文件 初始化AVCaptureSession - (AVCaptureSession *)captureSession {if (_captureSession nil){_captureSession [[AVCaptureSession alloc] init];if ([_captureSession canSetSessionPreset:AVCaptureSessionPresetHigh]) {_captureSession.sessionPreset AVCaptureSessionPreset1280x720;}}return _captureSession; }- (dispatch_queue_t)videoQueue {if (!_videoQueue) {_videoQueue dispatch_queue_create(VideoCapture, DISPATCH_QUEUE_SERIAL);}return _videoQueue; } 添加视频输入 - (AVCaptureDevice *)getCameraDeviceWithPosition:(AVCaptureDevicePosition )position {AVCaptureDeviceDiscoverySession *deviceDiscoverySession [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:[AVCaptureDeviceTypeBuiltInWideAngleCamera] mediaType:AVMediaTypeVideo position:position];for (AVCaptureDevice *device in deviceDiscoverySession.devices) {if ([device position] position) {return device;}}return nil; }- (void)setupVideoInput {AVCaptureDevice *captureDevice [self getCameraDeviceWithPosition:AVCaptureDevicePositionBack];if (!captureDevice){NSLog(captureDevice failed);return;}NSError *error nil;self.videoInput [[AVCaptureDeviceInput alloc] initWithDevice:captureDevice error:error];if (error) {NSLog(videoInput error:%, error);return;}if ([self.captureSession canAddInput:self.videoInput]) {[self.captureSession addInput:self.videoInput];} }添加音频输入 - (void)setupAudioInput {AVCaptureDevice *captureDevice [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio];NSError *error nil;self.audioInput [[AVCaptureDeviceInput alloc] initWithDevice:captureDevice error:error];if (error) {NSLog(audioInput error:%, error);return;}if ([self.captureSession canAddInput:self.audioInput]) {[self.captureSession addInput:self.audioInput];} } 添加视频输出 - (void)setupVideoOutput {self.videoOutput [[AVCaptureVideoDataOutput alloc] init];self.videoOutput.alwaysDiscardsLateVideoFrames YES;[self.videoOutput setSampleBufferDelegate:self queue:self.videoQueue];if ([self.captureSession canAddOutput:self.videoOutput]) {[self.captureSession addOutput:self.videoOutput];} }添加音频输出 - (void)setupAudioOutput {self.audioOutput [[AVCaptureAudioDataOutput alloc] init];[self.audioOutput setSampleBufferDelegate:self queue:self.videoQueue];if ([self.captureSession canAddOutput:self.audioOutput]) {[self.captureSession addOutput:self.audioOutput];} } 设置视频预览 - (void)setupCaptureVideoPreviewLayer:(UIView *)previewView {_captureVideoPreviewLayer [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];CALayer *layer previewView.layer;_captureVideoPreviewLayer.frame previewView.bounds;_captureVideoPreviewLayer.videoGravity AVLayerVideoGravityResizeAspect;_captureVideoPreviewLayer.videoGravity AVLayerVideoGravityResizeAspectFill;_captureVideoPreviewLayer.connection.videoOrientation AVCaptureVideoOrientationLandscapeRight;[layer insertSublayer:_captureVideoPreviewLayer atIndex:0]; }开始和结束采集会话 - (void)startSession {if (![self.captureSession isRunning]) {[self.captureSession startRunning];} }- (void)stopSession{if ([self.captureSession isRunning]) {[self.captureSession stopRunning];} }初始化AVAssetWriter将音视频保存到视频文件 - (void)setUpWriter {if (self.videoURL nil) {return;}self.assetWriter [AVAssetWriter assetWriterWithURL:self.videoURL fileType:AVFileTypeMPEG4 error:nil];NSInteger numPixels kScreenWidth * kScreenHeight;CGFloat bitsPerPixel 12.0;NSInteger bitsPerSecond numPixels * bitsPerPixel;NSDictionary *compressionProperties { AVVideoAverageBitRateKey : (bitsPerSecond),AVVideoExpectedSourceFrameRateKey : (15),AVVideoMaxKeyFrameIntervalKey : (15),AVVideoProfileLevelKey : AVVideoProfileLevelH264BaselineAutoLevel };self.videoCompressionSettings { AVVideoCodecKey : AVVideoCodecTypeH264,AVVideoWidthKey : (width * 2),AVVideoHeightKey : (height * 2),AVVideoScalingModeKey : AVVideoScalingModeResizeAspect,AVVideoCompressionPropertiesKey : compressionProperties };_assetWriterVideoInput [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:self.videoCompressionSettings];_assetWriterVideoInput.expectsMediaDataInRealTime YES;self.audioCompressionSettings { AVEncoderBitRatePerChannelKey : (28000),AVFormatIDKey : (kAudioFormatMPEG4AAC),AVNumberOfChannelsKey : (1),AVSampleRateKey : (22050) };_assetWriterAudioInput [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeAudio outputSettings:self.audioCompressionSettings];_assetWriterAudioInput.expectsMediaDataInRealTime YES;if ([_assetWriter canAddInput:_assetWriterVideoInput]){[_assetWriter addInput:_assetWriterVideoInput];}else{NSLog(AssetWriter videoInput append Failed);}if ([_assetWriter canAddInput:_assetWriterAudioInput]){[_assetWriter addInput:_assetWriterAudioInput];}else{NSLog(AssetWriter audioInput Append Failed);}_canWrite NO; } AVCaptureVideoDataOutputSampleBufferDelegate和AVCaptureAudioDataOutputSampleBufferDelegate音视频处理 #pragma mark - AVCaptureVideoDataOutputSampleBufferDelegate|AVCaptureAudioDataOutputSampleBufferDelegate - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {autoreleasepool{if (connection [self.videoOutput connectionWithMediaType:AVMediaTypeVideo]) {synchronized(self){[self appendSampleBuffer:sampleBuffer ofMediaType:AVMediaTypeVideo];}}if (connection [self.audioOutput connectionWithMediaType:AVMediaTypeAudio]) {synchronized(self) {[self appendSampleBuffer:sampleBuffer ofMediaType:AVMediaTypeAudio];}}} }- (void)appendSampleBuffer:(CMSampleBufferRef)sampleBuffer ofMediaType:(NSString *)mediaType {if (sampleBuffer NULL){NSLog(empty sampleBuffer);return;}autoreleasepool{if (!self.canWrite mediaType AVMediaTypeVideo){[self.assetWriter startWriting];[self.assetWriter startSessionAtSourceTime:CMSampleBufferGetPresentationTimeStamp(sampleBuffer)];self.canWrite YES;}if (mediaType AVMediaTypeVideo){if (self.assetWriterVideoInput.readyForMoreMediaData){BOOL success [self.assetWriterVideoInput appendSampleBuffer:sampleBuffer];if (!success){NSLog(assetWriterVideoInput appendSampleBuffer fail);synchronized (self){[self stopVideoRecorder];}}}}if (mediaType AVMediaTypeAudio){if (self.assetWriterAudioInput.readyForMoreMediaData){BOOL success [self.assetWriterAudioInput appendSampleBuffer:sampleBuffer];if (!success){NSLog(assetWriterAudioInput appendSampleBuffer fail);synchronized (self){[self stopVideoRecorder];}}}}} } 停止视频录制 - (void)stopVideoRecorder {__weak __typeof(self)weakSelf self;if(_assetWriter _assetWriter.status AVAssetWriterStatusWriting) {[_assetWriter finishWritingWithCompletionHandler:^{weakSelf.canWrite NO;weakSelf.assetWriter nil;weakSelf.assetWriterAudioInput nil;weakSelf.assetWriterVideoInput nil;}];} }
http://www.hkea.cn/news/14298950/

相关文章:

  • 销售产品网站有哪些wordpress 多个分类查找
  • 吴忠网站建设报价怎样学网站建设
  • 企业门户网站怎么做WordPress文章添加动态背景
  • 湘潭租房网站靖江网站设计
  • 科协网站建设的意见用帝国cms做门户网站
  • 网站服务器怎么看是哪个厂家的创意广告图片及文字解析
  • 浏览器 网络 网站营销思路八大要点
  • 营销网站解决方案学院网站设计案例
  • 网站制作公司网站建设网站沈阳曙光医院看男科怎么样
  • 移动网站优化外贸网站示例
  • 开发网站的空间分录网站开发中应注意哪些问题
  • 百度搜索搜不到网站公司注册网上怎样注册
  • 权威的公司网站制作windows系统的vps网站防攻击
  • 清理网站后台缓存wap网站 链接微信
  • 华建设计网站wordpress文章目录插件
  • p2p网站建设资质门户网站建设经验总结报告
  • 中山网站制作专业石家庄网站优化招聘
  • 工商局网站建设查不到维护网站要做哪些工作
  • 行业网站做的好的杭州app开发公司定制外包
  • 做分色找工作网站产品做国外网站有哪些
  • 合肥建设企业网站做网站是否要去工商备案
  • 百度网站开发wordpress 一栏主题
  • 手机制作网站免费建设个人网上银行登录入口官网
  • jsp网站开发学习心得设计家网站
  • 四川网站建设和优化wordpress 雅黑字体
  • 如何建立网站管理系统如何创建一个网站0元
  • 成都记者留言网站网站seo步骤
  • 网站的网站维护的原因企业服务包括哪些方面
  • 做网站优化需要多少钱组织建设一百年全文
  • 怎么做网站关键词排名怎么使网站降权