Skip to content

Instantly share code, notes, and snippets.

@prinsss
Last active December 14, 2020 15:14
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save prinsss/1bc29da99b238d68e87af874f898f435 to your computer and use it in GitHub Desktop.
Save prinsss/1bc29da99b238d68e87af874f898f435 to your computer and use it in GitHub Desktop.
使用 ffmpeg 拼接 Bilibili 客户端所下载的分段 flv 视频,https://blessing.studio/use-ffmpeg-to-concat-flv-videos-downloaded-by-bilibili-client/
# @Author: printempw
# @Date: 2017-05-13 17:54:48
# @Last Modified by: printempw
# @Last Modified time: 2017-05-13 21:37:41
cat /dev/null > ff.txt
# 防止变成 1、10、2、3 这样的顺序
for i in `ls -1 *.flv | sort -n`; do
echo "file '${i}'" >> ff.txt;
done
# 调用 ffmpeg 生成拼接后的视频
ffmpeg -f concat -i ff.txt -c copy ../output.mp4
rm ff.txt
printf "success"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment