ibrahimyilmaz
ibrahimyilmaz

Reputation: 18929

How to implement video and audio merger program?

I want to make a program which takes video and audio and merges them. Video type or audio type is not important for me. How can I make this? Does any library exist for this? I know there are many programs about this topic but I want to learn how to implement such a program.

Upvotes: 1

Views: 2689

Answers (3)

Sid Heroor
Sid Heroor

Reputation: 653

An easy way to multiplex audio and video on linux is to use gstreamer. Here's a A/V pipeline that you can create using gst-launch on a shell prompt.

filesrc location=file1.vid ! queue ! mux. filesrc location=file2.aud ! queue ! mux. avimux name=mux ! filesink location=output.avi

Replace file1.vid with the name of your encoded video file and file2.aud with the name of your encoded audio file. output.avi is the container file that you need.

Upvotes: 0

Stu Thompson
Stu Thompson

Reputation: 38908

The technical term for what you are trying to do is 'multiplexing', and commonly referred to as 'muxing'.

FFmpeg is a multiplatform command line tool that does this, and arguable the industry standard. Many projects wrap FFmpeg into libraries and GUIs.

FFmpeg is also open source, so you can download the code and see how they have done it. That siad, it is very big and complex.

If you are interested in the actual mechanics of muxing separate audio and video files together into a destination file, then you will need to learn much about container formats and Codecs.

Upvotes: 3

Strong Like Bull
Strong Like Bull

Reputation: 11317

Look at some sort of FFMPEG wrapper in C#.

Upvotes: 0

Related Questions