我正在尝试在iOS应用程序中使用ffmpeg将本地的.mp4视频转换为HLS。我已经使用pods集成了ffmpeg包装器,并生成了所有分段的.ts文件和m3u8文件,但是某些.ts文件段未在.m3u8播放列表文件中列出,如下所示。它始终列出最后5个视频片段。
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:13
#EXTINF:2,
out13.ts
#EXTINF:1,
out14.ts
#EXTINF:2,
out15.ts
#EXTINF:2,
out16.ts
#EXTINF:1,
out17.ts
#EXT-X-ENDLIST
我使用以下代码生成HLS。
FFmpegWrapper *wrapper = [[FFmpegWrapper alloc] init];
[wrapper convertInputPath:inputFilePath outputPath:outputFilePath options:nil progressBlock:^(NSUInteger bytesRead, uint64_t totalBytesRead, uint64_t totalBytesExpectedToRead) {
} completionBlock:^(BOOL success, NSError *error) {
success?NSLog(@"Success...."):NSLog(@"Error : %@",error.localizedDescription);
}];
还有其他方法可以做到这一点吗?