我想使用ffmpeg分割视频文件,并将分割的文件发送到远程http url而不是本地服务器磁盘。
我可以运行这个命令,它将把文件存储在目录中。
segment%03d.ts ffmpeg -i输入url -map 0 -codec:v libx264 -codec:a mp2 -f段-flags -global_header -segment_format mpegts -segment_time 10
我想做的是
http://url/ts_file ffmpeg -i输入url -map 0 -codec:v libx264 -codec:a mp2 -f段-flags -global_header -segment_format mpegts -segment_time 10
它会出现错误,因为输出文件#0 (不正确的编解码参数?)无法写入标题:错误号-22发生了。
能在这个地方做吗?
发布于 2014-04-09 13:21:48
我找到解决方案了,诀窍是在url的末尾附加segment%03d.ts
val output_url = "http://"+request.host+"/ts_file/"
ffmpeg -i [input url] -map 0 -codec:v libx264 -codec:a mp2 -f segment -flags -global_header -segment_format mpegts -segment_time 10 "+output_url+"segment%03d.ts在我的路由文件中(我使用的是玩Scala)
POST /ts_file/:file_name controllers.Application.ts_file(file_name: String)https://stackoverflow.com/questions/22908987
复制相似问题