合并ts文件的软件,合并ts文件的手机软件

您所在的位置:网站首页 ffmpeg合并m3u8 合并ts文件的软件,合并ts文件的手机软件

合并ts文件的软件,合并ts文件的手机软件

#合并ts文件的软件,合并ts文件的手机软件| 来源: 网络整理| 查看: 265

合并ts文件 合并ts文件参考资料 合并ts文件

文件在手机中的存储:

├── fe2cd5a64fe78a69f90a7c0a2b08a240e1444082.ts├── ff5b590b44e676dc0a72d127fd165adaa0a478ec.ts├── ff7085e695211f5e0b8cd239d51ad7870889c14b.ts├── ....├── ffec91db3441fd42adab27d0dbe26f424fc23a1d.ts├── index.m3u8├── index.m3u8.play├── task.info

1) 根据猎豹浏览器中的download.db,使用sqlite3打开文件,查看对应文件在手机浏览器中的真实路径.

2) 通过手机插上U盘/移动硬盘,将文件拷贝到电脑

3) 根据index.m3u8.play中的ts片段文件,生成一个总的ts文件.

可以使用C/OC/python等,读取index.m3u8.play文件,生成类似下面的shell语句,即可合并为一个ts文件.

windows:

copy /b “1.ts”+“2.ts”+…+”n.ts” /y “combine.ts”

mac:

cat 1.ts 2.ts > combine.ts

相关程序代码:

//读文件 NSString *fullFilePath = @"/xxx/index.m3u8.play"; NSFileHandle *handle = [NSFileHandle fileHandleForReadingAtPath:fullFilePath ]; NSData *data3 = [handle readDataToEndOfFile]; NSString *temp = [[NSString alloc]initWithData:data3 encoding:NSUTF8StringEncoding]; NSArray *tempArray = [temp componentsSeparatedByString:@"\n"]; NSMutableArray *fileMArray = [NSMutableArray array]; for (NSInteger index = 0 ; index < tempArray.count; index++) { NSString *fileContentLine = tempArray[index]; if ([fileContentLine hasSuffix:@".ts"]) { [fileMArray addObject:fileContentLine]; } } NSString *fileNames = [fileMArray componentsJoinedByString:@" "]; //写入文件 NSString *toPath = @"/yyy/combineTSFile.sh"; NSFileHandle *handle2 = [NSFileHandle fileHandleForWritingAtPath:toPath]; NSLog(@"%s [LINE:%d] fileNames=%@", __func__, __LINE__,fileNames); NSData *data = [fileNames dataUsingEncoding:NSUTF8StringEncoding]; [handle2 writeData:data]; [handle2 synchronizeFile]; [handle2 closeFile];

4) 将ts文件转换为mp4文件

ffmpeg -i combine.ts -acodec copy -vcodec copy -bsf aac_adtstoasc output.mp4 参考资料 http://www.tuicool.com/articles/kkdhj2ehttp://my.oschina.net/zhangxu0512/blog/353861http://blog.csdn.net/?aspxerrorpath=/blog/u011757360/20491055http://blog.163.com/y_p_xu/blog/static/1708571022011896311101/

转载于:https://www.cnblogs.com/xilifeng/p/4692368.html



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3