-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use audio_codec option even if audio is given as filename #1906
base: master
Are you sure you want to change the base?
Use audio_codec option even if audio is given as filename #1906
Conversation
Thanks for your PR. I think I might nab just the black formatting fixes for now to prevent our checks from failing (even though they don't even fail consistently...). |
@@ -81,6 +84,7 @@ def __init__( | |||
fps, | |||
codec="libx264", | |||
audiofile=None, | |||
audio_codec=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not default to "copy" directly here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your question! The default value of audio_codec in VideoClip.write_videofile
is None
, so I also adapted FFMPEG_VideoWriter
to that.
moviepy/moviepy/video/VideoClip.py
Line 209 in e7cbfd3
audio_codec=None, |
This pull request intends that in VideoClip.write_videofile
, if a filename is given for the audio argument and a codec name is given for audio_codec
, then it will be encoded according to that codec, but If audio_codec=None
, I thought it would be better to have it copy
as before.
moviepy.video.VideoClip.write_videofile
ignoresaudio_codec
whenaudio
is a file name. I have fixed it in this PR.moviepy.video.VideoClip.write_videofile("output.mp4", audio="input.wav", fps=60, audio_codec="aac")
have runffmpeg
with-acodec copy
. With this PR, it will run the command with-acodec aac
.tests/