-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'NoneType' object has no attribute 'stdout' #938
Comments
I am facing the same issue |
@kamalchaturvedi15 same versions same script ? |
@Zulko Yes, same version (1.0.0) I am trying to subclip a video, and then writing into a file. It works like for 70% of the clips, but not for the rest 30%, even though all parameters I am passing are correct. Below is my code snippet new_clip_name = 'clipped.mp4' new_clip.write_videofile(new_clip_name, codec="libx264", temp_audiofile='temp-audio.m4a', remove_temp=True, audio_codec='aac') new_clip.close()` This error occurs while generating the audio file I believe, as it breaks at this point : chunk: 0%| | 0/1015 [00:00<?, ?it/s, now=None] 'NoneType' object has no attribute 'stdout'` |
I'm facing the same issue when trying to concatenate two video clips with the kwarg method="compose". it's a simple code:
gives the result as follow:
Python version: 3.5.2 Hope it helps! |
Update: Same happens when I try to use other kwargs, like in:
Not sure anymore if it is related, or my environment it's just messed up, but I guess everything is ok... |
Ok. I encountered the same error, and I was trying to concatenate videos, just like @kaiqueocanha. My debugging led me to a place that whenever I tried to incorporate the initial 30 seconds of the two videos I tested on, I got the same error. Hoping that helps in debugging. |
@mraduldubey I believe you meant to tag @kaiqueocanha. I was trying to overlay text, not concatenate multiple videos into one. |
I've got the same problem (macOS Mojave, python 3.6.x) with moviepy 1.0.1 but I've managed to work around it downgrading it to 1.0.0. Hope it helps. |
@dcaravana Thanks for letting us know. There seems to be a lot of errors and PRs about this |
I changed to v1.0.0, and it works well. |
@tburrows13 sadly none of them worked. If it can be of any help here follows the last part of the stack trace:
|
@tburrows13 I spent some time on the issue, but basically it's more complicated than expected to understand for the time I've got, with all those interactions between different parts of moviepy. Anyway the main issue seems to be how the data is read from I've also tried with two different video files. It could also be that the original code was flawed and the new version of moviepy just let the problem emerge. Hope it helps! |
Changed to v1.0.0 and it gives no error. Thanks guys |
Same problem on OSX high sierra, python 3.6. Downgrade to 1.0.0 fixes issue. |
This one surprisingly working solution to the issue. Thanks @dcaravana ✌. It's really under my estimation to think of downgrading can be a solution! |
Would those of you for whom downgrading to moviepy 1.0.0 fixed the issue mind helping us out a little bit? The only commit that I can see would cause this to happen is 350571a Would you mind upgrading to v1.0.1, finding the files referenced in the above commit and undo the changes it references and report back. I’m pretty sure that should fix your problem but @dcaravana said that it didn’t help him... |
@tburrows13 I've encountered the same issue, downgrading "solved" it so I tried reverting the indicated code from 350571a: this didn't work out. Looked a bit further at the changes between v1.0.0 and v1.0.1 I think I narrowed it down to these lines coming from #931, commit: Overdrivr@f4a5625#diff-2b5c494ba3a48ff925aca6438d9847a7R92-R94 I don't (and didn't try to) understand all internals, but it would make sense as an AudioClip.audio_normalize() triggered the issue for me and AudioClip is involved in all posted stack traces in this ticket. Upgrading to v1.0.1 and just commenting these lines fixed the issue (for me). Hope this helps! Keep up the great work! |
pip install moviepy==1.0.0 bug fixed! |
@sebasi Hi, can you specify which lines exactly that you commented out? I'm having trouble finding the ones you mentioned. |
@Ethan0429 So here are the steps:
And you should be done. Could you please confirm if this works for you? PS: I've put it quite detailed to potentially assist other people. :) |
@sebasi Wow thanks! This did seem to fix the issue, however this only worked once I downgraded to from Python 8 to Python 7, and even then I'm not positive whether or not it was changing the script or downgrading python. This still does not fix the main issue of |
Not sure if I understood you correctly, but I meant that you have to adjust the path to your python version. |
@sebasi Would you mind telling me what exact version of python you are using? |
This fixed it for me. Tnaks |
@Zulko please remove the destructor in the last line, as this works perfectly! |
Thank you @sebasi it worked for me perfectly. |
This works for me on macOS 10.14 with moviepy 1.0.1
|
Hey all! This is obviously a problem that needs sorting. It has built up over time with people making quick fixes to small parts of the code without taking into consideration that the same methods should be applied consistently to all of moviepy, and also that different operating systems handle resources differently. Around eastertime I intend to have a proper look at it across different OSs and hopefully come up with a solution that works for everyone. |
It looks like i have the same problem and the fix you listed did not fix it. Attaching my stack trace.
|
I confirm @sebasi fix works for me on moviepy version 1.0.1. |
When clips of different lengths are composited, the composite clip has the duration of the longest clip, assuming all clips have a duration (at the end of the video, only the last clip is playing). |
@Zulko Yes, you are correct. Sorry, I was wrong. I deleted my post. Different length clips can be composited without issue. |
I think i am getting the same issue with CompositeAudioClip that is made out of a concatenate_audioclips object and video audio track: music_background = concatenate_audioclips(bg_music_playlist)
composited_audio = CompositeAudioClip([final_video.audio, music_background]).set_duration(speech_audio_duration) last bits of error message:
Reverting to version 1.0.0 have fixed things for me.. |
same here, annoying error. |
Same issue. Python 3.7. None of the solutions above worked. After trying multiple times, I can confirm that the solution also works for 1.0.2.
However I am getting "OSError: [WinError 6] The handle is invalid" errors. I added "clip.reader.close()", but this did not solve the problem. After a couple of runs, the error would occur again, and I had to restart my IDE. I suppose this is an unrelated issue. |
I have the same issue when using write_videofile. |
The python what you changed maybe not the python when you run. Or the plugin you changed is not the plugin when you run. |
Fixed in #1185 and version 1.0.3. Thank you everyone for your patience! Use `pip install moviepy --upgrade`` to update to the latest version. |
unfortunately I'm still facing the issue with the new version :(. I'm attaching the error trace:
|
I was having the same problem as in here: #1185, "closing my files too early". luckily I've found the issue already solved (thx tburrows13 for your overall assistance) |
This worked for me, thank you!!!! |
This was working absolutely fine with python 3.10.9 and moviepy 1.0.3 a few days back. Something has changed, and the error is back. I'm stitching a few video clips together, adding some background music and making a final clip. processing file: E:\To be backed up\2019.02 Oxford\PANA5378.MP4 |
Notice
If you have arrived here from google, you will probably find that updating your moviepy version to v1.0.3 or higher will fix the issue (
pip install moviepy --upgrade
). See #1185.Expected Behavior
Expected to get an edited version of the inputted video.
Actual Behavior
Produces this error:
Steps to Reproduce the Problem
Run the following code:
Specifications
The text was updated successfully, but these errors were encountered: