RedditVideoMakerBot icon indicating copy to clipboard operation
RedditVideoMakerBot copied to clipboard

Moviepy - command returned error

Open 2StrokeDiesel opened this issue 4 years ago • 48 comments

After getting the mp3 files and screenshots the program runs moviepy but returnes the follow, also everything up until that point works

Moviepy - Command returned an error Traceback (most recent call last): File "C:\Users\Pcname\Downloads\RedditVideoMakerBot-master\main.py", line 22, in chop_background_video(length) File "C:\Users\Pcname\Downloads\RedditVideoMakerBot-master\video_creation\background.py", line 45, in chop_background_video ffmpeg_extract_subclip( File "C:\Users\Pcname\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\moviepy\video\io\ffmpeg_tools.py", line 41, in ffmpeg_extract_subclip subprocess_call(cmd) File "C:\Users\Pcname\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\moviepy\tools.py", line 54, in subprocess_call raise IOError(err.decode('utf8')) OSError: ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9.2.1 (GCC) 20200122 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'assets/mp4/background.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf59.16.100 Duration: 01:20:13.08, start: 0.000000, bitrate: 10571 kb/s Stream #0:0(eng): Video: vp9 (Profile 0) (vp09 / 0x39307076), yuv420p(tv, bt709), 2560x1440, 10419 kb/s, SAR 1:1 DAR 16:9, 59.90 fps, 59.94 tbr, 16k tbn, 16k tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(eng): Audio: opus (Opus / 0x7375704F), 48000 Hz, stereo, fltp, 137 kb/s (default) Metadata: handler_name : SoundHandler [mp4 @ 00000165f11efec0] track 1: codec frame size is not set [mp4 @ 00000165f11efec0] opus in MP4 support is experimental, add '-strict -2' if you want to use it. Could not write header for output file #0 (incorrect codec parameters ?): Experimental feature Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Last message repeated 1 times

If you need anymore information please comment

2StrokeDiesel avatar Jun 02 '22 22:06 2StrokeDiesel

This happens in both powershell and command prompt

2StrokeDiesel avatar Jun 02 '22 22:06 2StrokeDiesel

then run pip install moviepy its a missing module so use pip to install it

p1x3lll avatar Jun 02 '22 22:06 p1x3lll

i meant reinstall it

p1x3lll avatar Jun 02 '22 22:06 p1x3lll

according to pip after running pip install moviepy everything is already satisfied but i re ran the program anyway with the same issue being described

2StrokeDiesel avatar Jun 02 '22 22:06 2StrokeDiesel

then run pip install moviepy its a missing module so use pip to install it

is there anything else I could do?

2StrokeDiesel avatar Jun 02 '22 22:06 2StrokeDiesel

is there anything else I could do?

I had this issue and it's a moviepy problem. Since they don't really want to fix it for some reason, I'm going to fork it and fix it myself pretty soon.

reoccurcat avatar Jun 02 '22 23:06 reoccurcat

I'm also getting the same issue actually, but on my linux machine (not apt).

I had this issue and it's a moviepy problem. Since they don't really want to fix it for some reason, I'm going to fork it and fix it myself pretty soon.

What is exactly going on here? do you mind sharing what's going on with it?

BitterSweetcandyshop avatar Jun 02 '22 23:06 BitterSweetcandyshop

I'm having the same issue. If it's a moviepy problem, wouldn't this be broken for everyone then?

Nalyd217 avatar Jun 02 '22 23:06 Nalyd217

Honestly, I have no idea, but I'm still going to try to make a fix. ~~Maybe a newer version of moviepy would fix it as well, I'll mess around with it.~~ Nevermind, that's the latest version. No idea why they won't accept the solution though...

reoccurcat avatar Jun 02 '22 23:06 reoccurcat

I dont understand how but I even went through the site-packages deleted every moviepy folder i found went to re install it via pip and it says the files are still there and that it the same error even after opening another instance

2StrokeDiesel avatar Jun 02 '22 23:06 2StrokeDiesel

I wonder if I downgrade it to 1.02 if it'll work

BitterSweetcandyshop avatar Jun 02 '22 23:06 BitterSweetcandyshop

is there anything else I could do?

I had this issue and it's a moviepy problem. Since they don't really want to fix it for some reason, I'm going to fork it and fix it myself pretty soon.

will this be mixed in this program if and when you are able to fork it?

2StrokeDiesel avatar Jun 02 '22 23:06 2StrokeDiesel

I wonder if I downgrade it to 1.02 if it'll work

Probably not, as the issue just seems prominent in all of the releases due to (a) missing flag(s).

will this be mixed in this program if and when you are able to fork it?

Honestly I could try to do that, but the issue is that I don't know the license moviepy uses, I'll have to check. (Edit) I just checked, they use an MIT license, so I shouldn't have any issues there.

reoccurcat avatar Jun 02 '22 23:06 reoccurcat

I suppose an alternative would be to do saubprocess.run(["ffmpeg"]) or find a fix somewhere else and paste it in stack overflow style lol

BitterSweetcandyshop avatar Jun 02 '22 23:06 BitterSweetcandyshop

So for anyone with this new version it will not work, or was this a issue in a previous version of the redditvideomaker, I got this to work before on pytube but ran into it stopping at 79% Also not going to be able to test anything as i am not going to be on tonight.

2StrokeDiesel avatar Jun 02 '22 23:06 2StrokeDiesel

There's enough complicated code and variables that go I don't even know where that I'll just clone the old repo and make changes from there 😅

reoccurcat avatar Jun 02 '22 23:06 reoccurcat

what was different actually with the old repo to where it worked? it's an issue with moviepy what did this repo do differently that made it work??

BitterSweetcandyshop avatar Jun 02 '22 23:06 BitterSweetcandyshop

So for anyone with this new version it will not work, or was this a issue in a previous version of the redditvideomaker, I got this to work before on pytube but ran into it stopping at 79%

I'm suspecting that it's something to do with yt-dlp (which I added to replace pytube) but pytube wouldn't work at all for me

reoccurcat avatar Jun 02 '22 23:06 reoccurcat

what was different actually with the old repo to where it worked? it's an issue with moviepy what did this repo do differently that made it work??

I simply added the flags that would make it work (-strict -2) into the function.

reoccurcat avatar Jun 02 '22 23:06 reoccurcat

I'm suspecting that it's something to do with yt-dlp (which I added to replace pytube) but pytube wouldn't work at all for me it stopped at 79% and when opening the mp4 it played it but with no visual file so only mp3 i beleive.

2StrokeDiesel avatar Jun 02 '22 23:06 2StrokeDiesel