mixing two audio track using mlt - audio

Am using mlt framework for editing audio and video track. Now I have a use case like, have a audio track where one person is singing song without music and have another track where I have music for the song. Now I want to mix this, I mean with the song I want to add the music track. Please suggest me which melt command should I use?
Thanks
Sougata

if You have two audio clip in mp3 or other format try this:
melt avformat:a.mp3 out=400 -move in=0 out=400 -track avformat:b.mp3 out=400 -transition mix in=0 out=400 a_track=0 b_track=1

Related

Vaadin Audio seek position

I would like some how to seek position of Audio component in Vaadin, or to read current time from Audio player. Is this possible to do somehow?
These features are not included in Audio component. But luckily there is add-on, more sophisticated audio player, which has the features you are looking for.
https://vaadin.com/directory/component/audiovideo
For even more complex use cases of multiple audio streams there exists also
https://vaadin.com/directory/component/audioplayer-add-on

How can I access the audio output coming from a movie playing in processing?

I am working on a film analysis program, which retrieves data in realtime from a movie, that is playing in the same sketch. For analysing the sound I tried the minim library, but I can't figure out, how to get the audio signal from the movie. All I could do was accessing an audio file, I was loading into the sketch manually, or the line-in through the mic.
Thanks a lot!
Although GStreamer (used by the processing-video library) has access to audio, the processing-video library itself doesn't expose that at the moment.
You will need to use workarounds at the moment:
Extract audio from your movie and load straight into minim. (you can trigger audio playback at the same time as movie playback if you need to)
or use a tool to use system audio output as an input (minim get line in). On OSX you can use Soundflower. Another option is JACK and it's patch interface.

How to attach new vocal in any video without removing old vocals using ffmpeg libraby

I want to create a video that have new vocals but old background music. Is it possible using ffmpeg library?
I do not have very much idea about how to do it but I assume that any video contains two layers of audio.
Background music and
Vocals or dialogues
I want to remove original vocals of video and add new vocals but I do not want to disturb the original background music of video.
Is there anyone who can help me for it. I am using ffmpeg library for it.
One way I have done this in the past is as follows:
extract audio from video using ffmpeg
merge extracted audio with the new video you want to add using sox (http://sox.sourceforge.net/sox.html)
add the merged audio track back into the video using ffmpeg
This is likely not the most efficient way to do this, but it did work reliably.

Play video with this audio in AVMutableCompositionTrack

I have a 2 AVMutableCompositionTrack objects. 1st contains video (with his sound) and 2nd contains some audio, for example mp3. I want to play both of them simultaneously. Everything is OK with the sound of second object. Unfortunately I can't hear the sound of video. Why ?
I can play above mentioned track in the different players. In this case everything is OK. But it is needed to play both items in the same player by using AVMutableCompositionTrack mechanizm (for exporting feature).

Multiple audio streams in a MPEG-4 file

The MPEG-4 file format allows multiple streams to be present in a file.
This is useful for videos containing audio in multiple languages. In the case of such a video, the audio streams are synchronized to the video.
Is it possible to create a MPEG-4 file the contains desynchronized audio streams, i.e. the audio track are played on after another?
I want to design a MPEG-4 file that contains a music album, so it is crucial that the tracks are played one after another by media players such as VLC.
When I use MP4Box (from the GPAC framework) the resulting file is recognised by VLC as having synchronized audio streams. Which box of the MPEG-4 file format is responsible for this? Or how can I tell VLC that these audio streams are not synchronized?
Thanks in advance!
I can think of two ways you could do that, and both would be somewhat problematic.
You could concatenate all the audio streams into one audio track in the MP4 file. This won't be ideal, for some obvious reasons. For one thing, it's not exactly what you were asking for.
You could also just store the tracks as synchronized audio streams, but set the timing information in such a way that the first sample of the second track won't start playing until the first track finished playing, etc.
I'm not aware of any tools that can do this, but the file format will support such a scheme. Since it's an unusual way to store audio in an MP4 file, I would expect players to have problems with this, too.
Concatenating all streams would work and the individual tracks can be addressed by adding chapters. It works at least with VLC.
MP4Box -new -cat track1.m4a -cat track2.m4a -chap chapters.txt album.m4a
The chapters.txt would look something like this:
CHAPTER1=00:00:00.00
CHAPTER1NAME=Track 1
CHAPTER2=00:03:40.00
CHAPTER2NAME=Track 2
But this is only a hack.
The solution I'm looking for should preserve the tracks as individual streams.

Resources