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

version 0.2.3.2 TypeError: must be str, not bytes #650

Closed
Goddard opened this issue Oct 4, 2017 · 3 comments
Closed

version 0.2.3.2 TypeError: must be str, not bytes #650

Goddard opened this issue Oct 4, 2017 · 3 comments
Labels
lib-misc Issues pertaining to misc. 3rd-party libraries.

Comments

@Goddard
Copy link
Contributor

Goddard commented Oct 4, 2017

~/anaconda3/lib/python3.6/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py in write_frames(self, frames_array)
     89             error = (str(err)+ ("\n\nMoviePy error: FFMPEG encountered "
     90                      "the following error while writing file %s:"%self.filename
---> 91                      + "\n\n"+ffmpeg_error))
     92 
     93             if b"Unknown encoder" in ffmpeg_error:

TypeError: must be str, not bytes

ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-15)
  configuration: --prefix=/home/irenicus/anaconda3 --disable-doc --enable-shared --enable-static --extra-cflags='-Wall -g -m64 -pipe -O3 -march=x86-64 -fPIC -I/home/irenicus/anaconda3/include' --extra-cxxflags='=-Wall -g -m64 -pipe -O3 -march=x86-64 -fPIC' --extra-libs='-L/home/irenicus/anaconda3/lib -lz' --enable-pic --enable-version3 --enable-hardcoded-tables --enable-avresample
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
Hyper fast Audio and Video encoder
@deekerno
Copy link

I'm running into the same issue.

Traceback (most recent call last):
  File "/Users/adcrn/homebrew/lib/python3.6/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 84, in write_frames
    self.proc.stdin.write(frames_array.tobytes())
BrokenPipeError: [Errno 32] Broken pipe

'''During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 46, in <module>
    audio_op.audio_extraction(p.filename, p.audio_dest)
  File "/Users/adcrn/projects/transcript-helper/stuff/audio_op.py", line 22, in audio_extraction
    progress_bar=False)
  File "<decorator-gen-73>", line 2, in write_audiofile
  File "/Users/adcrn/homebrew/lib/python3.6/site-packages/moviepy/decorators.py", line 54, in requires_duration
    return f(clip, *a, **k)
  File "/Users/adcrn/homebrew/lib/python3.6/site-packages/moviepy/audio/AudioClip.py", line 208, in write_audiofile
    progress_bar=progress_bar)
  File "<decorator-gen-70>", line 2, in ffmpeg_audiowrite
  File "/Users/adcrn/homebrew/lib/python3.6/site-packages/moviepy/decorators.py", line 54, in requires_duration
    return f(clip, *a, **k)
  File "/Users/adcrn/homebrew/lib/python3.6/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 162, in ffmpeg_audiowrite
    writer.write_frames(chunk)
  File "/Users/adcrn/homebrew/lib/python3.6/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 91, in write_frames
    + "\n\n"+ffmpeg_error))
TypeError: must be str, not bytes

@Goddard
Copy link
Contributor Author

Goddard commented Nov 22, 2017

I think this project is abandoned.

I just switched to opencv.

@keikoro keikoro added the lib-misc Issues pertaining to misc. 3rd-party libraries. label Nov 25, 2017
@tburrows13
Copy link
Collaborator

tburrows13 commented Feb 15, 2018

I realise this is quite late, but what happens if you put a str() round ffmpeg_error? So it will look like "\n\n"+str(ffmpeg_error))). Presumably you'll get a more helpful error now.
EDIT: In fact, this was fixed in #565. The fix hasn't been pushed to PyPI yet, but I intend to push a new release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib-misc Issues pertaining to misc. 3rd-party libraries.
Projects
None yet
Development

No branches or pull requests

4 participants