How to implement video and audio merger program?

蹲街弑〆低调 提交于 2019-12-11 06:55:34

问题


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.


回答1:


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.




回答2:


Look at some sort of FFMPEG wrapper in C#.




回答3:


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.



来源:https://stackoverflow.com/questions/2694793/how-to-implement-video-and-audio-merger-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!