write_videofile() appears fundamentally broken
See original GitHub issueMoviepy function write_videofile()
works with static filename parameters, (i.e. "this_is_my_file.mp4"
) but does not work as intended when variables are passed into the filename parameter (i.e. my_variable = "a dynamic filename"
). The resulting video possess audio, but is always frozen on the first frame.
Expected Behavior
production of video files with dynamic file names.
Actual Behavior
produces a video with the audio and the correct filename, but video is frozen on the first frame.
Steps to Reproduce the Problem
my_clip.write_videofile("meaty_chungus.mp4") #works
meaty_chungus = "meaty_chungus"
my_clip.write_videofile(meaty_chungus + ".mp4") #produces a video with the audio and the correct filename, but video is frozen on the first frame.
Specifications
- Python Version: 3.x
- Moviepy Version: most recent
- Platform Name: Windows
- Platform Version: 10
Issue Analytics
- State:
- Created 4 years ago
- Comments:21
Top Results From Across the Web
movie-py/Lobby - Gitter
Hi guys! I'm concatenating a list of video objects together then writing them with write_videofile, weirdly enough the first time I write the...
Read more >MoviePy and python3 | Scientific logbook - Laurent Perrinet
... was using python 2, but seems to be broken when using python 3: (The video generated by animation.write_videofile("circles.mp4", fps=20).
Read more >Moviepy write_videofile works the second time but not the first?
It seems there is no set point where it breaks, each time I write it for the first time it typically breaks at...
Read more >moviepy - Bountysource
They cause Errno 32 Broken Pipe whenever the packaged app calls VideoClip.write_videofile. The code which calls tdqm is in Clip.iter_frames, ...
Read more >Lightweight python motion detection - Page 9
I notice this all looks a lot like the code in the thread over at ... save circular buffer before motion event write_video(stream)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m going to close this unless anyone can provide anymore examples that should fail.
@monkfacedmonkey This code can never work because you are overwriting the source file whilst you are reading from it. When I run that code, I get lots of warning telling me that it is trying to read bytes, but can’t so it is using the last valid frames instead. If you run it on a video that is moving throughout, you’ll see that it works for the 1st second or so, which is the data that ffmpeg has cached. At that point it fails to read more and freezes on the frame for the rest of it.
Maybe it should give a better warning or error completely somewhere in the process, but there are no bugs there that I can see.