您好我使用以下命令将m3u8段文件复制到单个mp4文件:
我在c#Process
类上运行此命令。
-y -i "D:\OtherProjects\ConvertProj\video\2018\4\1\m3u8\200p\out.m3u8"
-y -i "D:\OtherProjects\ConvertProj\video\2018\4\1\m3u8\360p\out.m3u8"
-y -i "D:\OtherProjects\ConvertProj\video\2018\4\1\m3u8\480p\out.m3u8"
-y -i "D:\OtherProjects\ConvertProj\video\2018\4\1\m3u8\720p\out.m3u8"
-map 0 -c:v copy -c:a copy -threads 0 "D:\OtherProjects\ConvertProj\video\2018\4\1\1-200.mp4"
-map 1 -c:v copy -c:a copy -threads 0 "D:\OtherProjects\ConvertProj\video\2018\4\1\1-360.mp4"
-map 2 -c:v copy -c:a copy -threads 0 "D:\OtherProjects\ConvertProj\video\2018\4\1\1-480.mp4"
-map 3 -c:v copy -c:a copy -threads 0 "D:\OtherProjects\ConvertProj\video\2018\4\1\1.mp4"
我收到此错误:
[hls,applehttp @ 00000000047e3400] Failed to open segment of playlist 0
Last message repeated 353 times
[hls,applehttp @ 00000000047e3400] Error when loading first segment 'out0.ts'
D:\OtherProjects\ConvertProj\video\2018\4\6208-3905956\m3u8\200p\out.m3u8: Invalid data found when processing input
有什么问题?我必须这样做吗?这是一个错误吗?
答案 0 :(得分:0)
在新命令下面,我将输入和输出的地址更改为ffmpeg的路径:
-y -i "../video/2018/4/1/m3u8/200p/out.m3u8"
-y -i "../video/2018/4/1/m3u8/360p/out.m3u8"
-y -i "../video/2018/4/1/m3u8/480p/out.m3u8"
-y -i "../video/2018/4/1/m3u8/720p/out.m3u8"
-map 0 -c:v copy -c:a copy -threads 0 "../video/2018/4/1/1-200.mp4"
-map 1 -c:v copy -c:a copy -threads 0 "../video/2018/4/1/1-360.mp4"
-map 2 -c:v copy -c:a copy -threads 0 "../video/2018/4/1/1-480.mp4"
-map 3 -c:v copy -c:a copy -threads 0 "../video/2018/4/1/1.mp4"
然后我为c#进程类的/video/
设置了WorkingDirectory
路径,而ffmpeg并不存在于该路径上。