Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg合并分段视频 #24

Open
xiaozefeng opened this issue Jun 17, 2019 · 0 comments
Open

ffmpeg合并分段视频 #24

xiaozefeng opened this issue Jun 17, 2019 · 0 comments

Comments

@xiaozefeng
Copy link
Owner

最近想要下载优酷上一个视频,一开始用you-get 或者y youtube-dl 工具下载, 发现只能下载到一部分的视频,后来了解到优酷采用的是分段式的加载。

后通过工具下载了所有分段的视频,但是这样很不方便观看和保存。

于是用 ffmpeg 工具讲几个分段的视频合并成了一个视频,记录一下

  1. 将mp4 转换成MPEG
ffmpeg -i input1.flv -c copy -bsf:v h264_mp4toannexb -f mpegts input1.ts
ffmpeg -i input2.flv -c copy -bsf:v h264_mp4toannexb -f mpegts input2.ts
ffmpeg -i input3.flv -c copy -bsf:v h264_mp4toannexb -f mpegts input3.ts
  1. 合并
ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy -bsf:a aac_adtstoasc -movflags +faststart output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant