我正在尝试使用iOS应用中的ffmpeg将本地.mp4视频转换为HLS.我已经使用pod集成了ffmpeg包装器并生成了所有分段的.ts文件和m3u8文件,但是.m3u8播放列表文件中没有列出一些.ts文件段,如下所示.它始终列出最后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
Run Code Online (Sandbox Code Playgroud)
我使用以下代码生成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);
}];
Run Code Online (Sandbox Code Playgroud)
有没有其他方法可以做到这一点?