release bot with cache

This commit is contained in:
IGlek 2025-05-23 19:27:02 +03:00
parent 08361e5d1b
commit be65b0f413
161 changed files with 51 additions and 13 deletions

37
src/code/combine.py Normal file
View file

@ -0,0 +1,37 @@
import os
from scripts import make_full_clip
async def combine_all_videos():
corpora = ["pr", "pk", "mi", "av", "bs"]
for corpus in corpora:
base_path = os.path.join("../videos", corpus)
offices_path = os.path.join(base_path, "offices")
if not os.path.exists(offices_path):
continue
for filename in os.listdir(offices_path):
if filename.endswith(".mp4"):
office_path = os.path.join(offices_path, filename)
name, _ = os.path.splitext(filename)
parts = name.split("-")
if len(parts) != 4:
continue
corpus_id, building, floor, office = parts
floor_filename = f"{corpus_id}-{building}-{floor}.mp4"
building_filename = f"{corpus_id}-{building}.mp4"
floor_path = os.path.join(base_path, "floors", floor_filename)
building_path = os.path.join(base_path, "buildings", building_filename)
if os.path.exists(floor_path) and os.path.exists(building_path):
clips = [building_path, floor_path, office_path]
# ПОЛНОЕ ВИДЕО
await make_full_clip(clips)
# УРЕЗАННОЕ ВИДЕО
await make_full_clip(clips[1:])
else:
print(f"Missing files for {filename} in {corpus}")
import asyncio
asyncio.run(combine_all_videos())

View file

@ -68,23 +68,24 @@ async def make_full_clip(paths):
print("Некоторые файлы не найдены")
return None
clips = [VideoFileClip(path) for path in paths] # cоздаем список клипов
full_clip_name = f"{paths[-1][21:].replace('.mp4', '')}-{'all' if len(paths) == 3 else 'small'}.mp4"
full_clip = concatenate_videoclips(clips) # cклеиваем все клипы
if not os.path.exists(f"../data/cache/{full_clip_name}"):
clips = [VideoFileClip(path) for path in paths] # cоздаем список клипов
full_clip = full_clip.without_audio() # удаляем звук
full_clip = full_clip.time_transform(lambda t: t * 2).with_duration(full_clip.duration / 2) # ускоряем в 2 раз
full_clip = concatenate_videoclips(clips) # cклеиваем все клипы
full_clip_name = f"{paths[-1][21:].replace('.mp4', '')}-{'all' if len(paths) == 3 else 'small'}.mp4" # генерируем рандомный 5-ти значный ключ
# рендерим видео с параметрами
full_clip.write_videofile(f"../data/cache/{full_clip_name}",
fps=30,
codec="libx264",
bitrate="1500k",
preset="fast",
ffmpeg_params=["-crf", "23"])
full_clip = full_clip.without_audio() # удаляем звук
full_clip = full_clip.time_transform(lambda t: t * 2).with_duration(full_clip.duration / 2) # ускоряем в 2 раз
full_clip = full_clip.resized(height=400)
# рендерим видео с параметрами
full_clip.write_videofile(f"../data/cache/{full_clip_name}",
fps=30,
codec="libx264",
bitrate="1500k",
preset="fast",
ffmpeg_params=["-crf", "23"])
return f"../data/cache/{full_clip_name}"

BIN
src/data/cache/av-4b-04f-04401c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/av-4b-04f-04412c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/av-4b-04f-04413c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

View file

BIN
src/data/cache/pr-1b-02f-01231c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-1b-02f-01232c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-1b-02f-01233c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-1b-02f-01234c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-01f-02109c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-01f-02110c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-01f-02116c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-01f-2110аc-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02201c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02203c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02204c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02205c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02206c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02207c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02208c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02209c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-02210c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-2201мc-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-2202аc-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-02f-2202бc-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-03f-02303c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-03f-02304c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-03f-02305c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-03f-02306c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-03f-02411c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-03f-02413c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-04f-02402c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-04f-02403c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-04f-02407c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-04f-02408c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-04f-02412c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02501c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02502c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02503c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02505c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02506c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02507c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02552c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02552c.-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02553c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02554c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02555c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02557c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02558c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-05f-02559c-all.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
src/data/cache/pr-2b-06f-02605c-all.mp4 vendored Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more