一直致力于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 secIn fact it is the same absolute time, But it has different granularity, which is important when you deal with audio and video file processing.
更多推荐
发布评论