下载m3u8到本地存储为mp4

本文介绍m3u8资源保存到本地的方法

使用的工具为ffmpeg,有各平台版本,本文在CentOS上安装

1. centos安装ffmpeg

1.安装Nux Dextop Yum 源

由于CentOS没有官方FFmpeg rpm软件包。但是,我们可以使用第三方YUM源(Nux Dextop)完成此工作。

yum install epel-release -y \ && rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro \ && rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

2.安装FFmpeg 和 FFmpeg开发包

yum install ffmpeg ffmpeg-devel -y

测试是否安装成功

ffmpeg

1.1 ubuntu安装

sudo add-apt-repository ppa:djcj/hybrid
sudo apt update
sudo apt install ffmpeg

2.下载m3u8为mp4文件

nohup ffmpeg -i https://up.imgupio.com/demo/birds.m3u8 birds.mp4 > birds.log &

将资源'https://up.imgupio.com/demo/birds.m3u8'下载到本目录保存为birds.mp4,并输出日志到birds.log

ffmpeg下载m3u8为mp4

其他:vatfs (影视全搜索)代码分享

admin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  1   博主  0

  1. erbiLity 0
    两步都是错的 [root@VM_69_215_centos ~]# yum install epel-release -y \ && rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro \ && rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm Loaded plugins: fastestmirror, langpacks Repository epel is listed more than once in the configuration Loading mirror speeds from cached hostfile epel | 5.3 kB 00:00 extras | 2.9 kB 00:00 os | 3.6 kB 00:00 updates | 2.9 kB 00:00 Package epel-release-7-12.noarch already installed and latest version No package available. Nothing to do error: : import read failed(2). [root@VM_69_215_centos ~]# yum install ffmpeg ffmpeg-devel -y Loaded plugins: fastestmirror, langpacks Repository epel is listed more than once in the configuration Loading mirror speeds from cached hostfile No package ffmpeg available. No package ffmpeg-devel available. Error: Nothing to do [root@VM_69_215_centos ~]#