Compile and install hls protocol slice tool m3u8-segmenter

Operating System: Ubuntu16.04.4 amd64

Installation http://m3u8-segmenter.inodes.org/ installed m3u8-segmenter error, so with this article

apt install aptitude
apt-add-repository ppa:johnf-inodes/m3u8-segmenter
aptitude update
apt-get install m3u8-segmenter

In which the process of updating the download source of error:

root @ ubuntu: / home / tomcat # aptitude update 
Hit http: // mirrors.aliyun.com/ubuntu great InRelease 
Hit http: // mirrors.aliyun.com/ubuntu great-updates InRelease                                                                                                                                                   
Hit http: // mirrors.aliyun. com / ubuntu-backports great InRelease                                                                                                                                                  
Hit http: // mirrors.aliyun.com/ubuntu great-security InRelease                                                                                       
Hit http: // archive.ubuntu.com/ubuntu great InRelease                 
Ign http: // ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu great InRelease 
Hit http: // archive.canonical.com/ubuntu great InRelease                                           
hit http: // ppa.launchpad.net/linuxuprising/java/ubuntu great InRelease 
Ign http: // ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu great Releases 
Err http: // ppa.launchpad.net / John F.-inode / m3u8-segment / ubuntu great / main Packages amd64 
  404   Not Found [IP: 91189 . 95.83  80 ]
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main i386 Packages
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main all Packages
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main Translation-en_US
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main Translation-en
W: The repository 'http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial Release' does not have a Release file.
W: Failed to fetch http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu/dists/xenial/main/binary-amd64/Packages: 404  Not Found [IP: 91.189.95.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

root@ubuntu:/home/tomcat# aptitude update
Hit http://mirrors.aliyun.com/ubuntu xenial InRelease
Hit http://mirrors.aliyun.com/ubuntu xenial-updates InRelease                                                                                               
Hit http://mirrors.aliyun.com/ubuntu great-backports InRelease                                                                                                                                                                         
Hit http: // mirrors.aliyun.com/ubuntu great-security InRelease                                                                                                                       
Hit http: // archive.ubuntu.com/ubuntu great InRelease                                                                                                                                 
Hit http: // archive.canonical. com / ubuntu great InRelease 
Ign http: //ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial InRelease
Hit http://ppa.launchpad.net/linuxuprising/java/ubuntu xenial InRelease
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial Release
Err http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main amd64 Packages
  404  Not Found [IP: 91.189.95.83 80]
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main i386 Packages
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main all Packages
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main Translation-en_US
Ign http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial/main Translation-en
W: The repository 'http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu xenial Release' does not have a Release file.
W: Failed to fetch http://ppa.launchpad.net/johnf-inodes/m3u8-segmenter/ubuntu/dists/xenial/main/binary-amd64/Packages: 404  Not Found [IP: 91.189.95.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

root@ubuntu:/home/tomcat# apt-get install m3u8-segmenter
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package m3u8-segmenter

 

The author of the installation method:

apt install curl build-essential automake automake1.11 libavformat-dev pkg-config ffmpeg
cd /usr/src
curl https://codeload.github.com/m3u8-segmenter/m3u8-segmenter/tar.gz/v1.0.2 -o m3u8-segmenter.v1.0.2.tar.gz
 tar -zxvf m3u8-segmenter.v1.0.2.tar.gz     
#安装m3u8-segmenter
aclocal
autoreconf
automake -ac
./configure
make
sudo make install

Installation screenshots

 

 

 centos7 installation command:

yum install  gcc make nasm pkgconfig wget curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel libtool mhash.x86_64 perl-Digest-SHA1.x86_64  pcre.i386 pcre.x86_64 pcre-devel.i386 pcre-devel.x86_64
curl https://codeload.github.com/m3u8-segmenter/m3u8-segmenter/tar.gz/v1.0.2  -o m3u8-segmenter.v1.0.2.tar.gz
    

 tar -zxvf m3u8-segmenter.v1.0.2.tar.gz
     
#安装m3u8-segmenter
aclocal
automake -ac
./configure
make
sudo make  install

 windows version

https://github.com/godka/m3u8-segmenter-for-Windows

 Available for testing Download Video: http: //media.speech.zone/video/Speech_Processing_synthesis-TDPSOLA-21m37s.mp4

Instructions:

# -ar采样率 audio sampling rate
#  -ab 比特率
#  -vn disable video


#1、视频分片

ffmpeg -i Spring_Insight-Milestone_3-Screencast.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb | m3u8-segmenter -i - -n 10 -p screencast -m playlist.m3u8 --u http://example.org/video/

ffmpeg -i Spring_Insight-Milestone_3-Screencast.mp4 -vbsf mpegts | m3u8-segmenter -i - -n 10  -p /tmp/big_buck_bunny -m /tmp/big_buck.m3u8 -u http://inodes.org/bigbuck/

  ffmpeg -loglevel quiet  -i Spring_Insight-Milestone_3-Screencast.mp4 -f mpegts - | \
  m3u8-segmenter -i - -d 20 -p /tmp/big_buck_bunny -m /tmp/big_buck.m3u8 -u http://inodes.org/bigbuck/

ffmpeg -er 4 -i input.mp3 -f mpegts -acodec libmp3lame -ar 22050 -ab 32k -vn - | \
  m3u8-segmenter -i - -d 10 -p outputdir/prefix -m outputdir/output.m3u8 -u http://domain.com/

#2、音频分片

ffmpeg -er 4 -i output.wav -f mpegts -acodec pcm_s16le -ar 22050 -ab 256k -vn - | \
  m3u8-segmenter -i - -d 10 -p /tmp/outputdir/prefix -m /tmp/outputdir/output_wav.m3u8 -u http://domain.com/
  
  ffmpeg -er 4 -i output.wav -f mpegts -acodec pcm_s16le -ar 22050 -ab 256k -vn - | \
  m3u8-segmenter -i - -d 10 -p outputdir/prefix -m outputdir/output_wav.m3u8 -u http://domain.com/
  
  ffmpeg -er 4 -i output.wav -f mpegts -acodec pcm_s16le -ar 22050 -ab 256k -vn - | m3u8-segmenter -i - -d 10 -p outputdir/prefix -m outputdir/output_wav.m3u8 -u http://domain.com/
  
  ffmpeg -i output.wav -f mpegts -acodec pcm_s16le -ar 22050 -ab 256k -vn - | \
  m3u8-segmenter -i - -d 10 -p outputdir/prefix -m outputdir/output.m3u8 -u http://domain.com/

The above code from the network, as in the past for too long, can not remember the source. Belongs to original author

Guess you like

Origin www.cnblogs.com/passedbylove/p/11850846.html