媒体播放器从头开始 [英] Media player from scratch

查看:111
本文介绍了媒体播放器从头开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道如何从头开始编写多媒体软件,最好是音频和视频。

我的意思是不使用naudio或irrklang等图书馆。我想自己写这些图书馆

能否请您按顺序向我建议先学习什么。书籍或文章也会有所帮助(首选免费)。



谢谢

解决方案

首先,连续顺序毫无意义。这只是一个实际和战术考虑的问题。此外,我们不了解您目前的知识水平和技能。您可以在某些块中并行执行所有操作,并考虑一些依赖关系。但是学习这些依赖关系将成为一般学习的一部分。



您需要学习媒体文件容器和编解码器的概念:

http://en.wikipedia.org/wiki/Container_format_%28digital%29 [ ^ ],

http://en.wikipedia.org/wiki/Comparison_of_container_formats [ ^ ],

http://en.wikipedia.org/wiki/Codec [ ^ ],

http://en.wikipedia.org/wiki/List_of_codecs [ ^ ]。



您可以使用不同的方法来实现编解码器并支持不同的容器。您可以了解编解码器如何在您选择的系统中注册。请注意,您甚至没有报告要处理的系统(严格来说,C#并不是100%假设Windows)。作为替代方案,您可以实现自己的系统,该系统不依赖于编解码器注册或实现您自己的注册或插件架构。这是FFMpeg,libavcodec或VLC等产品的方式;例如:

http://en.wikipedia.org/wiki/Ffmpeg [ ^ ],

http://ffmpeg.org/ [ ^ ],

http://en.wikipedia.org/wiki/Libavcodec [ ^ ],

http://libav.org/ [ ^ ],

http://en.wikipedia.org/wiki / VLC_media_player [ ^ ],

https://videolan.org/vlc/ [ ^ ]。



上面引用的产品是开源的,所以你可以看看在他们看看有什么参与。它还可以让你知道你需要学习什么。



所以,当你知道上面提到的基础知识时,你需要选择一些容器和公开可用的压缩标准,您需要学习它们并尝试至少在解析级别上实现。到这个时候,你应该对这项工作的难易程度有一个很好的了解。



同时,你需要学习音频和视频生成子系统对于您想要处理的操作系统。对于Windows,它还将包括DirectX。如果要使用WPF for Windows,则可能需要学习WPF。您需要决定使用哪些OP API并开发一些工作原型,以确保您具有足够的性能和可靠性。在Windows上,您需要学习MMSystem,特别是多媒体计时器。



我甚至没有计算通用编程主题,例如UI开发使用一些UI库和线程。



除此之外,你还应该记住玩家可以从网络播放流媒体。因此,最终您将需要使用流媒体协议和大量的网络:

http:// en。 wikipedia.org/wiki/Media_streaming [ ^ ]。



这是非常初步的,可能不完整的计划。您可能需要在其中添加更多细节,这只有在您完成大部分学习的情况下才有可能。好吧,一如既往...



祝你好运,

-SA


< blockquote>这是关于.NET的VLC组件绑定的更新有用信息:

http:// sourceforge。 net / projects / libvlcnet / [ ^ ],

https://wiki.videolan.org/C_Sharp/ [ ^ ],

https://wiki.videolan.org/.Net_Interface_to_VLC/ [ ^ ]。



值得注意的是,您可以找到使用WPF和系统组件的材料.Windows.Forms



-SA


Hi
I would like to know how to write multimedia software from scratch preferably audio and video.
I mean without using libraies such as naudio or irrklang. I want to write those libraries myself
Can you please advice me as to what to learn first in a sequential order. Books or articles would also help (free would be preferred).

Thanks

解决方案

First of all, "sequential order" makes no sense at all. This is just a matter of practical and tactical considerations. Besides, we have no idea on your current knowledge level and skills. You can do it all in parallel, in certain chunks, taking into account some dependencies. But learning those dependencies will be a part of general learning.

You need to learn the concepts of media file containers and codecs:
http://en.wikipedia.org/wiki/Container_format_%28digital%29[^],
http://en.wikipedia.org/wiki/Comparison_of_container_formats[^],
http://en.wikipedia.org/wiki/Codec[^],
http://en.wikipedia.org/wiki/List_of_codecs[^].

You can use different approaches to implementation of codecs and support for different containers. You can learn how codecs are registered in the system of your choice. Note that you did not even report the system you want to deal with (strictly speaking, C# does not 100% assume Windows). As an alternative, you can implement the system of your own which does not depend on the codec registration or implements your own registration or plug-in architecture. This is the way of such products as FFMpeg, libavcodec or VLC; see, for example:
http://en.wikipedia.org/wiki/Ffmpeg[^],
http://ffmpeg.org/[^],
http://en.wikipedia.org/wiki/Libavcodec[^],
http://libav.org/[^],
http://en.wikipedia.org/wiki/VLC_media_player[^],
https://videolan.org/vlc/[^].

The products referenced above are open-source, so you can take a look at them to see what's involved. It can also give you a good idea what do you need to learn.

So, when you know the basics mentioned above, you would need to pick some of containers and publicly available compression standards, you would need to learn them and try to implement at least on the parsing level. By this time, you should get a pretty good idea on how hard or easy this work is.

In parallel, you need to learn audio and video generation sub-systems for the OS you want to deal with. For Windows, it will also include DirectX. You may need to learn WPF if you want to use WPF for Windows. You need to make some decision on what OP APIs to use and develop some working prototypes to make sure you have enough performance and reliability. On Windows, you would need to learn MMSystem, and, in particular, multimedia timers.

On I did not even count general-purpose programming topics, such as UI development using some UI libraries and threading.

On top of it, you should also keep in mind that the players can play streaming media from a network. So, eventually you will need to use streaming protocols and good deal of networking:
http://en.wikipedia.org/wiki/Media_streaming[^].

This is very preliminary and probably incomplete plan. You will probably need to add a lot more detail in it, which is only possible if you have done a big part of learning. Well, as always…

Good luck,
—SA


This is the updated useful information on the VLC component binding for.NET:
http://sourceforge.net/projects/libvlcnet/[^],
https://wiki.videolan.org/C_Sharp/[^],
https://wiki.videolan.org/.Net_Interface_to_VLC/[^].

Notably, you can find material for using the component for both WPF and System.Windows.Forms.

—SA


这篇关于媒体播放器从头开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆