-
Notifications
You must be signed in to change notification settings - Fork 885
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
Audio Support #26
Comments
Sorry for the delayed reply. I'll take a look at this and see what I can figure out. |
Okay, streams in The
Or with fluent style:
Actually though, even the simplest In order to get audio here, we'd have to do the
I think it's annoying to have to explicitly put the
This diverges from And for examples that use audio filters like the one you listed, it could be expressed as follows:
... or fluently:
Graphically, it looks like this: Nice and simple. That way we get all of the power of ffmpeg but none of the headache of having to keep track of separate streams, at least for simple examples. And if someone really wants the default ffmpeg behavior of dropping audio streams, all they'd have to do is put So the plan is.. I can't work on it tonight but will hopefully get step 1 done in the next day or two. Step 2 will take a bit longer, but I want to get it on the roadmap to keep |
Thanks for reporting this, @RGuilfoyle! |
And of course, all of the filters you listed should soon become built-in operators in
|
Thanks for the quick response @kkroening. |
I still haven't had a chance to work on this yet. Is it holding you up, @RGuilfoyle? |
This was for an API demo I was building, nothing urgent! |
I like the API proposal. I think the Every stream should have As I'm going to need this, I'll try to implement it and send a PR that behaves like I said. |
Yeah, I just wish |
In my opinion it shouldn't be this library's duty to fix ffmpeg. I think it should only provide means to make it easier, without doing it by default. |
Valid point. Hm, and that's probably true of the automatic |
AttributeError: module 'ffmpeg' has no attribute 'map_audio' how to ? |
|
.filter_('atempo', '1.2')
|
how to map audio to video ? |
I tried both versions
|
If I want to process the frame in NumPy and then map the raw audio to the final video, could you please share a possible way for this? |
How to copy audio with the fluent interface? I still haven't figured it out. As soon as I add a filter, acodec='copy', no longer works. I think because it adds a map that excludes it. |
I just ran into this same issue today -- my complex filter strips audio. This was my original complex filter:
I read through this comment and tried adding
but I get the error, " .map_audio(vid.audio()) Any idea how to address this? |
I have used filter_complex on an video as below, but the audio stream is lost.
I would like to be able to adjust the audio and video playback rate, suggestions?
import ffmpeg
stream = ffmpeg.input('input.mp4')
stream = ffmpeg.filter_(stream, 'fps', fps=20)
stream = ffmpeg.filter_(stream, 'crop', 'iw*.63:ih*.63:iw-(iw*.64):ih-(ih*.833)')
stream = ffmpeg.filter_(stream, 'setpts', '0.8333334*PTS')
stream = ffmpeg.output(stream, 'output.mp4')
ffmpeg.run(stream)
With ffmpeg I can mux back in the audio (also with a speedup);
-filter_complex 'crop=iw*.63:ih*.63:iw-(iw*.64):ih-(ih*.833)[vid];[vid]fps=20[vid2];[vid2]setpts=0.8333334*PTS[v];[0:a]atempo=1.2[a]' -map '[v]' -map '[a]'
The text was updated successfully, but these errors were encountered: