打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
ffmpeg 文件切片合并

最近再做m3u8切片合并下载的小功能,因为要合并成mp4,所以考虑用ffmpeg来搞,mp4格式忒复杂了。

查了下文档ffmpeg支持concat demux和concat protocol.

用法如下:

ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output.mpg //这个是concat protocal,这个命令只支持一部分视频格式 如mpeg1,2 mpegts,不支持flv,mp4

mylist.txt:
# this is a comment
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'

ffmpeg -f concat -i mylist.txt -c copy output //这个是运用concat demux,和前面的命令有些不同,这个会把demux文件然后re-encode切片文件,所以只要ffmpeg支持的格式,这个命令都管用。

开始觉得这俩个命令功能是一样的。实验了第一个命令 flv不管用,只输出了第一片的flv。查了下官方文档找到这一段:

The flv container format doesn't support file-level concatenation; only afew container file types do. So the concat protocol won't work on them.The concat demuxer, as its name suggests, demuxes the input streams fromtheir container and then concatenates them, so it doesn't care about whatthe input container is (and if the codecs are all the same w/ similarcharacteristics, you can actually concatenate files of different containerformats).


参考:How to concatenate (join, merge) media files
ffmpeg wiki



本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
《FFmpeg Basics》中文版-23- 先进的技术点
网络流媒体(flv)点播解决方案
【ACFUN UP 专修学院福利】视频无损剪辑技术
使用 FFmpeg 制作 GIF
FFMPEG的用法
FFmpeg常用命令行
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服