开发者

How to implement video and audio merger program?

开发者 https://www.devze.com 2022-12-28 01:36 出处:网络
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 prog

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 开发者_JS百科I want to learn how to implement such a program.


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.


Look at some sort of FFMPEG wrapper in C#.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消