init commit

This commit is contained in:
Trey t
2024-06-23 22:51:58 -05:00
commit ddf67a4fc5
315 changed files with 163458 additions and 0 deletions

28
create_hls.py Normal file
View File

@@ -0,0 +1,28 @@
from ffmpeg_streaming import Formats, Bitrate, Representation, Size
import os
import ffmpeg_streaming
dirs = [
"exercise_videos"
]
for dir in dirs:
complete_dir = os.getcwd() + "/media/" + dir
for filename in os.listdir(complete_dir):
if "mp4" not in filename:
continue
print(filename)
end_location = os.getcwd() + '/media/hls/'+ str(filename) +'.m3u8'
if os.path.isfile(end_location):
pass
media_location = os.getcwd() + "/media/" + dir + "/" + str(filename)
video = ffmpeg_streaming.input(media_location)
hls = video.hls(Formats.h264())
_720p = Representation(Size(1280, 720), Bitrate(2048 * 1024, 320 * 1024))
hls.representations(_720p)
hls.output(end_location)
print("------")