Skip to content
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

MoviePy error ,FFMPEG error,Broken pipe #253

Open
tom99763 opened this issue Aug 21, 2020 · 8 comments
Open

MoviePy error ,FFMPEG error,Broken pipe #253

tom99763 opened this issue Aug 21, 2020 · 8 comments

Comments

@tom99763
Copy link

I use trainsform_video and the code shows this error:
'''
OSError: [Errno 32] Broken pipe

MoviePy error: FFMPEG encountered the following error while writing file ./examples/results/foxy.mp4:

b''
'''
I search for this problem for very long time and didn't find any issue about this(most of this issue is about 'permission denied' or "Unrecognized option 'preset'.\nError splitting the argument list: Option not found\n")

I tried 'conda install -c conda-forge ffmpeg' but it still shows this error.

Did someone sucesss to fix this problem?

@Fonserbc
Copy link

Fonserbc commented Aug 21, 2020

Same error here:

  File "[mycondapath]\tf-gpu\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 136, in write_frame
    self.proc.stdin.write(img_array.tobytes())
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "transform_video.py", line 55, in <module>
    main()
  File "transform_video.py", line 51, in main
    evaluate.ffwd_video(opts.in_path, opts.out, opts.checkpoint, opts.device, opts.batch_size)
  File "[myrepopath]\fast-style-transfer\evaluate.py", line 62, in ffwd_video
    style_and_write(frame_count)
  File "[myrepopath]\fast-style-transfer\evaluate.py", line 55, in style_and_write
    video_writer.write_frame(np.clip(_preds[i], 0, 255).astype(np.uint8))
  File "[mycondapath]\tf-gpu\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 180, in write_frame
    raise IOError(error)
OSError: [Errno 32] Broken pipe

MoviePy error: FFMPEG encountered the following error while writing file out/guitar/fox.mp4:

 b''```

@tom99763
Copy link
Author

Same error here:

  File "[mycondapath]\tf-gpu\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 136, in write_frame
    self.proc.stdin.write(img_array.tobytes())
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "transform_video.py", line 55, in <module>
    main()
  File "transform_video.py", line 51, in main
    evaluate.ffwd_video(opts.in_path, opts.out, opts.checkpoint, opts.device, opts.batch_size)
  File "[myrepopath]\fast-style-transfer\evaluate.py", line 62, in ffwd_video
    style_and_write(frame_count)
  File "[myrepopath]\fast-style-transfer\evaluate.py", line 55, in style_and_write
    video_writer.write_frame(np.clip(_preds[i], 0, 255).astype(np.uint8))
  File "[mycondapath]\tf-gpu\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 180, in write_frame
    raise IOError(error)
OSError: [Errno 32] Broken pipe

MoviePy error: FFMPEG encountered the following error while writing file out/guitar/fox.mp4:

 b''```

commit d4de63f fix

@PGG-DeepAI
Copy link

PGG-DeepAI commented Sep 17, 2020

SAME ERROR HERE:
In your activated enviroment:
conda install moviepy gets version 1.0.1
pip install moviepy gets version 1.0.2 BUT enviroment doesnt detect moviepy is installed (if you try running transform_movie.py)

conda installs the package here:

C:\ProgramData\Anaconda3\pkgs\moviepy-1.0.1-py_0\site-packages

pip installs the package here:

C:\ProgramData\Anaconda3\envs\tf_gpu\Lib\site-packages (replace tf_gpu for your enviroment name)

To solve this:

if you make pip install moviepy==1.0.2 outside enviroment,
pip show moviepy will give you 1.0.2 version and DEFAULT location in: C:\ProgramData\Anaconda3\Lib\site-packages

if you make conda search moviepy it will tell you it didnt found it!

so to solve version mistmatch this we need moviepy 1.0.2 installed, and not use conda install!
Manual installation over enviroment:
If you are using conda:
1.Get files and unzip: https://github.com/Zulko/moviepy
2.python setup.py install

If you still want to use conda-enviroment you can alternatively do this:

name: tf_gpu
channels:
dependencies:
   - requests
   - bokeh>=0.10.0
   - pip:
     - "--editable=git+https://github.com/pythonforfacebook/facebook-sdk.git@8c0d34291aaafec00e02eaa71cc2a242790a0fcc#egg=facebook_sdk-master"

It's still calling pip under the covers, but you can now unify your conda and pip package specifications in a single environment.yml file.

If you wanted to update your root environment with this file, you would need to save this to a file (for example, environment.yml), then run the command: conda env update -f environment.yml

EDITED: SAME ERROR ...woots! version error is discarded also & OOM error is discarded too (nvidia-smi dmon is showing 2% mem usage when trying to transform a 500kb video, 20 secs 200px square .mp4) and still getting same error over moviepy version 1.0.2 as well as 2.0.0:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\tf_gpu\lib\site-packages\moviepy-2.0.0.dev1-py3.7.egg\moviepy\video\io\ffmpeg_writer.py", line 143, in write_frame
    self.proc.stdin.write(img_array.tobytes())
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "transform_video.py", line 55, in <module>
    main()
  File "transform_video.py", line 51, in main
    evaluate.ffwd_video(opts.in_path, opts.out, opts.checkpoint, opts.device, opts.batch_size)
  File "C:\Users\P_G\IA_Transferencia_Neural_Estilos\evaluate.py", line 62, in ffwd_video
    style_and_write(frame_count)
  File "C:\Users\P_G\IA_Transferencia_Neural_Estilos\evaluate.py", line 55, in style_and_write
    video_writer.write_frame(np.clip(_preds[i], 0, 255).astype(np.uint8))
  File "C:\ProgramData\Anaconda3\envs\tf_gpu\lib\site-packages\moviepy-2.0.0.dev1-py3.7.egg\moviepy\video\io\ffmpeg_writer.py", line 196, in write_frame
    raise IOError(error)
OSError: [Errno 32] Broken pipe

MoviePy error: FFMPEG encountered the following error while writing file video/iavid_wave1.mp4:

Working over Windows 10 through conda.

@novichiv
Copy link

Workaround: downgrading imageio-ffmpeg version from 0.4.3 to 0.2.0 resolves this issue.

@HilariousBojack
Copy link

Workaround: downgrading imageio-ffmpeg version from 0.4.3 to 0.2.0 resolves this issue.

Thanks!

@nagisakuya
Copy link

I found that version of ffmpeg also cause this error. Make sure that version of ffmpeg is 3.x.

@Hotpottttt
Copy link

Workaround: downgrading imageio-ffmpeg version from 0.4.3 to 0.2.0 resolves this issue.

why do I still got the same error after downgrading? I got almost mad

@paradiseforgithub
Copy link

paradiseforgithub commented Jun 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants