PW Akshay

Generation

generate functionMon, 05 Dec 2022

Program to stream m3u8 linkto rtmp in python using PyM3u8 .

import pym3u8 import http.client import urllib.request import urllib.parse import urllib.error import base64 import subprocess import threading import time import json # You must provide an m3u8 playlist url. The program will download the m3u8 # and segment files as they are listed in the m3u8 file. The files will be # downloaded to the current directory. # The program will merge the files into a single file called # merged_stream.ts # The program will then stream the file to the address you set below. # The program will then loop and check the playlist every 60 seconds. # If changes are detected the program will download and stream any new # segments to the rtmp server. # # m3u8 file: https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8

Questions about programming?Chat with your personal AI assistant