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

Keep audio from source file #1

Closed
mifi opened this issue Apr 22, 2020 · 9 comments
Closed

Keep audio from source file #1

mifi opened this issue Apr 22, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@mifi
Copy link
Owner

mifi commented Apr 22, 2020

No description provided.

@mifi mifi added the enhancement New feature or request label Apr 22, 2020
@chapmanjacobd
Copy link
Contributor

chapmanjacobd commented Apr 27, 2020

maybe the default can be to take only video from the source file but if someone wanted the audio from the clips by default then they could do this:

edit: I made some improvements on this interface in: #30

@mifi
Copy link
Owner Author

mifi commented Apr 28, 2020

Yea, something like that. I just need to implement concatenation (and maybe fading) between videos audio clips too. It's not super trivial but it should be doable.

@chapmanjacobd
Copy link
Contributor

I was just playing around with concat last night. not sure how helpful this is:

https://gist.github.com/chapmanjacobd/7b6849c68dc78eb7679c7c639c64b9ae

a fading option would be awesome!

@mifi
Copy link
Owner Author

mifi commented Apr 28, 2020

Yea something like that. Problem is that if there is 1 too many video frames or one missing, or if audio or video duration is wrong, then audio will go out of sync, especially after many clips.

@chapmanjacobd
Copy link
Contributor

chapmanjacobd commented Apr 28, 2020

hmmmm what if we render audio and video under separate processes and then merge them together afterword? I think this is how youtube-dl works

edit: maybe that doesn't solve the issue exactly :/ I'm not really sure what options we have here

@mifi
Copy link
Owner Author

mifi commented May 2, 2020

Yes we can use ffmpeg concat and output to separate files. Just need to figure out what to do with audio in transitions. I think cross-fade is the right way. Basically need to implement a similar loop to the audio data as the video loop. but instead of gl-transition, need to use a simple mathematical operation between in and out audio.

As a simple first version we could just concat all audio files (but need to cut off transition.duration seconds off of the end of every audio clip), and need to provide silent audio when video clip has no audio, or there is no video layers in a clip.

@chapmanjacobd
Copy link
Contributor

chapmanjacobd commented May 2, 2020

https://stackoverflow.com/questions/32155105/crossfading-html5-audio-logic

we can actually do audio crossfade inside of ffmpeg

https://stackoverflow.com/questions/47437050/crossfading-between-two-audio-files-with-ffmpeg

also check out: #30 (comment) I updated this interface to make more sense. let me know what you think

@SurinameClubcard
Copy link

I would love to see this feature added. I just merged a couple of videos only to find out afterwards that the original audio of the clips was removed. Had to use OpenShot again to do the merging. Declarative is sooooo much nicer... :-)

@mifi
Copy link
Owner Author

mifi commented Sep 6, 2020

This is now implemented, but without cross fade yet. 0.5.0
You must use the flag --keep-source-audio or keepSourceAudio: true. See readme.

@mifi mifi closed this as completed Sep 6, 2020
mifi pushed a commit that referenced this issue Mar 4, 2023
@0xjones 0xjones mentioned this issue Jan 15, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants