dolphin 发表于 2018-11-21 15:33:14

m3u8视频下载及格式转换

M3u8格式的视频越来越多,恰有朋友问到。

可实现模式为:
1)下载并解析m3u8格式的文件
2)使用ffmpeg转码
3)使用ffmpeg合并文件

附 ffmpeg项目地址:https://github.com/FFmpeg/FFmpeg
FEF:Tools
[*]ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
[*]ffplay is a minimalistic multimedia player.
[*]ffprobe is a simple analysis tool to inspect multimedia content.
[*]Additional small tools such as aviocat, ismindex and qt-faststart.

dolphin 发表于 2018-11-21 15:56:41

附参考代码:

@echo off
color 0F
:: 本批处理由 Batch Download 生成.

TITLE Batch Download -     Ctrl + S 暂停 Ctrl + Q 继续
"ffmpeg.exe" -threads 0 -i "a.ts
" -c copy -y -bsf:a aac_adtstoasc "a.mp4"
TITLE Batch Download -     Ctrl + S 暂停 Ctrl + Q 继续
"ffmpeg.exe" -threads 0 -i "b.ts
" -c copy -y -bsf:a aac_adtstoasc "b.mp4"

::合并
TITLE Batch Download - 合并    Ctrl + S 暂停 Ctrl + Q 继续
"ffmpeg.exe" -f concat -safe 0 -i "C:\Users\xxx\Desktop\filelist.txt" -threads 0 -c copy -y -bsf:a aac_adtstoasc "Join.mp4"

echo.
set /p choice=合并结束,是否删除源文件(Y/N)?
if /i %choice% equ n goto :exit
del "C:\Users\xxxx\Desktop\filelist.txt"
del "a.mp4"
del "b.mp4"

:exit
TITLE Batch Download - 任务完成!
echo.
echo 所有任务完成!
echo.
pause
页: [1]
查看完整版本: m3u8视频下载及格式转换