Commit 2d12bae309d6909b1d03aff52529489a414c54ea
1 parent
fa7c97b4
修改压缩分辨率和码率
Showing
3 changed files
with
8 additions
and
7 deletions
CNLiveUploadManager.podspec
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | Pod::Spec.new do |s| | 9 | Pod::Spec.new do |s| |
| 10 | s.name = 'CNLiveUploadManager' | 10 | s.name = 'CNLiveUploadManager' |
| 11 | - s.version = '0.1.21' | 11 | + s.version = '0.1.22' |
| 12 | s.summary = '压缩上传,组件化中加入新参数加入outPath,不在直接取' | 12 | s.summary = '压缩上传,组件化中加入新参数加入outPath,不在直接取' |
| 13 | 13 | ||
| 14 | # This description is used to generate tags and improve search results. | 14 | # This description is used to generate tags and improve search results. |
CNLiveUploadManager/Classes/CNLiveUploadManager.m
| @@ -2422,7 +2422,7 @@ static CNLiveUploadManager *_uploadManager; | @@ -2422,7 +2422,7 @@ static CNLiveUploadManager *_uploadManager; | ||
| 2422 | shortVideoTranscoder.outputURL = [NSURL fileURLWithPath:editOutputPath]; | 2422 | shortVideoTranscoder.outputURL = [NSURL fileURLWithPath:editOutputPath]; |
| 2423 | shortVideoTranscoder.outputFileType = PLSFileTypeMPEG4; | 2423 | shortVideoTranscoder.outputFileType = PLSFileTypeMPEG4; |
| 2424 | shortVideoTranscoder.outputFilePreset = [CNLiveUploadManager presetWithVideoLimitType:limitType url:url dataL:dataL];//分辨率 | 2424 | shortVideoTranscoder.outputFilePreset = [CNLiveUploadManager presetWithVideoLimitType:limitType url:url dataL:dataL];//分辨率 |
| 2425 | - shortVideoTranscoder.bitrate = [CNLiveUploadManager bitrateWithPreset:shortVideoTranscoder.outputFilePreset limitType:limitType avAsset:avAsset url:url dataL:dataL]; | 2425 | +// shortVideoTranscoder.bitrate = [CNLiveUploadManager bitrateWithPreset:shortVideoTranscoder.outputFilePreset limitType:limitType avAsset:avAsset url:url dataL:dataL]; |
| 2426 | shortVideoTranscoder.timeRange = timeRange; | 2426 | shortVideoTranscoder.timeRange = timeRange; |
| 2427 | shortVideoTranscoder.rotateOrientation = PLSPreviewOrientationPortrait; //视频显示 | 2427 | shortVideoTranscoder.rotateOrientation = PLSPreviewOrientationPortrait; //视频显示 |
| 2428 | shortVideoTranscoder.videoSelectedRect = CGRectZero; //视频剪裁区域 | 2428 | shortVideoTranscoder.videoSelectedRect = CGRectZero; //视频剪裁区域 |
| @@ -2482,7 +2482,7 @@ static CNLiveUploadManager *_uploadManager; | @@ -2482,7 +2482,7 @@ static CNLiveUploadManager *_uploadManager; | ||
| 2482 | NSLog(@"1输出转码前数据长度%f",(dataL/(1024.0*1024))); | 2482 | NSLog(@"1输出转码前数据长度%f",(dataL/(1024.0*1024))); |
| 2483 | if (limitType == AppPhototLimitTypeChat) {//聊天 | 2483 | if (limitType == AppPhototLimitTypeChat) {//聊天 |
| 2484 | if (dataL > kCNUploadSize20MB) { | 2484 | if (dataL > kCNUploadSize20MB) { |
| 2485 | - return PLSFilePreset640x480; | 2485 | + return PLSFilePreset960x540; |
| 2486 | }else { | 2486 | }else { |
| 2487 | return PLSFilePreset960x540; | 2487 | return PLSFilePreset960x540; |
| 2488 | } | 2488 | } |
| @@ -2496,20 +2496,20 @@ static CNLiveUploadManager *_uploadManager; | @@ -2496,20 +2496,20 @@ static CNLiveUploadManager *_uploadManager; | ||
| 2496 | 2496 | ||
| 2497 | }else if (limitType == AppPhototLimitTypeSweepCode) {//扫码 | 2497 | }else if (limitType == AppPhototLimitTypeSweepCode) {//扫码 |
| 2498 | if (dataL > kCNUploadSize30MB) { | 2498 | if (dataL > kCNUploadSize30MB) { |
| 2499 | - return PLSFilePreset640x480; | 2499 | + return PLSFilePreset960x540; |
| 2500 | }else { | 2500 | }else { |
| 2501 | return PLSFilePreset960x540; | 2501 | return PLSFilePreset960x540; |
| 2502 | } | 2502 | } |
| 2503 | }else if (limitType == AppPhototLimitTypeTarentoComment) {//评论 | 2503 | }else if (limitType == AppPhototLimitTypeTarentoComment) {//评论 |
| 2504 | if (dataL > kCNUploadSize30MB) { | 2504 | if (dataL > kCNUploadSize30MB) { |
| 2505 | - return PLSFilePreset640x480; | 2505 | + return PLSFilePreset960x540; |
| 2506 | }else { | 2506 | }else { |
| 2507 | return PLSFilePreset960x540; | 2507 | return PLSFilePreset960x540; |
| 2508 | } | 2508 | } |
| 2509 | 2509 | ||
| 2510 | }else { | 2510 | }else { |
| 2511 | if (dataL > kCNUploadSize30MB) {//其他 | 2511 | if (dataL > kCNUploadSize30MB) {//其他 |
| 2512 | - return PLSFilePreset640x480; | 2512 | + return PLSFilePreset960x540; |
| 2513 | }else { | 2513 | }else { |
| 2514 | return PLSFilePreset960x540; | 2514 | return PLSFilePreset960x540; |
| 2515 | } | 2515 | } |
Example/Podfile
| 1 | use_frameworks! | 1 | use_frameworks! |
| 2 | 2 | ||
| 3 | -source 'https://github.com/CocoaPods/Specs.git' | 3 | +#source 'https://github.com/CocoaPods/Specs.git' |
| 4 | source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git' | 4 | source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git' |
| 5 | +source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' | ||
| 5 | 6 | ||
| 6 | platform :ios, '9.0' | 7 | platform :ios, '9.0' |
| 7 | 8 |