-
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
Problem with writing audio #51
Comments
The script you provided worked OK on my computer with the file you provided, using either Python2 or Python3.2.3. What Python version are you using ? That's may be nasty to debug, because apparently on your computer everything goes smoothly until the last step: the temporary audio file seems to be created correctly, but then ffmpeg can't find it. One possible explanation is that, for some reason, the temporary audio file is removed before ffmpeg can merge it with the video. This used to happen in Python3 (the piping works differently in Python3) but I believe it is now fixed. One quick fix that could work would be to not delete the temporary files at all like this:
Could you try this and describe what happens ? Like, did it work, and if not, is there at least a temporary .ogg audio file ? |
First, thanks for taking the time to help. I'm using python 2.7.7_1. The ffmpeg output reports the temp files as having been successfully created, but I can't find the .ogg file. I do, however, see the temp MP4 file. |
It should be created in the same folder as your script. Have you tried with |
Yes, with remove_temp=False the .MP4 temp file is still there, but not the On Mon, Jun 23, 2014 at 11:33 AM, Zulko notifications@github.com wrote:
Reid Oda |
Really strange. Here are a few things I can think of. Ask for logfiles when writing the video file:
This should create a file named
If this generates a log file, paste it for me. In any case, could you also try changing the output codec to mp3 ? Apparently .ogg format gives trouble to a lot of people. To do so, you just write
Tell me if this works. |
It does allow the compilation to occur, but there is no sound. This, at least, shows me that the problem lies with ffmpeg and not moviepy. Thanks for the help! |
Here is that log file. I can see that it can't find the libvorbis audio codec. Homebrew reports that I have libvorbis-1.3.4 installed. I know that this is an ffmpeg thing, but do you know if there something I need to do to make sure it finds the library?
|
On the videogrep page they say to install ffmpeg with
But you should give up with libvorbis and try to understand why it doesn't even work with mp3, that would be simpler. You said there is no sound: with what software are you playing it ? Could you try playing it with VLC and see if there is still no sound ? |
Yes there is sound in VLC and if I play it in the browser. However, no On Wed, Jun 25, 2014 at 2:35 PM, Zulko notifications@github.com wrote:
Reid Oda |
Ok. To me this sounds more like a FFMPEG/Quicktime issue. On linux there is sound with all the most popular video players. Does the build line
allow you to make .ogg soundtracks ? |
It does, however, when played in quicktime they are also silent. Thanks for On Thu, Jun 26, 2014 at 10:55 PM, Zulko notifications@github.com wrote:
Reid Oda |
@brownerthanu I changed the default encoding to mp3, now it should work properly. If you have the occasion to try again, tell me if it works, so that I can close the issue |
Hi Zulko. As it turns out it was not due to ogg vs mp3. I think there is a bug in ffmpeg...at least there seems to be. One of my friends is experiencing the same problem. No amount of building from source with fancy options fixed it for me, so my solution was to write to .mov and then use ffmpeg to copy to .mp4. That works. |
This worked for me to get the file to play in Quicktime/iMovie: clip.write_videofile(out_path,
codec='libx264',
audio_codec='aac',
temp_audiofile='temp-audio.m4a',
remove_temp=True
) |
thanks jarib. you save my life :) |
thanks jarib! |
+1 Thanks! I was super confused about why I had no audio in Quicktime (and therefore QuickLook). |
ta |
@jarib this was very helpful. Saved so much effort! Thank you! |
@jarib THANK YOU KING 👑 |
@jarib Thanks a lot. Forever grateful. |
Hey there. I'm experiencing a problem when writing audio. If I call
.to_videofile
withaudio=False
, then there is no problem. My videopy version number is 0.2.1.8.02.The video I'm working with is here:
https://www.dropbox.com/s/iepmbyieferjbay/test.MP4
The code is here:
There error message is:
I've also tried explicitly specifying the codec as 'mpeg4'. I'm not sure if that makes any difference, but the result is the same.
The text was updated successfully, but these errors were encountered: