Skip to content
Andriy Lysnevych edited this page Feb 21, 2024 · 1 revision

Welcome to the p2p-media-loader wiki

Live audio stream with multiple qualities

radio.sh

#!/bin/bash

DIRS=("high" "medium" "low")

for dir in "${DIRS[@]}"; do
  if [ -d "$dir" ]; then
    rm -rf "$dir"/*
  else
    mkdir -p "$dir"
  fi
done

ffmpeg -i https://streamvideol1.luxnet.ua/nostalgi/nostalgi.stream/playlist.m3u8 \
-map 0 -c:a aac -b:a 128k -f hls -hls_time 10 -hls_list_size 0 -hls_list_size 10 -hls_flags delete_segments high/playlist.m3u8 \
-map 0 -c:a aac -b:a 96k -f hls -hls_time 10 -hls_list_size 0 -hls_list_size 10 -hls_flags delete_segments medium/playlist.m3u8 \
-map 0 -c:a aac -b:a 64k -f hls -hls_time 10 -hls_list_size 0 -hls_list_size 10 -hls_flags delete_segments low/playlist.m3u8

radio.m3u8

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=192000,AVERAGE-BANDWIDTH=128000,CODECS="mp4a.40.2"
high/playlist.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=144000,AVERAGE-BANDWIDTH=96000,CODECS="mp4a.40.2"
medium/playlist.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=96000,AVERAGE-BANDWIDTH=64000,CODECS="mp4a.40.2"
low/playlist.m3u8
Clone this wiki locally