CMTimeMake用户选择器(CMTimeMake User Picker)

编程入门 行业动态 更新时间:2024-10-18 06:01:06
CMTimeMake用户选择器(CMTimeMake User Picker)

一直致力于AVMutableComposition将音频文件与视频混合,

对于在视频时间0插入音频的部分,我正在使用它

AVMutableCompositionTrack *a_compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; [a_compositionVideoTrack insertTimeRange:video_timeRange ofTrack:[[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:kCMTimeZero error:nil];

我现在的挑战是让用户选择他想要音频的视频时间范围!! 不知道如何使用CMTimeMake以及是否已经完成了任何平滑的选择器

谢谢你的帮助!!

have been working on the AVMutableComposition to mix audio file with video,

For the part of insert the audio at video time 0, am using this

AVMutableCompositionTrack *a_compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; [a_compositionVideoTrack insertTimeRange:video_timeRange ofTrack:[[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:kCMTimeZero error:nil];

My challenge now is to let the user pick the video time range he want the audio in !! have no idea how this works with the CMTimeMake and if there is any smoothy picker already done

Thanks for helping !!

最满意答案

CMTimeMake(value,timescale)

值 - 通常,量子量(例如,秒)时间刻度 - 此量程的长度(以秒为单位)

CMTimeMake(1,30) // one interval of 30 sec CMTimeMake(30,1) // 30 intervals of 1 sec

实际上它是相同的绝对时间,但它具有不同的粒度,这在处理音频和视频文件处理时很重要。

CMTimeMake(value,timescale)

value - as usual, amount of quantums (for example, seconds) timescale - length of this quantum in seconds

CMTimeMake(1,30) // one interval of 30 sec CMTimeMake(30,1) // 30 intervals of 1 sec

In fact it is the same absolute time, But it has different granularity, which is important when you deal with audio and video file processing.

更多推荐

本文发布于:2023-08-06 15:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1450316.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选择器   用户   CMTimeMake   User   Picker

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!