diff --git a/.gitignore b/.gitignore index 354d48be6b8be42027dd53a8889d558d2c34d86a..20242244d46d7d8efa1e52717f76f2b73fb24cd8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ venv/ -clips/ __pycache__/ -output.mp4 \ No newline at end of file +output.mp4 +UPIBOT.mp4 \ No newline at end of file diff --git a/app.py b/app.py index c28ff4f68873711de3e5cdcaba5794711e8b2cc8..8dbe056a26ce1ddedee49686129ea47d5285c93f 100644 --- a/app.py +++ b/app.py @@ -4,11 +4,11 @@ from utils import * st.set_page_config( page_title="Number to Video", page_icon="🎥", - initial_sidebar_state="auto", + initial_sidebar_state="collapsed", ) # Input number -number = st.text_input("Enter a number between 1 and 9999999", "24") +number = st.text_input("Enter a number between 1 and 99,99,999", "24") number = int(number) if number: @@ -19,6 +19,9 @@ if number: st.subheader("Settings") st.divider() + avatar = st.radio("Choose an avatar", ("Custom avatar", "Template avatar")) + avatar = "custom" if avatar == "Custom avatar" else "template" + # Generate clip sequence based on the number clips = generate_clip_sequence(number) if clips: @@ -34,9 +37,10 @@ if number: for i, clip in enumerate(clips): with st.container(border=True): st.write(f"Adjust settings for {clip}:") - length = get_clip_duration(clip) + length = get_clip_duration(clip, avatar) default_trim_start = 0.10 default_trim_end = length - 0.10 + # trim_bounds = st.slider( # f"Trim bounds for {clip}", # 0.0, length, @@ -48,8 +52,8 @@ if number: # print(trim_bounds) # trim_settings.append(trim_bounds) - trim_start = st.slider(f"Trim start for {clip}", 0.0, length, 0.00, 0.01, key=f"start_{i}") - trim_end = st.slider(f"Trim end for {clip}", 0.0, length, 0.00, 0.01, key=f"end_{i}") + trim_start = st.slider(f"Trim start for {clip}", 0.0, float(length), 0.00, 0.01, key=f"start_{i}") + trim_end = st.slider(f"Trim end for {clip}", 0.0, float(length), 0.00, 0.01, key=f"end_{i}") trim_settings.append((trim_start, trim_end)) print(trim_settings) @@ -60,5 +64,5 @@ if number: if submit: pass # Create the video with individual clip settings - create_advanced_video(number, trim_settings, output_file) + create_advanced_video(number, trim_settings, avatar, output_file) st.video(output_file, autoplay=True) diff --git a/clips_metadata.json b/clips_metadata.json index 7aa4b7e7ac7e80c27b53fcb38f81d31d334288fe..d605ced96606e237b90c3b9718a6ba58469d33f8 100644 --- a/clips_metadata.json +++ b/clips_metadata.json @@ -2,193 +2,194 @@ { "clip_number": 0, "start_time_ms": 0, - "end_time_ms": 356, + "end_time_ms": 376, + "initial_length": "316", "file_name": "1_cut.mp4" }, { "clip_number": 1, - "start_time_ms": 656, - "end_time_ms": 868, + "start_time_ms": 636, + "end_time_ms": 888, "file_name": "2_cut.mp4" }, { "clip_number": 2, - "start_time_ms": 1199, - "end_time_ms": 1431, + "start_time_ms": 1179, + "end_time_ms": 1451, "file_name": "3_cut.mp4" }, { "clip_number": 3, - "start_time_ms": 1782, - "end_time_ms": 2017, + "start_time_ms": 1762, + "end_time_ms": 2037, "file_name": "4_cut.mp4" }, { "clip_number": 4, - "start_time_ms": 2393, - "end_time_ms": 2701, + "start_time_ms": 2373, + "end_time_ms": 2721, "file_name": "5_cut.mp4" }, { "clip_number": 5, - "start_time_ms": 3027, - "end_time_ms": 3213, + "start_time_ms": 3007, + "end_time_ms": 3233, "file_name": "6_cut.mp4" }, { "clip_number": 7, - "start_time_ms": 3763, - "end_time_ms": 4143, + "start_time_ms": 3743, + "end_time_ms": 4163, "file_name": "7_cut.mp4" }, { "clip_number": 8, - "start_time_ms": 4410, - "end_time_ms": 4618, + "start_time_ms": 4390, + "end_time_ms": 4638, "file_name": "8_cut.mp4" }, { "clip_number": 9, - "start_time_ms": 4976, - "end_time_ms": 5434, + "start_time_ms": 4956, + "end_time_ms": 5454, "file_name": "9_cut.mp4" }, { "clip_number": 10, - "start_time_ms": 5732, - "end_time_ms": 6016, + "start_time_ms": 5712, + "end_time_ms": 6036, "file_name": "10_cut.mp4" }, { "clip_number": 11, - "start_time_ms": 6329, - "end_time_ms": 6705, + "start_time_ms": 6309, + "end_time_ms": 6725, "file_name": "20_cut.mp4" }, { "clip_number": 12, - "start_time_ms": 7040, - "end_time_ms": 7392, + "start_time_ms": 7020, + "end_time_ms": 7412, "file_name": "30_cut.mp4" }, { "clip_number": 13, - "start_time_ms": 7769, - "end_time_ms": 8096, + "start_time_ms": 7749, + "end_time_ms": 8116, "file_name": "40_cut.mp4" }, { "clip_number": 14, - "start_time_ms": 8463, - "end_time_ms": 8803, + "start_time_ms": 8443, + "end_time_ms": 8823, "file_name": "50_cut.mp4" }, { "clip_number": 15, - "start_time_ms": 9127, - "end_time_ms": 9572, + "start_time_ms": 9107, + "end_time_ms": 9592, "file_name": "60_cut.mp4" }, { "clip_number": 16, - "start_time_ms": 9911, - "end_time_ms": 10351, + "start_time_ms": 9891, + "end_time_ms": 10371, "file_name": "70_cut.mp4" }, { "clip_number": 17, - "start_time_ms": 10627, - "end_time_ms": 10940, + "start_time_ms": 10607, + "end_time_ms": 10960, "file_name": "80_cut.mp4" }, { "clip_number": 18, - "start_time_ms": 11202, - "end_time_ms": 11688, + "start_time_ms": 11182, + "end_time_ms": 11708, "file_name": "90_cut.mp4" }, { "clip_number": 19, - "start_time_ms": 11958, - "end_time_ms": 12414, + "start_time_ms": 11938, + "end_time_ms": 12434, "file_name": "11_cut.mp4" }, { "clip_number": 20, - "start_time_ms": 12742, - "end_time_ms": 13069, + "start_time_ms": 12722, + "end_time_ms": 13089, "file_name": "12_cut.mp4" }, { "clip_number": 21, - "start_time_ms": 13414, - "end_time_ms": 13845, + "start_time_ms": 13394, + "end_time_ms": 13865, "file_name": "13_cut.mp4" }, { "clip_number": 22, - "start_time_ms": 14203, - "end_time_ms": 14601, + "start_time_ms": 14183, + "end_time_ms": 14621, "file_name": "14_cut.mp4" }, { "clip_number": 23, - "start_time_ms": 14959, - "end_time_ms": 15391, + "start_time_ms": 14939, + "end_time_ms": 15411, "file_name": "15_cut.mp4" }, { "clip_number": 24, - "start_time_ms": 15704, - "end_time_ms": 16260, + "start_time_ms": 15684, + "end_time_ms": 16280, "file_name": "16_cut.mp4" }, { "clip_number": 25, - "start_time_ms": 16592, - "end_time_ms": 17133, + "start_time_ms": 16572, + "end_time_ms": 17153, "file_name": "17_cut.mp4" }, { "clip_number": 26, - "start_time_ms": 17403, - "end_time_ms": 17807, + "start_time_ms": 17383, + "end_time_ms": 17827, "file_name": "18_cut.mp4" }, { "clip_number": 27, - "start_time_ms": 18048, - "end_time_ms": 18604, + "start_time_ms": 18028, + "end_time_ms": 18624, "file_name": "19_cut.mp4" }, { "clip_number": 28, - "start_time_ms": 18930, - "end_time_ms": 19281, + "start_time_ms": 18910, + "end_time_ms": 19301, "file_name": "100_cut.mp4" }, { "clip_number": 29, - "start_time_ms": 19598, - "end_time_ms": 20026, + "start_time_ms": 19578, + "end_time_ms": 20046, "file_name": "1000_cut.mp4" }, { "clip_number": 30, - "start_time_ms": 20288, - "end_time_ms": 20606, + "start_time_ms": 20268, + "end_time_ms": 20626, "file_name": "100000_cut.mp4" }, { "clip_number": 31, - "start_time_ms": 21038, - "end_time_ms": 22207, + "start_time_ms": 21018, + "end_time_ms": 22227, "file_name": "Intro_cut.mp4" }, { "clip_number": 32, - "start_time_ms": 22712, - "end_time_ms": 23198, + "start_time_ms": 22692, + "end_time_ms": 23218, "file_name": "Conclusion_cut.mp4" } ] \ No newline at end of file diff --git a/custom_clips/100000_cut.mp4 b/custom_clips/100000_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e2637edd580c01983f5f094ba2920e01d91702f6 --- /dev/null +++ b/custom_clips/100000_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f05a84a1070eda30b78fabf94a9e710d1ad208df4a96585dca8bea0db7ee12e +size 100867 diff --git a/custom_clips/1000_cut.mp4 b/custom_clips/1000_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..458e1513182227abfd2261c41dd8a4776ccd0398 --- /dev/null +++ b/custom_clips/1000_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f10c016b655943b44b9e697b3ae67665f13852c364f1d2f009731281e3db9386 +size 122182 diff --git a/custom_clips/100_cut.mp4 b/custom_clips/100_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..a3c405ca7e80bbfce5207e5741c1e9024b9ad3ad --- /dev/null +++ b/custom_clips/100_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:759698ac62703418f47e86890f233468c45a30e5a0b252cf9e237fd0ba167147 +size 112103 diff --git a/custom_clips/10_cut.mp4 b/custom_clips/10_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..8a67124ebfbd9bb6ad05dc8f976c60d8109c2287 --- /dev/null +++ b/custom_clips/10_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db7b6be71dff94e830bb16e52252bed6598567799f71b568733c01ce86553755 +size 98995 diff --git a/custom_clips/11_cut.mp4 b/custom_clips/11_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..309e075e2d8457aaa62b2f4d93b1c8c5aa585845 --- /dev/null +++ b/custom_clips/11_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:200769bf0f76206456cb7dd18370ccebd7cf0c74c9573a9bc7b0faf978a6f5c4 +size 126575 diff --git a/custom_clips/12_cut.mp4 b/custom_clips/12_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ca4fab5f4ac219f14a5209b40490623c135cd748 --- /dev/null +++ b/custom_clips/12_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68e9754e8c1ce7a199ecd70a9808ae650ef4e875cffa73e885f72f11de335b58 +size 104952 diff --git a/custom_clips/13_cut.mp4 b/custom_clips/13_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..8cf6e06f509d6dcf69d13a76eeabb04207b2d063 --- /dev/null +++ b/custom_clips/13_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfc9d729ab9443c62f29798b6cdd4cf0d24abe549dea2febacdd3214fec0c98c +size 119920 diff --git a/custom_clips/14_cut.mp4 b/custom_clips/14_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..88a09d1a81a1e406e99aa3d497b513b03d825b22 --- /dev/null +++ b/custom_clips/14_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ca04791dd1dc2aa1195e674ad8ab99bd548523718ab049e793c40ba6d59fa99 +size 116529 diff --git a/custom_clips/15_cut.mp4 b/custom_clips/15_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..5868ba5264bcb1adeea3492a65fc9d6978352827 --- /dev/null +++ b/custom_clips/15_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:634e614fe9733cf826149c7ce6a5308794f886879e175be78800d339968773b8 +size 129550 diff --git a/custom_clips/16_cut.mp4 b/custom_clips/16_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..9fbe641ca6c4246effaa1a0382d685152c68e3fe --- /dev/null +++ b/custom_clips/16_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a8246110a3d745b4503149ed3fafaf7222cc12f4403a0e24f7f7cbc02a4e73d +size 137015 diff --git a/custom_clips/17_cut.mp4 b/custom_clips/17_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..1cd414a4cd95b476db3709c4b515775be1b563c7 --- /dev/null +++ b/custom_clips/17_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce9a1d29204b2588688971005c0754f4d1b69f67a6df731d8efda966b074eb80 +size 143691 diff --git a/custom_clips/18_cut.mp4 b/custom_clips/18_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..a15cd98fcf76653d6cbf7f0417a4ee3ad0e15caf --- /dev/null +++ b/custom_clips/18_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab455993aeb72d7882251708f57f6acef48418f25835c39a81d9e714e06d8a05 +size 116528 diff --git a/custom_clips/19_cut.mp4 b/custom_clips/19_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..7b91eb10b7b91ceec682e3d9ba84e6b1edba3e39 --- /dev/null +++ b/custom_clips/19_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0edf02766a91615224da8f51932c5dd659cd61f8126123b438405f91aa84388 +size 140424 diff --git a/custom_clips/1_cut.mp4 b/custom_clips/1_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..517adfbf736bccc7581f6430c6c0d8a33e298c70 --- /dev/null +++ b/custom_clips/1_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be4728677e2ca30b966374b148f35c82f01e551b3234b15b716e07a0735427fb +size 104135 diff --git a/custom_clips/20_cut.mp4 b/custom_clips/20_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..266602b57a6eb15231fd6e9cf35df03e35467c78 --- /dev/null +++ b/custom_clips/20_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f49ad67023b395e018c088a9c4d60977259fa3571dbbf6c210137a713d05f82c +size 116878 diff --git a/custom_clips/2_cut.mp4 b/custom_clips/2_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..3c5c778cc1cad25dc7a6ad0531867e83b67c5bca --- /dev/null +++ b/custom_clips/2_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf82efc0b46a6017e2f2576fedd34f843a0af93fe7a3f41311672c76f3d88d55 +size 80246 diff --git a/custom_clips/30_cut.mp4 b/custom_clips/30_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..090d10540fbda92ada71aaf5eff6eff14912c64d --- /dev/null +++ b/custom_clips/30_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48508dc4c930f2cbbaaeb1a31f2d3e54f6b3e641bc0bbdd03f4ccf98658e91ff +size 103389 diff --git a/custom_clips/3_cut.mp4 b/custom_clips/3_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..4570c8234770e77f779e64b8a2c0e0349c0681f4 --- /dev/null +++ b/custom_clips/3_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64ae16cc08310c28303fcacc42648b8f6b6b99ef9febc5089f2b5e4d3f8717e5 +size 84061 diff --git a/custom_clips/40_cut.mp4 b/custom_clips/40_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..37040ce5b603ba0918a6ec1c47b3e05aedbdae20 --- /dev/null +++ b/custom_clips/40_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d4ac54b9c1f0306a2e96e887bd27c50f1ac007f232650352b9a716bfdab4159 +size 107256 diff --git a/custom_clips/4_cut.mp4 b/custom_clips/4_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..6277c967ba89ba13f2a9525b976aeb194b6ede73 --- /dev/null +++ b/custom_clips/4_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c438a388473e5612266040d7b27db1c959889faa5d3f6fd933a876fe61fb29ee +size 113068 diff --git a/custom_clips/50_cut.mp4 b/custom_clips/50_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..f3b80972f19d771248ceee59ca2f0010bd33066a --- /dev/null +++ b/custom_clips/50_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03e0ac60a162c8b59a3bc3a131586970fae6d584fd1f0400808b5cd69141fde3 +size 103831 diff --git a/custom_clips/5_cut.mp4 b/custom_clips/5_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..64cda2e2e35ece6e343181f82d50e55882712dd8 --- /dev/null +++ b/custom_clips/5_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c6a16721ba387a7412d76c56007060e652b6bba9e563f0f0577a5611ce43eea +size 127754 diff --git a/custom_clips/60_cut.mp4 b/custom_clips/60_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..219c17f3dec3da4a51aed6ea7f956f3165a11dbc --- /dev/null +++ b/custom_clips/60_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bca0edc380fa54e65cec5659559fe254aca86b7748ffa2b7bd214cea3b13d42 +size 123842 diff --git a/custom_clips/6_cut.mp4 b/custom_clips/6_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..5dd9621a49887849ab0cb0611de5b5b17c30e0f6 --- /dev/null +++ b/custom_clips/6_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c78e513d396bf4dcbdbe2ead91a4c672197690c8cec2564b41dc750c615e72d6 +size 71681 diff --git a/custom_clips/70_cut.mp4 b/custom_clips/70_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..a70877cb6eccb83178c574f44c20efb9c4bd297a --- /dev/null +++ b/custom_clips/70_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6e78b1e3057b5e82dd4fedb0a1068e63eb2db4e66c20d9d05cf7ff8a52a47ac +size 130720 diff --git a/custom_clips/7_cut.mp4 b/custom_clips/7_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ce07d49bb481bab60a58adcbef84298f60ec91a5 --- /dev/null +++ b/custom_clips/7_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97e20cdfe2520b0ea089811a59d7800dbc99891d050ea5a26d6c5883503524a8 +size 117560 diff --git a/custom_clips/80_cut.mp4 b/custom_clips/80_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..9fd912e4775ddb27d50e8e1c3b67299649266b48 --- /dev/null +++ b/custom_clips/80_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07d494e736d769523b935533e1b46ed7b1249c38816fe4ca305afc1b8b57b680 +size 99673 diff --git a/custom_clips/8_cut.mp4 b/custom_clips/8_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..b953379c76a5eb3f311561e574f5b5ad2c503f74 --- /dev/null +++ b/custom_clips/8_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a3ca4b5ef1d92690f3308add1ff04fbc10eb99369286a099a526b3a90e860cd +size 79524 diff --git a/custom_clips/90_cut.mp4 b/custom_clips/90_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..4f30d0eff0189ee692033829d79db620519928a9 --- /dev/null +++ b/custom_clips/90_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:623a9ae171aa42b4854ba95207cde28183b8077b1732cdc79a5c8b4f4ebb4efb +size 129678 diff --git a/custom_clips/9_cut.mp4 b/custom_clips/9_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..1204c543224b673117bfd1eab91b4d839a9ff963 --- /dev/null +++ b/custom_clips/9_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7eb801c883c26aef19bafe33d78e6141067e9b90f1f816455ed2930ec402c58 +size 130136 diff --git a/custom_clips/Conclusion_cut.mp4 b/custom_clips/Conclusion_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..1cb1bf6b4c63ea7c51cf201f59e59f47093a37dc --- /dev/null +++ b/custom_clips/Conclusion_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa7327f2aff9c9d8a7a41c086413e7790e6b08dc8f1bfc71f3ee8c9b3bf6a35c +size 136565 diff --git a/custom_clips/Intro_cut.mp4 b/custom_clips/Intro_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..26c5ecbf9b22ba379106c76d208ca67c5e97041c --- /dev/null +++ b/custom_clips/Intro_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:119b2a7faf7a94fd50a7d4fadd7b549884f94acfc6f831648665020ad3e0d6fb +size 265628 diff --git a/dev.ipynb b/dev.ipynb index 286d7951f1f8ce165c6be3c3fe17941828223652..6eb55c659790868faa885bde6056895c53bfe281 100644 --- a/dev.ipynb +++ b/dev.ipynb @@ -208,7 +208,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -217,14 +217,14 @@ " \"caption\": False,\n", " \"callback_id\": \"your_custom_id_123\",\n", " \"dimension\": {\n", - " \"width\": 1280,\n", - " \"height\": 720\n", + " \"width\": 720,\n", + " \"height\": 1280\n", " },\n", " \"video_inputs\": [\n", " {\n", " \"character\": {\n", " \"type\": \"avatar\",\n", - " \"avatar_id\": \"Leos_sitting_sofa_front\",\n", + " \"avatar_id\": \"f5db9448825249168273a87cd98f439d\",\n", " \"scale\": 1.0,\n", " \"avatar_style\": \"normal\",\n", " \"offset\": {\n", @@ -245,14 +245,14 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{\"error\": null, \"data\": {\"video_id\": \"e45ea4bfb773464a9c96187a44263c37\"}}\n" + "{\"error\": null, \"data\": {\"video_id\": \"53cf5d6942454560971ba70926bdacc5\"}}\n" ] } ], @@ -277,7 +277,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -289,12 +289,12 @@ "}\n", "\n", "\n", - "response = requests.get(url, headers=headers, params={\"video_id\": \"e45ea4bfb773464a9c96187a44263c37\"}).json()" + "response = requests.get(url, headers=headers, params={\"video_id\": \"53cf5d6942454560971ba70926bdacc5\"}).json()" ] }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -303,19 +303,19 @@ "{'code': 100,\n", " 'data': {'callback_id': 'your_custom_id_123',\n", " 'caption_url': '',\n", - " 'created_at': 1736190876,\n", + " 'created_at': 1736225867,\n", " 'duration': 23.458,\n", " 'error': None,\n", - " 'gif_url': 'https://resource2.heygen.ai/video/gifs/e45ea4bfb773464a9c96187a44263c37.gif',\n", - " 'id': 'e45ea4bfb773464a9c96187a44263c37',\n", + " 'gif_url': 'https://resource2.heygen.ai/video/gifs/53cf5d6942454560971ba70926bdacc5.gif',\n", + " 'id': '53cf5d6942454560971ba70926bdacc5',\n", " 'status': 'completed',\n", - " 'thumbnail_url': 'https://files2.heygen.ai/aws_pacific/avatar_tmp/a0cc99225ed34eb9811246368d94768a/e45ea4bfb773464a9c96187a44263c37.jpeg?Expires=1736796787&Signature=hx6utjHJZT2FzxXurir~891Yn5-zU86rmDiFVC-cUPTaZ0bCSEvEkpeZQHFQwuZ2gJncl3g7ggg7~egIi1VlW3tWewJGPQUVqcEgFSGngCLOcUs5hYAozAWYqR1ivGvjnQLjxjrwH5eWHxs4uV1g~vQ7v64Sd3plwvJWc0AsOVYKpNpE4lbdpdogrBoRF-~3w0aegYdpCexyIInFWv1VRUDc3xd7OW~hLEEhK6FMXb~3NMk~590IfLne3aztcwQRzc8gVx~PySOrJGFs18FXzGgBCP9aMt0dNW7xxFJIfL9O2aB06AVBrB2kPmrRM0Q~1faXHUFehqHn1P8PA~19NA__&Key-Pair-Id=K38HBHX5LX3X2H',\n", - " 'video_url': 'https://files2.heygen.ai/aws_pacific/avatar_tmp/a0cc99225ed34eb9811246368d94768a/e45ea4bfb773464a9c96187a44263c37.mp4?Expires=1736795934&Signature=KIzp-KtTCs1Ida7IB2GKgqikgTISq1W0yFZK04cP54z6rUlCrM7882UYrhzJxOjZAZoRDFPKZ07c-eKvGhlk1AKeyKr05Vu7338xfPZRUTKd43cpDi4QS9uyfELcu0UctjoAZwtwwJl7vANFZKCekElbUnWfruYW~k6PMrhtjkb9kWwvdlAFoBgu3agRsqVha9O8fTdwaKYyv1UUUS0TIdWwsa6sLM5ssB917ifUOXc25bPLFwoFp3i1ZotIDldeLpq2dPUPHOH-1ApXwuclGLyUIf-M9VILmit35yl3g-cAtw3cvT-1pJiiJLmLofksELpMsBKDpJDSkVq6jCyxFg__&Key-Pair-Id=K38HBHX5LX3X2H',\n", + " 'thumbnail_url': 'https://files2.heygen.ai/aws_pacific/avatar_tmp/a0cc99225ed34eb9811246368d94768a/53cf5d6942454560971ba70926bdacc5.jpeg?Expires=1736830809&Signature=kFj3rXlTETYCBXvi-8A37~-aVx1sZCBsDCzdU6W-mU0A45lsnGd1ao9v7QmkR5CqRkIgKNg9~zNKOmARVIHt9p37zpRN9uzcP3XUQ0wBS7C61pYZU-6KXxlfDbVt-aiM2BmvfhKZHA1W7p~fBgwYxGNt25LluA7hFLpczGswMVLEWb7z0JV84UfaZmU~5IqkCt-Fp-o69YlSZ26NvEjm~X2WpM2ILZ9bRpjrNkNNQ3LvUaO-~9XRhEEhe8ANeZgG1Jl7oh6dsQgLTC3TKwrFjsGMeXS2L3etIAja01iWdpEvbrW1oeWXSdPo8AW-0Zac-RJ4ZFymk8kJY6RiWDNxEQ__&Key-Pair-Id=K38HBHX5LX3X2H',\n", + " 'video_url': 'https://files2.heygen.ai/aws_pacific/avatar_tmp/a0cc99225ed34eb9811246368d94768a/53cf5d6942454560971ba70926bdacc5.mp4?Expires=1736830768&Signature=hub7aBI-57uvpQR-kL6eltYrFiacZxEOZKSKE60ntls~f2k87qacQNIiCbkXicKN3Q9CMyG0Io4vqMAvDapSrQXcaOfM6mOyBIV718LjCGXh9r35VVaMvbSl1onIIuoHeW2jYfeBVZ-mUgDHG~3ciHodXKX~VlebM595bHsg65LoBxYNVYEMJIHShxRdwE8xSmWahBUPubf~pegkCtJA1MBU0a7oN3jkey7EMlTDiBvRvXdES332mZkoNpFc7Ecfj6Lv-5k7T~ZBXq69bN79pnn4RVaw7vvsJiQnrKlrKYVe90HWb0MIVtjRkLX2cloWFhHpLh3picgprT0ixUhjsg__&Key-Pair-Id=K38HBHX5LX3X2H',\n", " 'video_url_caption': None},\n", " 'message': 'Success'}" ] }, - "execution_count": 29, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -326,7 +326,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -335,7 +335,7 @@ "100" ] }, - "execution_count": 33, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -346,7 +346,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -404,7 +404,7 @@ "# save the clips to a dir\n", "\n", "import os\n", - "clips_dir = \"clips\"\n", + "clips_dir = str(input(\"Enter the directory to save the clips: \"))\n", "os.makedirs(clips_dir, exist_ok=True)\n", "\n", "for i, clip in enumerate(clips):\n", @@ -414,7 +414,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -423,8 +423,8 @@ " clips_metadata = json.load(f)\n", "\n", "for item in clips_metadata:\n", - " item[\"start_time_ms\"]=item[\"start_time_ms\"]-40\n", - " item[\"end_time_ms\"]=item[\"end_time_ms\"]+40\n", + " item[\"start_time_ms\"]=item[\"start_time_ms\"]+40\n", + " item[\"end_time_ms\"]=item[\"end_time_ms\"]-40\n", "\n", "# update the file with new timestamps\n", "with open(\"clips_metadata.json\", \"w\") as f:\n", diff --git a/template_clips/100000_cut.mp4 b/template_clips/100000_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e8c22c55e145d8c708d86155a3acb79c38c9d83c --- /dev/null +++ b/template_clips/100000_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:305accdf23db7fa4e8aa1879a20776e6dda288dfb1f54150799bad5999b15d02 +size 81319 diff --git a/template_clips/1000_cut.mp4 b/template_clips/1000_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..a161a5a7f7c65d29d6296a33885e5d0fbb0e3255 --- /dev/null +++ b/template_clips/1000_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f4f1af62bb1d5fa5180985cccc4fa11131372aaca0f9ebd5e7204c3c9896ce2 +size 95354 diff --git a/template_clips/100_cut.mp4 b/template_clips/100_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ba4b71c5afa97d3b7830f7e0d0a7e9f3a2b294bb --- /dev/null +++ b/template_clips/100_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b054c896de03050a70009b1cfa9a2ab23e7b0438853314548855ab724bc6dcd2 +size 84711 diff --git a/template_clips/10_cut.mp4 b/template_clips/10_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..61b217e252c20998d5f3388414e06644ca5105d0 --- /dev/null +++ b/template_clips/10_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cce39cad9d2514fe565c0a4e7151e705f83ad4a128787f6c69f8e8aef1f213b +size 78759 diff --git a/template_clips/11_cut.mp4 b/template_clips/11_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e51411f5d7dda5dbc8efd6150767022f8db14cfe --- /dev/null +++ b/template_clips/11_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a99be48e1d9469ff34ac8bf6118bbce6b74b387f334523f9f95c9154c256c63a +size 91618 diff --git a/template_clips/12_cut.mp4 b/template_clips/12_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e95ab0db655b7331fb4a7c543d79de35d0f39a01 --- /dev/null +++ b/template_clips/12_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a110310c2f28a932da50baebeb6eca6c749d44a365d632d30c8eff86564c45ad +size 81602 diff --git a/template_clips/13_cut.mp4 b/template_clips/13_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..dfd29c759a1a6c4cbc1d00ce2513872b0ca65c22 --- /dev/null +++ b/template_clips/13_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbfae9343e3a1926748c7472c330d392922c94d3cd2cd53b173d3ed55c63b073 +size 87643 diff --git a/template_clips/14_cut.mp4 b/template_clips/14_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ad2bfccc31b117be89e16872a140f5a722baf014 --- /dev/null +++ b/template_clips/14_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dce636d52d903b15f300cba4e93be8d951debb29096803f2d578c9aeac9e6c44 +size 86456 diff --git a/template_clips/15_cut.mp4 b/template_clips/15_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..06825717f8fbad1556eb6372657e48469ec43dba --- /dev/null +++ b/template_clips/15_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9431a8085ca4c4f5463fbfed37430f63e5240d0731ab14a1986bf0ec6e8d50d +size 90627 diff --git a/template_clips/16_cut.mp4 b/template_clips/16_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ea8a6d58c6054a06dfe74258ccca8ce76df3d82c --- /dev/null +++ b/template_clips/16_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:776f4ee1e99d1f2318c5e87430a521ba56d2fa76c63242f962f968c0dd0ca4db +size 101924 diff --git a/template_clips/17_cut.mp4 b/template_clips/17_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ca048bcb991e2b49706a41d38d5de75b90660c99 --- /dev/null +++ b/template_clips/17_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c69aceeb2328bf951aa2b70c9c3d28ec170c9d26b2ea87c3368e9d2a0abd2c89 +size 104708 diff --git a/template_clips/18_cut.mp4 b/template_clips/18_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..54fad78da4fbce513fd085de4968a42ad7795934 --- /dev/null +++ b/template_clips/18_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68dd7de0f1a67e560b0a2cbeb5f4f8b41b7ff39a40aee8ebaa917d26296faf01 +size 91462 diff --git a/template_clips/19_cut.mp4 b/template_clips/19_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e617da6550452d8f6c990e03c1e3eb3fd6f90594 --- /dev/null +++ b/template_clips/19_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbf2843be8af6763a3ceff1d9001f3b06269054e8b0668b2dcff9bfe7b778d31 +size 106164 diff --git a/template_clips/1_cut.mp4 b/template_clips/1_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..055f6ac049d2aa985e45fc05df5b38f8fd1d16c3 --- /dev/null +++ b/template_clips/1_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22ce311c65462c1921e21052e55a82d37a7832fc3d0ca333241bdebe1bd7df08 +size 82742 diff --git a/template_clips/20_cut.mp4 b/template_clips/20_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..9431e491d90e882caffa7a0f7e8d2358f9752dc9 --- /dev/null +++ b/template_clips/20_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dddc177934a16b65d88d76ef3961688e0e37aa50d0ba048b00be13d32a88c2ce +size 84235 diff --git a/template_clips/2_cut.mp4 b/template_clips/2_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..47df6518acf8cf785e85646224313bfc86a09395 --- /dev/null +++ b/template_clips/2_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88fef27910798f81b933e31d018cb19f4a7809997b64ba39c51705abb1f78a02 +size 74315 diff --git a/template_clips/30_cut.mp4 b/template_clips/30_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..858ce57c8bb67071c1d178213ae0509a9856399c --- /dev/null +++ b/template_clips/30_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29944aa72292ebd650f1bcd04ed87b90826c469a45bd114d060c3b1bde33ad82 +size 80632 diff --git a/template_clips/3_cut.mp4 b/template_clips/3_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..37f0c6ed01f4e18639e9b055c2f1ce65cfc94c93 --- /dev/null +++ b/template_clips/3_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:855c1dae306719a2821103e5f2ccba45b5d174e58fab0213e381ccd268774251 +size 71568 diff --git a/template_clips/40_cut.mp4 b/template_clips/40_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..3e52f9468f9799afeaec53d0dcc1958ffa98cfad --- /dev/null +++ b/template_clips/40_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:587b88c374dcaae165e27ede45ce2e6619ace312613494a2f3802a74a9060ae9 +size 81153 diff --git a/template_clips/4_cut.mp4 b/template_clips/4_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..615fedd6a4834ee2a4f052ef1170be455357737d --- /dev/null +++ b/template_clips/4_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffa98900ff00b4a3ce520301cf654e6136a4d6260c7a482bd85be645c4a7e593 +size 72360 diff --git a/template_clips/50_cut.mp4 b/template_clips/50_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ae2eb113815114b2def8d93262be197b3589f971 --- /dev/null +++ b/template_clips/50_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1634b925c611096012a16b93f7501ed1658d547a498e2fe68f410073cc79d49f +size 80697 diff --git a/template_clips/5_cut.mp4 b/template_clips/5_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..32b8eeee2a0c941efc519eee3eb4d3f4bf8c5e60 --- /dev/null +++ b/template_clips/5_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be70a8df8c5a580d33d2ca65578dc724461c8369f6596db61940beb6b2b74d45 +size 78631 diff --git a/template_clips/60_cut.mp4 b/template_clips/60_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..0aa50458730677b6b564aa7ffe1bb4780372fab6 --- /dev/null +++ b/template_clips/60_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc858b40671094c71c03f6a1efe240f7c6fdc68e461d36e752812c315b6c2384 +size 90032 diff --git a/template_clips/6_cut.mp4 b/template_clips/6_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e65b65b4a2c722d0a05169393f5404b802609255 --- /dev/null +++ b/template_clips/6_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c52ebe8c1b1185f0efa552000e16529c020a72c569f609e4d3bc32f5b24e1030 +size 67852 diff --git a/template_clips/70_cut.mp4 b/template_clips/70_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..b19fcb5f920db9901b377beb4fc9534665c78be2 --- /dev/null +++ b/template_clips/70_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d616412f9675d9e0c7a892c375b927a43c02bcaf86b5212be0fbfef28707934 +size 91920 diff --git a/template_clips/7_cut.mp4 b/template_clips/7_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..10b524f86d593056ff9bfc18adfcb88d89e5c04b --- /dev/null +++ b/template_clips/7_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38bbcd0efde8e7347ebe5c5d63bce9d1309408b37770fb0315def1ae3f4971b1 +size 85209 diff --git a/template_clips/80_cut.mp4 b/template_clips/80_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..65cc6eb94f730eb97ce7195b9afccd23d1563265 --- /dev/null +++ b/template_clips/80_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f45c45b5784dd412321aa89f76d7f4abf9f46375aaca8fd3bf6e5aded889db2 +size 78099 diff --git a/template_clips/8_cut.mp4 b/template_clips/8_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..c7de96ec7b617a482da7763301a3b5f60eebb7ba --- /dev/null +++ b/template_clips/8_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e765f2f669ddd668556f74fa3b29bc7fc5e33248314c60977bf06e87f366b33 +size 72056 diff --git a/template_clips/90_cut.mp4 b/template_clips/90_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..76871dd21abf9fefe1af76f4be9fbe3636fd766a --- /dev/null +++ b/template_clips/90_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26ea255194c711e00b5bd7bdcf6065252fc1d8ad37bbe054c946e180c24f9025 +size 93981 diff --git a/template_clips/9_cut.mp4 b/template_clips/9_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..cda006f973b893c29ef3251cf38586655c8c30a6 --- /dev/null +++ b/template_clips/9_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abbf4ca708da2d115f0ea23c842abf9fae2babfc4192dd38e6e4631ee6ab79b6 +size 94444 diff --git a/template_clips/Conclusion_cut.mp4 b/template_clips/Conclusion_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..aa2c5692496d1912229488476fa0d242f2c4f826 --- /dev/null +++ b/template_clips/Conclusion_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ed55ccd4b86af24f9dd106c7ca69fb87f72c65c623cdfae0ea6d60acda51671 +size 103334 diff --git a/template_clips/Intro_cut.mp4 b/template_clips/Intro_cut.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..db0ec01ca102d99c9135270cc78579e428ddf412 --- /dev/null +++ b/template_clips/Intro_cut.mp4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a756e3e162ecf1ff7a7ba8aa6ffaf2bdc07ecf3a96dec3fb9daa2f38a05d9753 +size 170924 diff --git a/trimmed_clips/100000_cut.mp4 b/trimmed_clips/100000_cut.mp4 deleted file mode 100644 index 3802c16e75b3a19d213b26f4d00684cd5a373482..0000000000000000000000000000000000000000 --- a/trimmed_clips/100000_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b7e87d956fa322d0a14f1c3921ded2e67dd57f94a332c9dd6076498f44a93f05 -size 77018 diff --git a/trimmed_clips/1000_cut.mp4 b/trimmed_clips/1000_cut.mp4 deleted file mode 100644 index 8d77b91feacc409d714c883f5212aefda8e9546c..0000000000000000000000000000000000000000 --- a/trimmed_clips/1000_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0885ef818b90c4ccda54d41bf89ad122a7947159f83bfaa1958ccaeac7c07136 -size 92178 diff --git a/trimmed_clips/100_cut.mp4 b/trimmed_clips/100_cut.mp4 deleted file mode 100644 index 589110aa2a9ef3f9faf25abd79133ee452ed2f52..0000000000000000000000000000000000000000 --- a/trimmed_clips/100_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8247d9e14aad776f95b48b26c12729e67e346e473ef9ca5aa0472366dfb00611 -size 79313 diff --git a/trimmed_clips/10_cut.mp4 b/trimmed_clips/10_cut.mp4 deleted file mode 100644 index 157ca210e07dcb96b3c97bb304a45b06b306a836..0000000000000000000000000000000000000000 --- a/trimmed_clips/10_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8911521574328f1f5618ebc1c3ffad6633ae845adab57b8e535c6d40f4f0f176 -size 74383 diff --git a/trimmed_clips/11_cut.mp4 b/trimmed_clips/11_cut.mp4 deleted file mode 100644 index 5b869f978fadc03f3fdb1a5335c1af477d367a8f..0000000000000000000000000000000000000000 --- a/trimmed_clips/11_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a24b56cce9a9e8227965617d13e8584a1bc6e968febead6dc8332cfba054b961 -size 87835 diff --git a/trimmed_clips/12_cut.mp4 b/trimmed_clips/12_cut.mp4 deleted file mode 100644 index 110bc248b82426209a1d7ac8729b7285855c1db2..0000000000000000000000000000000000000000 --- a/trimmed_clips/12_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4c0bcc72ee654a8179c5ff9ad5f37c8df0028921d678a4c683da68931a7d2b0c -size 77739 diff --git a/trimmed_clips/13_cut.mp4 b/trimmed_clips/13_cut.mp4 deleted file mode 100644 index 10a49f93c827343d5a18217a6d96abc4719a4b7f..0000000000000000000000000000000000000000 --- a/trimmed_clips/13_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7e133495a1f15d95193808e4435fdb0acac3689e0f0756087d81cfba3519402c -size 83695 diff --git a/trimmed_clips/14_cut.mp4 b/trimmed_clips/14_cut.mp4 deleted file mode 100644 index 396e780fe035e4d2b33934d3b223bbe73e404104..0000000000000000000000000000000000000000 --- a/trimmed_clips/14_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4e59fe49d9edd62c6be715658bf445db30daacc7573010e0b68a2e03e3cf3133 -size 81626 diff --git a/trimmed_clips/15_cut.mp4 b/trimmed_clips/15_cut.mp4 deleted file mode 100644 index 1b66acea30c33746037289d0bdab78537693a05b..0000000000000000000000000000000000000000 --- a/trimmed_clips/15_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8053010988107d4fd2c19a04b234cb87d6fbd1633e78816062fa1eb0ab3563be -size 86905 diff --git a/trimmed_clips/16_cut.mp4 b/trimmed_clips/16_cut.mp4 deleted file mode 100644 index 2739c8209058fd548e69d42bd5a2be8e3d6a4b5f..0000000000000000000000000000000000000000 --- a/trimmed_clips/16_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c8a5454353d76f2b9418fc3802677b8b5e97eafdcb1c3ac3c381e59ce6c4aed9 -size 98327 diff --git a/trimmed_clips/17_cut.mp4 b/trimmed_clips/17_cut.mp4 deleted file mode 100644 index a2fd45d7b7471084fd4163d57d67b8a6691f80e2..0000000000000000000000000000000000000000 --- a/trimmed_clips/17_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e2b6da927a571fbb2ded4d32f9d5ab6b40bfe0560b2449a7e33662be53a37de6 -size 100423 diff --git a/trimmed_clips/18_cut.mp4 b/trimmed_clips/18_cut.mp4 deleted file mode 100644 index 150cf71d116f5174f6c30af1fc1659d215729a47..0000000000000000000000000000000000000000 --- a/trimmed_clips/18_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd4cb828d6c74d2fbe5d61ee1e039121495a31acbcead91ee60097fc59d27b32 -size 86691 diff --git a/trimmed_clips/19_cut.mp4 b/trimmed_clips/19_cut.mp4 deleted file mode 100644 index 0f04b460d987679d621c752589ec6c3a48a06c8a..0000000000000000000000000000000000000000 --- a/trimmed_clips/19_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62ee6b89d0bc833b8ce6ceeeeb9d437360145aef5849b8a76deb8d7b0eb7b644 -size 101503 diff --git a/trimmed_clips/1_cut.mp4 b/trimmed_clips/1_cut.mp4 deleted file mode 100644 index a16623153531ac435c1cb4b0481b96256ff145d2..0000000000000000000000000000000000000000 --- a/trimmed_clips/1_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5290936eb8670a9df5da5368a4f2910f98a14106e15d826b339945762245ae69 -size 79730 diff --git a/trimmed_clips/20_cut.mp4 b/trimmed_clips/20_cut.mp4 deleted file mode 100644 index 18640fc9e9c8904f6f6834fce04cf07b14c9c9a6..0000000000000000000000000000000000000000 --- a/trimmed_clips/20_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9532be3adc27416ce8cf6fe543f7bba34b2efb4ba7f6e5e61d881c07d6774914 -size 81421 diff --git a/trimmed_clips/2_cut.mp4 b/trimmed_clips/2_cut.mp4 deleted file mode 100644 index ed61ed1c66d6e0f95d049b26c7f99f1eac366371..0000000000000000000000000000000000000000 --- a/trimmed_clips/2_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a51cf1add240252d23fe83b047af481560899d75d047b432b3737cce9cb732d -size 69712 diff --git a/trimmed_clips/30_cut.mp4 b/trimmed_clips/30_cut.mp4 deleted file mode 100644 index 9f926003f1bcb857dc67168a0a68bcab930a8fa2..0000000000000000000000000000000000000000 --- a/trimmed_clips/30_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d45dbed2336ca06ff3dfb00e087e9418c742f898e79132c038c2fb1bd39fe187 -size 77696 diff --git a/trimmed_clips/3_cut.mp4 b/trimmed_clips/3_cut.mp4 deleted file mode 100644 index 74b2535500ad1ab0175e1e335dec5f8d08169127..0000000000000000000000000000000000000000 --- a/trimmed_clips/3_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e2f4f9c5e1609a255a8c6014066685efea235bc4b53f12c6fc9bb59d9950081d -size 67495 diff --git a/trimmed_clips/40_cut.mp4 b/trimmed_clips/40_cut.mp4 deleted file mode 100644 index 941a0803fdc28914b047ed1c014dfd4b56bec001..0000000000000000000000000000000000000000 --- a/trimmed_clips/40_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a321c8d354f5fa43df2c45d52f23faad488f1104ec07c13d04b0a7c0a580119 -size 78120 diff --git a/trimmed_clips/4_cut.mp4 b/trimmed_clips/4_cut.mp4 deleted file mode 100644 index f5724ca93d407b90a9cebe59c359928b52314492..0000000000000000000000000000000000000000 --- a/trimmed_clips/4_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:95610cea0abecf2fc1c031b0f2af7e14ba870741db2e603109cc3a346fb6798c -size 67889 diff --git a/trimmed_clips/50_cut.mp4 b/trimmed_clips/50_cut.mp4 deleted file mode 100644 index 43f96ad7fbf42c4c2ffec45a9cc03b502e0f721f..0000000000000000000000000000000000000000 --- a/trimmed_clips/50_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f4283eb71352d1bc09da8c8229be007223b9cf3d89b4aa919f7fb2d3522e780f -size 77876 diff --git a/trimmed_clips/5_cut.mp4 b/trimmed_clips/5_cut.mp4 deleted file mode 100644 index 2f9b90f689f21842d6c1f08fac0dc9d8e5d4f163..0000000000000000000000000000000000000000 --- a/trimmed_clips/5_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3f21baf46332b10858a3333d6eedf119fb4c92e8929384f92aab472f034b0638 -size 74921 diff --git a/trimmed_clips/60_cut.mp4 b/trimmed_clips/60_cut.mp4 deleted file mode 100644 index ec91ed6c3802bffb1847eecc0933f1b300672c40..0000000000000000000000000000000000000000 --- a/trimmed_clips/60_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b8af898273e8d95f3d4cc6b7256c684dd7236914888d4320172c278e0bd4a40b -size 87650 diff --git a/trimmed_clips/6_cut.mp4 b/trimmed_clips/6_cut.mp4 deleted file mode 100644 index b06f76d0dc2dd4c1380dcfd04973443450e00d81..0000000000000000000000000000000000000000 --- a/trimmed_clips/6_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b5ef16d604f3b542e21a55c57faaa425c0b04fbcc47de59ef518f982f4c93603 -size 63364 diff --git a/trimmed_clips/70_cut.mp4 b/trimmed_clips/70_cut.mp4 deleted file mode 100644 index 45e42b99aaae5557bffd8bea4568f4690d1c347d..0000000000000000000000000000000000000000 --- a/trimmed_clips/70_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d7e90023675212f6fd37a8da95e3dde02caa48e4fdaf34f098ae160cb8fdfb38 -size 88063 diff --git a/trimmed_clips/7_cut.mp4 b/trimmed_clips/7_cut.mp4 deleted file mode 100644 index b7262cc24004b23bf936f44de33d3e6618a5c71b..0000000000000000000000000000000000000000 --- a/trimmed_clips/7_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b125427704dbb3adb733bb9ac10ac2ffa8f21031729564008b6fc3761c30642 -size 82048 diff --git a/trimmed_clips/80_cut.mp4 b/trimmed_clips/80_cut.mp4 deleted file mode 100644 index 310b8c1a06f5fe5361a99094deba5cb0c071f7c6..0000000000000000000000000000000000000000 --- a/trimmed_clips/80_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:56498f0adba95388c95842910bebd7a93a983e0e6b3cdebfe5846565a8e20bdf -size 74774 diff --git a/trimmed_clips/8_cut.mp4 b/trimmed_clips/8_cut.mp4 deleted file mode 100644 index 77975976f8e5cb956d706cc9aef3b12f3be329ed..0000000000000000000000000000000000000000 --- a/trimmed_clips/8_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2bcf31f711ac5ec13f247a1d5656f3e215a1c3d89d686a26e1302be40bfba0ab -size 68743 diff --git a/trimmed_clips/90_cut.mp4 b/trimmed_clips/90_cut.mp4 deleted file mode 100644 index da04192aeebce4cfb28e5c19abaf2b8ed7b08fc4..0000000000000000000000000000000000000000 --- a/trimmed_clips/90_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3b9d7ab669b36ee07e3e99fecff6cd2e07cfdd778534778eb0af704dc3cfe4bc -size 90712 diff --git a/trimmed_clips/9_cut.mp4 b/trimmed_clips/9_cut.mp4 deleted file mode 100644 index 90cedec2398b3559efadfcfb86c832128d589642..0000000000000000000000000000000000000000 --- a/trimmed_clips/9_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d8fc69780bbab44c4a2c57b4e2401d97cb44b51884948bccb7d911728ca3130d -size 92050 diff --git a/trimmed_clips/Conclusion_cut.mp4 b/trimmed_clips/Conclusion_cut.mp4 deleted file mode 100644 index ff571e9c6f9faeda61812b23a5c588673ebffb08..0000000000000000000000000000000000000000 --- a/trimmed_clips/Conclusion_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba45ec1a259fa0ef98159d52e685db6e11f13bca2df17585086b47b2ffe4a9c8 -size 100394 diff --git a/trimmed_clips/Intro_cut.mp4 b/trimmed_clips/Intro_cut.mp4 deleted file mode 100644 index 34546d4ec40d036ed4f1b8dd99bc4b25e6423181..0000000000000000000000000000000000000000 --- a/trimmed_clips/Intro_cut.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:448232c6032af93d841eea505b45ffca4d7867f81da1323f6064963535349b6f -size 168906 diff --git a/utils.py b/utils.py index 89bdcd413aa6bb30883e8176fe60b3be26f0d17a..b54853eba5d137c357aac0387c2a8d640d075ebb 100644 --- a/utils.py +++ b/utils.py @@ -53,13 +53,18 @@ def generate_clip_sequence(n): return clip_sequence -def trimmed_clip_path(clip): - return f"trimmed_clips/{clip.split('.mp4')[0]}_cut.mp4" +def trimmed_clip_path(clip, avatar_path="custom_clips"): + print(f"{avatar_path}/{clip.split('.mp4')[0]}_cut.mp4") + return f"{avatar_path}/{clip.split('.mp4')[0]}_cut.mp4" -def get_clip_duration(clip): +def get_clip_duration(clip, avatar_path="custom_clips"): + if avatar_path == "custom_clips": + avatar_path = "custom_clips" + else: + avatar_path = "template_clips" try: - clip = VideoFileClip(trimmed_clip_path(clip)) + clip = VideoFileClip(trimmed_clip_path(clip, avatar_path=avatar_path)) return clip.duration except Exception as e: print(f"Error loading clip {trimmed_clip_path(clip)}: {e}") @@ -110,9 +115,17 @@ def create_video(number,st, en, output_file="output.mp4"): print("No clips to combine. Video creation failed.") -def create_advanced_video(number, trim_settings, output_file="output.mp4"): - intro_file = "trimmed_clips/Intro_cut.mp4" - conclusion_file = "trimmed_clips/Conclusion_cut.mp4" +def create_advanced_video(number, trim_settings, avatar, output_file="output.mp4"): + if avatar == "custom": + path = "custom_clips" + intro_file = f"{path}/Intro_cut.mp4" + conclusion_file = f"{path}/Conclusion_cut.mp4" + else: + path = "template_clips" + intro_file = f"{path}/Intro_cut.mp4" + conclusion_file = f"{path}/Conclusion_cut.mp4" + + print(f"Using avatar: {avatar}") clips_to_combine = [VideoFileClip(intro_file)] clips = generate_clip_sequence(number) @@ -120,7 +133,7 @@ def create_advanced_video(number, trim_settings, output_file="output.mp4"): video_clips = [] for i, clip_path in enumerate(clips): try: - clip = VideoFileClip(trimmed_clip_path(clip_path)) + clip = VideoFileClip(trimmed_clip_path(clip_path, avatar_path=path)) trim_start, trim_end = trim_settings[i] trimmed_clip = cut_clip(clip, trim_start, clip.duration - trim_end) video_clips.append(trimmed_clip)