hsy75的个人空间 https://blog.eetop.cn/vivilife [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

[z]linux媒体播放002 gstreamer 德比 VLC

已有 2085 次阅读| 2013-6-7 18:22 |个人分类:linux

前言:在做媒体引用的时候,总是有时候非常困惑,比如开发mms,gstreamer似乎肯定是没有很好的插件,但是VLC确有。
问题于是托盘而出,我们是用VLC还是自己去仔细修改并测试一个gstreamer的开源插件?
文章对这个困惑从各个角度进行了阐述,是一篇开阔视野的大好文章。hsy75选取了文章精华部分,进行了编注

This could turn into a debate like vi vs emacs, where people are strongly opinionated and there is never really any end to the debate. 
It might therefore be wise to do a cost-benefit analysis on your own and make up your mind based on your own particular requirements or preferences. 

Here are some of the topics of debate that would come up, which you 
did not yet mention in your message: 

1.法律角度:【hsy】 选择gstreamer,理由是vlc那些codec你几乎没地方去购买,但gstreamer可以
Legality of the codec implementations. For each product, which codecs are available? Do they comply with the letter of the law in all jurisdictions where you and anyone to whom you distribute your software plans to use it? 
For VLC, I am unaware of any MPEG-LA codec implementation that will run on VLC that is legally licensed in the U.S. or any country respecting U.S. patent law. 
To use MPEG-4, AAC, WMA, H.264, or any number of other patent-encumbered codecs, you can either break the law; 
live in a country where it isn't breaking the law; or use legally licensed codecs. 
Since VLC has none, that leaves only Gstreamer and the codecs that you can buy from Fluendo: http://www.fluendo.com

2.插件:【hsy】选择gstreamer,理由他并非为终端应用开发的
Available plugins. I'm aware that VLC is based on a similar filter graph infrastructure as Gstreamer, but I think that the number and variety of plugins available for Gstreamer makes it more useful for writing applications. Gstreamer is often accessible even to new users because of its console commands, gst-launch and gst-inspect, which help people to understand how the plugins fit together before they develop an application. 
Again, 
Gstreamer's focus is not to deliver an end-user product, but to provide an intuitive API and wide variety of generally-useful plugins for application development. By contrast, 
VLC *is* the application, so the development focus is on using the existing VLC graphical interface to perform. typical user tasks, like video playback, streaming, and conversion. Note that "available plugins" doesn't necessarily translate to "available codecs": there are a lot of Gstreamer plugins that are not a codec, and these are equally important as the codecs. 

3.可用的解码器: 不考虑license选VLC,因为这个确实多而好。但是,gstreamer有很多可能的好选择
Available codecs. If you just install the legally licensed "free as in freedom" codecs in Gstreamer, from gst-plugins-{base,good,bad}, it's clear that VLC wins the codec variety battle. But you can also stack a great number of additional codecs into Gstreamer by adding in gst-plugins-{gl,ugly,ffmpeg}, with legal strings attached, or gst-plugins-fluendo (the paid Fluendo codecs) without legal strings attached, but with a price tag attached :-). In the end, a fully loaded gstreamer (legal or otherwise) can more or less compete with VLC on codecs, but you have to either consider your legal situation very carefully, or disregard it entirely, which I can't recommend (but many people seem to do it anyway). 

4.平台兼容性: 选择gstreamer
Platform. integration. 
It's hard for VLC to keep up here, because VLC is its own world. It doesn't have any familial resemblance to any of the popular Linux desktop environments. 
Gstreamer, 
on the other hand, 
is a well-behaving GLib-based library, and so it integrates quite easily into GNOME applications. So if you are thinking of using GLib, GTK+, etc. in your application, you have a huge incentive to also use Gstreamer over any other media framework, because the programming paradigms it uses will fit quite nicely into your overall app design. VLC's preferred interface uses Qt4, which should look good on KDE, and decent on a properly-configured GNOME desktop, but you still don't get that fully platform. integrated feel. 

5.效率: 未知
Performance. If you're doing a lot of data processing, or just any kind of processing on small hardware (e.g. embedded), you could actually care about performance. I won't make any claims about the relative performance of Gstreamer and VLC, because I don't know how it goes; but I do know that Gstreamer has been successfully deployed on 
mobile devices with minimal modifications. Usually it is good enough to just, for example, use one of the fastest settings for resampling, and work with integers rather than floats across the pipeline. These little tweaks can be made by tapping element properties before you play your pipeline, and make a big difference in the performance of 
the pipeline. I don't know to what extent VLC has similar options because I am less familiar with it. 

6. 绑定:
Bindings. What bindings does VLC have for developing software against the VLC core using non-C languages? Well, it has Python bindings, sure (so does Gstreamer); but what else? If you have a particular programming language you care about, make sure that VLC supports bindings for that language. If Gstreamer has bindings that VLC doesn't for your desired language, that might be a strong reason to use Gstreamer (or, alternatively, contribute new bindings to the VLC project!) 

7. 社区:
Community. This is a hard one to quantify, or even qualify, but the friendliness and helpfulness of the community makes a big difference when I'm doing software development. I haven't worked too much with he VLC community, but I know that the Gstreamer community is one of the best in terms of being civil, providing sound advice, and being available over a wide array of media (IRC, email, etc.). Not to mention that you can get professional Gstreamer support from some companies, I understand ;-). 

Anyway, you may or may not agree with these assessments, but the _topics_ of each of those items are certainly relevant in making a choice between these two open source projects. This topic has the potential for strong words and disagreements, so I will refrain from replying further to this thread. Just keep in mind that this kind of choice is difficult to make in the general case (i.e. for all users); the most useful evaluation is one coming from your *own* perspective, focusing on your *own* requirements and preferences. My claims in this message are just coming from my perspective, which may be completely irrelevant to yours. Take it or leave it. 

HTH, 

Sean 




点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 2

    粉丝
  • 1

    好友
  • 2

    获赞
  • 14

    评论
  • 3241

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-27 03:05 , Processed in 0.016875 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部