PatoFlamejanteTV commited on
Commit
8d7bd49
·
verified ·
1 Parent(s): c950877

Add files using upload-large-folder tool

Browse files
frames/001.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40144c0a813d813d1a59790740ea8006d6cda614825108ae93777afa3d9cd5b6
3
+ size 243589859
frames/002.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:265f7ab16c0c3f4893030f718ae21928b1cbb8c3281c729bd40abcfdc7d38c44
3
+ size 346516394
frames/003.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2034578021ee6f41ccf54caf0ee16982dd13e494f6347f7df14a430a1763b037
3
+ size 1874637
frames/004.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5d9cddeccbe89fa2c95a8917aee73b282504ddba52c762e30e3c98c3e691d83
3
+ size 470139290
frames/005.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86508a637559159e2dd3685f4cbe71fc4f4555bbec956fa2b062f6166bc5ab2b
3
+ size 307700981
frames/006.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:401e227b3b992a6c12ba8ddb66bacef29aa1221e5b584aec07e2e7f983e5779b
3
+ size 451992020
frames/007.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82b1463fe69f38def21a864fbc8ffffdb071edbf60b3f8fc197af92bada20b70
3
+ size 437721445
frames/008.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56e0fabde92d9fef65a8891494563665e70867bb565cc64fdba28c3bef052b1c
3
+ size 2299196
frames/009.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce2ba670ddab61166ac99ebdab707e970c0ffd7cd43cce8f81912a10d95b4255
3
+ size 2235614
frames/010.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53ff4f3813959b5a3ed14d63cfd6bc03a9d11c88e9aef50742d5f501abec37fc
3
+ size 590020030
frames/011.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6073adafd0d68cd2fa436aa2de2b3320a0b6df6910097f9d6d6ae4380bc47547
3
+ size 567265132
main.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import subprocess
3
+ from concurrent.futures import ThreadPoolExecutor
4
+
5
+ INPUT_DIR = "videos"
6
+ OUTPUT_DIR = "frames"
7
+ FRAME_STEP = 10
8
+ MAX_WORKERS = os.cpu_count() or 4
9
+
10
+
11
+ def process_video(video_path):
12
+ video_name = os.path.splitext(os.path.basename(video_path))[0]
13
+ output_folder = os.path.join(OUTPUT_DIR, video_name)
14
+ os.makedirs(output_folder, exist_ok=True)
15
+
16
+ output_pattern = os.path.join(output_folder, "%03d.jpg")
17
+
18
+ cmd = [
19
+ "ffmpeg",
20
+ "-y", # overwrite without asking
21
+ "-i", video_path,
22
+ "-vf", f"select=not(mod(n\\,{FRAME_STEP}))",
23
+ "-vsync", "vfr",
24
+ "-q:v", "2", # high quality JPEG (lower = better)
25
+ output_pattern
26
+ ]
27
+
28
+ try:
29
+ subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
30
+ print(f"[DONE] {video_name}")
31
+ except Exception as e:
32
+ print(f"[ERROR] {video_name}: {e}")
33
+
34
+
35
+ def main():
36
+ os.makedirs(INPUT_DIR, exist_ok=True)
37
+ os.makedirs(OUTPUT_DIR, exist_ok=True)
38
+
39
+ video_files = [
40
+ os.path.join(INPUT_DIR, f)
41
+ for f in os.listdir(INPUT_DIR)
42
+ if f.lower().endswith((".mp4", ".avi", ".mkv", ".mov", ".webm"))
43
+ ]
44
+
45
+ if not video_files:
46
+ print("[WARNING] No videos found in 'videos' folder.")
47
+ return
48
+
49
+ with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
50
+ executor.map(process_video, video_files)
51
+
52
+
53
+ if __name__ == "__main__":
54
+ main()