extract separated audio from m3u8 link

0

I am trying to extract separated audios from live streaming m3u8 file, But when I use

ffmpeg -i "live m3u8 link" -c copy "output.ts"

Every new video and audio data seem just append on output.ts, is that possible make them create a new segmented ts file every time?

ywj7931

Posted 2016-09-18T08:18:04.993

Reputation: 3

Answers

1

If you just want the audio, use

ffmpeg -i "live m3u8 link" -c copy -map a "output.ts"

If you want it segmented, use

ffmpeg -i "live m3u8 link" -c copy -map a -f segment -segment_time 10 "out%d.ts"

If you just want to save the original files, you need a download manager of some sort.

Gyan

Posted 2016-09-18T08:18:04.993

Reputation: 21 016

Hello Mulvya, thank you very much for your sharing of the code, it does do the trick! But when you put 10 there does it mean to cut the file every 10 seconds? Is there a way to use the time specified in the m3u8 file? – ywj7931 – 2016-09-22T07:20:28.307

For example, my m3u8 file reads like this:#EXT-X-TARGETDURATION:5 #EXTINF:3.309, 1057677964350941__BshzQkvI-MOpxaKgPtCTcw__-1047.ts #EXTINF:3.243, 1057677964350941__BshzQkvI-MOpxaKgPtCTcw__-1048.ts #EXTINF:3.042, 1057677964350941__BshzQkvI-MOpxaKgPtCTcw__-1049.ts #EXTINF:3.442, 1057677964350941__BshzQkvI-MOpxaKgPtCTcw__-1050.ts #EXTINF:4.546, 1057677964350941__BshzQkvI-MOpxaKgPtCTcw__-1051.ts Is there a way to segment using the targeted duration and those ts files name? – ywj7931 – 2016-09-22T07:25:10.443