Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

java - how to create a small m3u8 clip from another m3u8 clip using node

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:13
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:12.960000,
https://d3s84sk2607r1u.cloudfront.net/video_866552260.ts
#EXTINF:8.760000,
https://d3s84sk2607r1u.cloudfront.net/video_866552261.ts
#EXTINF:10.520000,
https://d3s84sk2607r1u.cloudfront.net/video_866552262.ts
#EXTINF:9.800000,
https://d3s84sk2607r1u.cloudfront.net/video_866552263.ts
#EXTINF:10.000000,
https://d3s84sk2607r1u.cloudfront.net/video_866552264.ts
#EXTINF:10.240000,
https://d3s84sk2607r1u.cloudfront.net/video_866552265.ts
#EXT-X-ENDLIST

So here it is an m3u8 file. I am trying to cut it and create a new clip let's say 15 seconds with the first two ts files and remove the others. This new clip will be in m3u8 format and will look like

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:13
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:12.960000,
https://d3s84sk2607r1u.cloudfront.net/video_866552260.ts
#EXTINF:2.040000,
https://d3s84sk2607r1u.cloudfront.net/video_866552261.ts
#EXT-X-ENDLIST

I am using node js and FFmpeg. So is there a way to create a small clip which will be a m3u8 file, from this m3u8 file. I am trying to create a script that will execute. So if it's not node js then any other like java or python will be helpful for me

I am trying to create a script.js that will run on my command like

node script.js start_time end_time ./path/file.m3u8

that will generate a new m3u8 file


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...