r/moviepy • • Apr 10 '25

Vedio

0 Upvotes

from moviepy.editor import * from moviepy.video.tools.subtitles import SubtitlesClip from moviepy.video.fx.all import fadein, fadeout

إعداد النصوص لكل جزء في الفيديو

scenes = [ ("هل تصدق بالأشباح؟", 0, 3), ("هذه قصة عمر... الرجل الذي عاش في بيت مسكون.", 3, 6), ("في أول ليلة... سمع عمر أصوات غريبة من الطابق العلوي.", 6, 10), ("في اليوم التالي، بدأت الأشياء تتحرك من مكانها!", 10, 14), ("وفي الليلة الثالثة... رآها.", 14, 17), ("امرأة تقف في نهاية الممر... فقط تنظر.", 17, 21), ("بحث عمر عن تاريخ المنزل، ووجد الصدمة!", 21, 25), ("المرأة كانت تسكن هنا... وماتت في ظروف غامضة.", 25, 29), ("في إحدى الليالي، وجد رسالة مخبأة خلف الحائط:", 29, 33), (""لن تخرج أبدًا."", 33, 36), ("(يُغلق الباب بقوة)", 36, 39), ("النهاية... أو ربما... البداية؟", 39, 43) ]

تحميل صور الخلفية من ملفات محلية أو استخدام لون ثابت

clips = [] for i, (text, start, end) in enumerate(scenes): duration = end - start txt_clip = TextClip(text, fontsize=50, font="Arial-Bold", color="white", bg_color="black", size=(720, 1280), method="caption") txt_clip = txt_clip.set_duration(duration).set_position("center") txt_clip = fadein(txt_clip, 0.5).fx(fadeout, 0.5) clips.append(txt_clip)

تجميع المقاطع

final_video = concatenate_videoclips(clips, method="compose")

إضافة موسيقى رعب خلفية

audio = AudioFileClip("/mnt/data/horror_music.mp3").subclip(0, final_video.duration) final_video = final_video.set_audio(audio)

تصدير الفيديو

output_path = "/mnt/data/omar_haunted_house_story.mp4" final_video.write_videofile(output_path, fps=24)


r/moviepy • • May 21 '20

Writing speed slows as it writes

1 Upvotes

Is it normal for the writing speed to get slower and slower as it writes a new video clip? this is a concatenated clip, but it happens to me regardless of how many clips are being concatenated. so if i have two 50 sec clips at 1920x1080 (definitely high resolution) it will take roughly 24 hours to print out the resulting file and i am only calling the vanilla .write_videofile command to print (no overloads). i see i can also thread it, which i assume will improve performance, but i was wondering why it appeared to slow as it built. the percentage finished at first seems to be decent but slows more and more as more of the video clip is being written. is this an error with the estimate or am i missing something that will greatly increase writing time? i'm basically just using the mixing code example in the documentation as my code.


r/moviepy • • Oct 29 '16

How do i get this working

0 Upvotes

i downloaded moviepy and did the setup... how do i run it? im so confused


r/moviepy • • Nov 13 '24

CLIP

0 Upvotes

r/moviepy • • Oct 06 '17

Use With Java

1 Upvotes

Is there a way to use this with Java?

Is there a library for Java that would do something similar that moviepy does?

Just looking for ways to integrate script-based video editing into a Java project, in a way that might be faster than Python.

Thanks.


r/moviepy • • Mar 15 '15

help! getting glitch art when concatenating clips

1 Upvotes

first off, thanks, Zulko, for the glories of moviepy. it is such an awesome and fun library.

my project: i'm concatenating clips together from a bunch of different video sources. these are videos taken from a DSLR, from an android phone camera, and from a macbook webcam. unfortunately, i'm getting some pretty serious glitch art when i try to combine clips from different sources.

basically: when i concat DSLR with DSLR clips, all is well. when i concat phone with phone clips, all is well. but when i concat DSLR with phone (or webcam) clips, it dies a glitch arty death.

i get a "missing fps" error when i concat DSLR with phone clips, and so i've set the fps to the phone clip fps (pulled from VLC):

year_video = mpy.concatenate_videoclips(clip_array)
year_video.write_videofile("test.mp4", fps=30)

this lets the code run, but i get a final video where the DSLR clips look fine, and then the phone clips are all scrambled. (audio is fine, though.) anything i can do?

edit: just found this previous thread.

so it looks like attempting to use moviepy.video.fx.resize leads to an ImportError. here's my code:

base_clip = mpy.VideoFileClip("file1.mp4").set_duration(1)
day_clip = mpy.VideoFileClip("file2.mp4").set_duration(1)
day_clip = day_clip.resize(base_clip.size)

it breaks on the last line, with this error:

File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/moviepy/video/fx/resize.py", line 156, in resize raise ImportError("fx resize needs OpenCV or Scipy or PIL") ImportError: fx resize needs OpenCV or Scipy or PIL

i'm importing scipy, just in case, but no difference. thanks!


r/moviepy • • Jan 13 '21

Concatenation Glitchs

2 Upvotes

I cant concatenate clips with differents resolutions, it glitches

neither use method "compose" or " video = CompositeVideoClip([clip1,clip2,clip3,clip 4]) "

from moviepy import *

import pygame
from pygame.locals import *

from moviepy.editor import VideoFileClip, concatenate_videoclips, clips_array, vfx


clip1 = VideoFileClip("./video.mp4")
clip2 = VideoFileClip("./video2.mp4")
clip3 = VideoFileClip("./video3.mp4")
clip4 = VideoFileClip("./video4.mp4")



clipf = concatenate_videoclips([clip1,clip2,clip3,clip4])


clipf.write_videofile("./concat.mp4", audio =False, method "compose" )

r/moviepy • • Aug 30 '20

Using MoviePy I made a bot that Randomly Generates Videos

Thumbnail
youtube.com
4 Upvotes

r/moviepy • • Mar 18 '23

Vosk API + MoviePy = this

6 Upvotes

r/moviepy • • Mar 28 '25

How to speed up video rendering performance when zooming into an ImageClip?

5 Upvotes

This minimal example produces a 10-second 640x480@30 video:

import time
from io import BytesIO

import numpy as np
import requests
from PIL import Image
from moviepy import *

response = requests.get("https://i.stack.imgur.com/o1z7p.jpg")
image = Image.open(BytesIO(response.content))
image = image.resize((640, 480))

clip = ImageClip(np.array(image)).with_start(0).with_duration(10).resized(lambda t: 1 + t / 3)

video = CompositeVideoClip([clip])
start = time.time()
video.write_videofile("output.mp4", codec="libx264", preset="ultrafast", threads=16, fps=30, logger=None)
print(time.time() - start)

On my Intel(R) Core(TM) i7-14700K with 28 cores, it takes ~9 seconds.

Since htop was showing only one used core, I figured the bottleneck was not the x264 compression, but the MoviePy-internal rendering of the frames.

I understand that resizing an image is a computationally complex operation, so I tried using the fastest image-scaling implementation I could find (OpenCV with cv2.INTER_NEAREST) and using it in parallel:

import multiprocessing
import time
from io import BytesIO

import cv2
import numpy as np
import requests
from PIL import Image
from moviepy import ImageClip, concatenate_videoclips, CompositeVideoClip


def opencv_resize(t, image):
    scale = 1 + t / 3
    new_size = (int(640 * scale), int(480 * scale))
    return cv2.resize(image, new_size, cv2.INTER_NEAREST)


response = requests.get("https://i.stack.imgur.com/o1z7p.jpg")
image = Image.open(BytesIO(response.content))
image = image.resize((640, 480))
image = np.array(image)

duration = 10
fps = 30
num_frames = duration * fps

times = np.linspace(0, duration, num_frames)

start = time.time()
with multiprocessing.Pool() as pool:
    resized_frames = pool.starmap(opencv_resize, [(t, image) for t in times])

clips = [ImageClip(frame, duration=1 / fps) for frame in resized_frames]
clip = concatenate_videoclips(clips)
video = CompositeVideoClip([clip])

video.write_videofile("output.mp4", codec="libx264", preset="ultrafast", threads=16, fps=30, logger=None)
print(time.time() - start)

This nicely heats all CPU cores but still takes ~6 seconds overall. (~3 seconds for the resizing, ~3 seconds for writing to the mp4 file.)

Do you have some idea on how to speed it up even further?


r/moviepy • • Apr 28 '15

What is the correct way to add audio to a video in moviepy?

4 Upvotes

I tried many ways, but none work. The simplest form I could find (and still not working) is this:

import moviepy.editor as mp
video = mp.VideoFileClip("video.mp4")
video.write_videofile("output.mp4", audio="audio.mp3")

Also this doesn't work:

import moviepy.editor as mp
audio = mp.AudioFileClip("audio.mp3")
video1 = mp.VideoFileClip("video1.mp4")	
video2 = mp.VideoFileClip("video2.mp4")
final = mp.concatenate_videoclips([video1, video2]).set_audio(audio)
final.write_videofile("output.mp4")	

When check the file sizes, and the logs, it does show that its writing the audio to an mp3 and this temporary mp3 has the music.

Also the filesize indicates that the audio was added to the file.

But when you play the video, you simply can't here anything and also when looking at the file properties, the doesn't show that it has audio channels.

Has anyone succeded mixing video and audio?


r/moviepy • • May 31 '25

Where do I get the documentation for moviepy 1.0.3 (or older)?

4 Upvotes

Hi. I am a software engineer who is currently helping to maintain some old software that uses Moviepy 1.0.3, so I need help finding documentation for Moviepy 1.0.3.


r/moviepy • • May 07 '25

How to create a video mask?

2 Upvotes

So I am trying to use a video mask (a video with just black and white). It doesn't really work (code below).

Here's a frame from the output:

The red arrows are pointing at black. The mask video is black paint running down a white background. So it is outlining the black parts of the mask for some reason. It seems like the mask is able to detect the black transparency, but no matter what video clip I use (I have verified that the video clips' whites are indeed 255, 255, 255 pure white) it makes the white transparent and only shows the non-black/non-white edges of the mask. The dice picture is the background image clip and what is outline is the top image clip.

I have narrowed the problem down to the code. It has nothing to do with the video itself (I have tried many black and white videos from several sources and file formats and encoding settings etc.). Also, it's worth noting that I tried this code with a static black and white image mask and it worked as intended (white opaque, black transparent vs. how it's working now-- everything transparent except for non-white/ non-black).

Therefore, my conclusion is that there must be some other process to create a video mask that's different from creating a static image mask. But maybe I'm wrong, idk. I am very new to MoviePy.

CODE:

from moviepy import VideoFileClip
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from moviepy.video.VideoClip import ImageClip

# Load the video clip
mask_input_path = ".\\source\\simple_mask_video.mp4"
output_path = ".\\output\\output_video.mp4" 

mask_clip = VideoFileClip(mask_input_path, is_mask=True)
main_duration = mask_clip.duration

over_image_with_mask = ImageClip(img=".\\source\\top_image.png", duration=main_duration).with_mask(mask_clip)

under_image = ImageClip(".\\source\\bottom_image.png", duration=main_duration)

# Composite the bottom_clip and top_clip on top of the blank_clip
composited_clip = CompositeVideoClip(size=(1080,1920), clips=[
    under_image,
    over_image_with_mask,
    ]
    , bg_color=(0, 0, 0))


# Write the result to a file
composited_clip.write_videofile(output_path, codec="libx264", audio_codec="aac", fps=30)

# Close the clips
mask_clip.close()

r/moviepy • • Sep 21 '25

Batching video rendering

2 Upvotes

I have started using moviepy quite recently and found it to be a real pain as all LLM's refer to the version 1 syntax and I'm working with the latest 2 version. But kept going nevertheless as I could see moviepy as a major time saver.

However, now that my script is almost done, I'm hitting the very real bottleneck of painfully slow video rendering.

I am currently looking at ways to make the whole thing faster by way of multiprocessing, meaning to divide the video in batches and then stitch everything together with ffmpeg.

Is there anything alike already implemented anywhere? Does this even make sense?


r/moviepy • • Mar 18 '24

I just love editing vidoes in moviepy

10 Upvotes

Sure it takes 20x more time, but once it works it's just so rewarding. Here's a quick short form video concept i made using moviepy.


r/moviepy • • Nov 09 '25

I created a performance-focused alternative to MoviePy

13 Upvotes

Hey everyone,

MoviePy is an incredibly powerful tool. However, for some of my projects, I kept running into performance bottlenecks, especially with compositions involving multiple layers, text overlays, and transformations.

So, I decided to build a solution for my own needs and wanted to share it with this community first to see if it might be useful to others. It's a performance-focused alternative called MovieLite.

The core idea was to keep a simple, chainable API similar to MoviePy, but to aggressively optimize the rendering pipeline using Numba (JIT compilation) for CPU-based tasks. The result has been pretty promising. These are my benchmark results for some examples (you can find them in my repo):

TaskmovielitemoviepySpeedup
No processing6.92s6.92s1.00x
Video zoom (1.0x → 1.5x)9.91s31.44s3.17x
Fade in/out7.63s8.44s1.11x
Text overlay8.98s33.70s3.75x
Video overlay18.94s72.44s3.83x
Alpha video overlay12.01s40.31s3.36x
Complex mix*39.66s166.88s4.21x
Overall104.04s360.12s3.46x

*Complex mix includes: video with zoom + fade, image clips with fade, text overlay, video overlay - all composed together.

Now, to be clear, this is not a full replacement for MoviePy. My focus was on making the common tasks significantly faster.

I'm still early in the journey, but it's reached a point where it's useful for my own projects. I'd genuinely love to get some feedback from MoviePy users like you.

  • Is this something that could be useful in your workflows?

  • Are there any obvious pain points or missing features that feel essential?

Any thoughts or critiques are welcome!

Thanks for taking a look! :)


r/moviepy • • Feb 06 '16

Problem trying to create a AudioFileClip Object

11 Upvotes

I'm working on a python script that takes a picture and a music file and create a video file using MoviePy library. Unfortunatly, I'm facing a problem I'm not able to resolve. When I try to define the AudioFile I get this error :

TypeError: 'float' object cannot be interpreted as an integer

Here's my code:

from moviepy.editor import *

clip = VideoFileClip("my_picture.jpg")
clip = clip.set_audio(AudioFileClip("music.mp3"))
clip = clip.set_duration(8)
clip.write_videofile("movie.mp4",fps=15)

I'm fairly new to Python so if someone could help me sort this problem it would be great :)

Here's the full error:

File "movietest.py", line 5, in <module> clip = clip.set_audio(AudioFileClip("music.mp3")) File "C:\Users\Julien_Dev\AppData\Local\Programs\Python\Python35-32\lib\site-packages\moviepy-0.2.2.11- py3.5.egg\moviepy\audio\io\AudioFileClip.py", line 63, in init buffersize=buffersize) File "C:\Users\Julien_Dev\AppData\Local\Programs\Python\Python35-32\lib\site-packages\moviepy-0.2.2.11-py3.5.egg\moviepy\audio\io\readers.py", line 70, in init self.buffer_around(1) File "C:\Users\Julien_Dev\AppData\Local\Programs\Python\Python35-32\lib\site-packages\moviepy-0.2.2.11-py3.5.egg\moviepy\audio\io\readers.py", line 234, in buffer_around self.buffer = self.read_chunk(self.buffersize) File "C:\Users\Julien_Dev\AppData\Local\Programs\Python\Python35-32\lib\site-packages\moviepy-0.2.2.11-py3.5.egg\moviepy\audio\io\readers.py", line 123, in read_chunk self.nchannels)) TypeError: 'float' object cannot be interpreted as an integer


r/moviepy • • Sep 14 '25

Progress Bar

Post image
4 Upvotes

Hi guys, I implemented a video length progress tracker for my own project. Thought to share you here.

Code:

import numpy as np, colorsys
from moviepy import (
    ImageClip,
)
RESOLUTIONS = (1080, 1920)  # Resolution for the final video
# Imports


def progress_bar(
    barHeight: str = 20,
    color="white",
    duration: int = 30,
) -> ImageClip:
    """
    Create a progress bar for the video.

    Args:
        barHeight (int): Height of the progress bar.
        color (str): Color of the progress bar. Can be "rainbow", "white", "black", or a tuple of two hex colors.
        duration (int): Duration of the video.
    """

    def make_bar(w, h):
        arr = np.zeros((h, w, 3), dtype=np.uint8)
        if color == "rainbow":
            for x in range(w):
                r, g, b = colorsys.hsv_to_rgb(x / w, 1.0, 1.0)
                arr[:, x] = [int(255 * r), int(255 * g), int(255 * b)]
        elif color == "white":
            arr[:] = [255, 255, 255]
        elif color == "black":
            arr[:] = [0, 0, 0]
        elif isinstance(color, tuple) and len(color) == 2:
            # Gradient between two hex colors
            def hex_to_rgb(hex_color):
                hex_color = hex_color.lstrip("#")
                return np.array([int(hex_color[i : i + 2], 16) for i in (0, 2, 4)])

            start = hex_to_rgb(color[0])
            end = hex_to_rgb(color[1])
            for x in range(w):
                arr[:, x] = (start + (end - start) * (x / (w - 1))).astype(np.uint8)
        else:
            arr[:] = [255, 255, 255]
        return arr

    bar_img = make_bar(RESOLUTIONS[0], barHeight)
    bar_clip = ImageClip(bar_img, duration=duration).with_position(
        (0, RESOLUTIONS[1] - barHeight)
    )

    def crop_progress(get_frame, t):
        frame = get_frame(t)
        prog = int(RESOLUTIONS[0] * (t / duration))
        return frame[:, :prog]

    return bar_clip.transform(crop_progress, apply_to=["mask", "video"])

Usage:

img_clip = progress_bar(duration=full_duration, color=("#fcbd34", "#ff9a00"))

img_clip = progress_bar(duration=full_duration, color="rainbow")
img_clip = progress_bar(duration=full_duration, color="white")

r/moviepy • • Jul 18 '24

Error while write_videofile

1 Upvotes
from moviepy.editor import VideoFileClip, concatenate_videoclips

# Load video clips
clip1 = VideoFileClip("F:/IIITD_PHD/Talking Potraits/Code File/chunk_3.mp4")
clip2 = VideoFileClip("F:/IIITD_PHD/Talking Potraits/Code File/chunk_4.mp4")

# Print durations and fps to ensure they are loaded correctly
print(f"Clip 1 duration: {clip1.duration} seconds, fps: {clip1.fps}")
print(f"Clip 2 duration: {clip2.duration} seconds, fps: {clip2.fps}")

# Check if clips are loaded correctly
if clip1.duration is None or clip2.duration is None:
    raise ValueError("One of the video clips has no duration. Please check the video files.")

# Concatenate the clips using compose method
final_clip = concatenate_videoclips([clip1, clip2], method="compose")

# Debugging: Print attributes of the final clip
print(f"Final clip duration: {final_clip.duration}")
print(f"Final clip fps: {final_clip.fps}")

# Manually set the fps to 25 (since both clips have fps: 25.0)
fps = 25

# Ensure the final clip has a valid duration
if final_clip.duration is None:
    raise ValueError("The concatenated clip has no duration. Please check the video files and concatenation process.")

# Write the final concatenated clip to a file
final_clip.write_videofile("output_video.mp4", fps=fps)

TypeError Traceback (most recent call last)
Cell In[21], line 30
27raise ValueError("The concatenated clip has no duration. Please check the video files and concatenation process.")
29 # Write the final concatenated clip to a file
---> 30 final_clip.write_videofile("output_video.mp4", fps=fps)

File ~\AppData\Roaming\Python\Python311\site-packages\decorator.py:232, in fun(*args, **kw)

File c:\Users\tigna\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\decorators.py:54, in requires_duration(f, clip, *a, **k)
52raise ValueError("Attribute 'duration' not set")
53 else:
---> 54return f(clip, *a, **k)

File ~\AppData\Roaming\Python\Python311\site-packages\decorator.py:232, in fun(*args, **kw)

File c:\Users\tigna\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\decorators.py:135, in use_clip_fps_by_default(f, clip, *a, **k)
130 new_a = [fun(arg) if (name=='fps') else arg
131for (arg, name) in zip(a, names)]
132 new_kw = {k: fun(v) if k=='fps' else v
133for (k,v) in k.items()}
--> 135 return f(clip, *new_a, **new_kw)

File ~\AppData\Roaming\Python\Python311\site-packages\decorator.py:232, in fun(*args, **kw)

...

93'-i', audiofile,
94'-acodec', 'copy'
95])

TypeError: must be real number, not NoneType


r/moviepy • • Aug 11 '24

why moviepy is not detecting image magic if i change the installed folder directory to some documents directory but with default it is working even after specifying the path(windows)

1 Upvotes

please help and last time also i build subtitle renderer but i got problem in deployment due to image magic how can i handle the image magic


r/moviepy • • Aug 13 '24

Ken Burns with fl_image?

1 Upvotes

I'm trying to build a version of the Ken Burns Effect using the fl_image function and a resize function like this. But I keep getting the error TypeError: 'numpy.ndarray' object is not callable.

If anyone has any suggestions, TIA.

def ken_burns_clip(image_path, duration):

clip = ImageClip(image_path).set_duration(duration)

def resize_func(gf, t=2.0):

scale = start_scale + (end_scale - start_scale) * t / duration

position = (start_position[0] + (end_position[0] - start_position[0]) * t / duration,

start_position[1] + (end_position[1] - start_position[1]) * t / duration)

return gf(scale=scale).set_position(position)

return clip.fl_image(resize_func)


r/moviepy • • Aug 03 '24

MoviePy and ffmpeg, Broken Pipe Errors

2 Upvotes

I've been struggling with a Python script using MoviePy to edit video clips and burn in subtitles. I've encountered several issues, primarily related to ffmpeg.

**Problem:** I'm frequently encountering "Broken Pipe" errors when using MoviePy to process videos and burn in subtitles. I've noticed issues with ffmpeg recognizing the filenames, leading to "Unrecognized option" errors.

To solve these errors I tried different subtitle formats (ASS, SRT), I checked file permissions and ensured the script runs with administrator privileges, I also tried different ffmpeg versions.

**Additional Information:**

Operating system: Windows 10

Python version: 3.x

I'm open to suggestions regarding different approaches or libraries if necessary. Code Snippet:

from
 moviepy.editor 
import
 VideoFileClip, TextClip, CompositeVideoClip, CompositeAudioClip
from
 moviepy.video.tools.subtitles 
import
 SubtitlesClip
from
 moviepy.config 
import
 change_settings

change_settings({"IMAGEMAGICK_BINARY": "C:/Program Files/ImageMagick-7.1.1-Q16-HDRI/magick.exe"})
import
 os, sys
def
 
generate_subtitle_clip
(txt):
    print("this may not be the error but i doubt it isn't\n")
    
return
 TextClip(txt, font
=
'Komika', fontsize
=
24, color
=
'white', bg_color
=
"black", stroke_color
=
"yellow", stroke_width
=
2)

def
 
mk_subtitles
(videos, transcripts, out_folder):
    
for
 video 
in
 os.listdir(videos):
        print(
f
"Bruciando i sottotitoli per il video {video}...")
        srt_file 
=
 None
        print("Ricerca del sottotitolo per il video...")
        
for
 transcript 
in
 os.listdir(transcripts):
            transcript_name, ext 
=
 os.path.splitext(transcript)
            video_name, ext1 
=
 os.path.splitext(video)
            
if
 transcript_name 
==
 video_name:
                print("Sottotitoli trovati.\n")
                srt_file 
=
 transcript
                
break
 
        
if
 srt_file 
==
 None:
            print(
f
"Sottotitoli non trovati per il video {video}.\n")
            
return
        
        video_clip 
=
 VideoFileClip(videos 
+
 video)
        resized_clip 
=
 video_clip.resize((1280, 720))
        srt_path 
=
 os.path.join("./clips/audio/transcripts/", str(srt_file))
        
if
 os.path.exists(srt_path) 
==
 True:
            print("Il percorso dei sottotitoli esiste.\n")
        
else
:
            print("Il percorso per i sottotitoli non è valido.")

        
if
 os.access(srt_path, os.W_OK) 
!=
 True:
            print("Il percorso per il file srt non è accessibile.\n")
        
else
:
            print("Il percorso per il file srt è accessibile.\n")
        subtitle_clip 
=
 SubtitlesClip(srt_path, generate_subtitle_clip)
        final_clip 
=
 CompositeVideoClip([resized_clip, subtitle_clip.set_pos(('center', 'bottom'))])
        final_clip.write_videofile("./videos/" 
+
 video)
        
        video_clip.close()
        resized_clip.close()
        final_clip.close()
        subtitle_clip.close()
        

videos 
=
 sys.argv[1]
print(videos)
transcripts 
=
 sys.argv[2]
print(transcripts)
out_folder 
=
 sys.argv[3]
print(out_folder)

mk_subtitles(videos, transcripts, out_folder)

P.S.
Please ignore the print statemetns in Italian.

r/moviepy • • Aug 11 '24

did any body deployed moviepy based app in production how your handling image magic in production

1 Upvotes

r/moviepy • • Jul 23 '24

Write video file inside a loop

1 Upvotes

Hi All, I have come across a problem where I am processing a large video and running out of memory.

Therefore, to fix this problem, I am splitting the video into sections, writing these videos as separate mp4s to be loaded and combined together at a later point to save memory.

The new problem I am having is that Moviepy is ignoring the writevideofile inside a loop.

Does anyone have a fix / work around for this?

Thank you