影音体验自然是日常使用中必不可少的东西,这里我喜欢用mplayer和audacious 看不少人对ffdshow和ffmpeg的关系有点搞不清楚,所以响应Leon老大的号召,发个帖子简单说明一下。 上边是sf的ffdshow的简单说明。我得理解就是,ffdshow是对一些codec(ffmpeg, xvid, and other)的封装,封装成了DirectShow和VFW的标准组件。比如对于xvid来讲,ffdshow是可以选择具体使用那个codec的, ffmpeg(libavcodec) or xvid。 那么封装有没有额外的成本哪?有,但对大部分应用来讲,可以忽略不计。就如c++和c。 先说这么多,欢迎拍砖。 写得不错,目前群里面的兄弟都在研究ffmpeg,对ffdshow研究的少,因为ffdshow只是一件外衣,核心还是ffmpeg,估计等一段时间就会有些朋友转向ffdshow的。 我再补充几句吧,vfw和dshow里的CODEC分别是通过fourcc码和guid机制寻找的,可以在系统注册codec后调用,比自 带编解码库形式更加统一,便于使用。此外,vfw和dshow是代表了两个微软不同时期的音视频处理封装库,里面包含了音视频驱动,音视频处理的一整套方 案。 这里引用自http://www.ffmpeg.com.cn/index.php/Ffmpeg%E7%AE%80%E4%BB%8B
首先因该安装gstreamer
GStreamer is a streaming media framework, based on graphs of filters which operate on media data. Applications using this library can do anything from real-time sound processing to playing videos, and just about anything else media-related. Its plugin-based architecture means that new data types or processing capabilities can be added simply by installing new plug-ins.
#sudo apt-get install gstreamer0.10-*
再装些相关的东西,
#sudo apt-get install totem-xine ffmpeg mjpegtools
其中ffmepg有必要介绍下:FFmpeg is a complete solution to record, convert and stream audio and video. It includes libavcodec, the leading audio/video codec library. FFmpeg is developed under Linux, but it can compiled under most operating systems, including Windows.
组成结构
ffmpeg与ffdshow的关系
最后安装播放器吧
# apt-get install mplayer mplayer-fonts mozilla-mplayer
现在好了,不过还不能播放影片,需要下载一些解码器。
可以到http://www.mplayerhq.hu/MPlayer/releases/codecs/去下载
我的机子是AMD Athlon X2 64的,所以除了
all-20071007.tar.bz2和essential-20071007.tar.bz2外再下一个
essential-amd64-20071007.tar.bz2
此外,如果你需要播放wmv、rmvb等常见视频的话需要安装w32codecs,不过貌似这里和新得利里面找不到w32codecs,所以得自己下载,
到http://debian-multimedia.org/pool/main/w/w32codecs/
去看看。
下载来的解码器得解压到/usr/local/lib/codecs中
另外,Ubuntu官方wiki上介绍要把播放模式设置为xv X11/xv可惜我的机子这样设置没用不能放,所以就直接设置为X11了。
之后就比如配置中文字幕的显示了,如果你需要看到中文字幕的话:
基本可以参照Ubuntu的wiki,不过我这里那个字体文件是.ttc的扩展名,记得改下就好。mkdir ~/.mplayer
ln -sf /usr/share/fonts/truetype/arphic/uming.ttc ~/.mplayer/subfont.ttf
gedit ~/.mplayer/gui.conf
sub_cp = "cp936"
font_text_scale = "4.000000"
font_osd_scale = "4.000000"
sub_fuzziness=2
至此,mplayer的设置已经基本可以了,我这里可以播放机子上所有的视频文件了。
接下来是是安装Audacious这个直接用apt-get就好了。
之后打开audacious会发现中文名乱码,只需要在设置,播放列表中改一下就ok~
此外,关于ubuntu下的这个audacious播放器播放midi的问题,可以参考下面这个内容:
How To: Ubuntu MIDI Playback with Audacious
22 01 2008One of the things I kind of missed from Linux is general MIDI playback. Currently there’s only a few options. Use a software synth such as Timidity or try and fool around for a long time to get your hardware to play MIDI. There is some hope though, a new plugin in the gstreamer-bad package upstream will allow any gstreamer based player play MIDI through Timidity. But if you have a sound card that can play MIDI why not use it? A software synth is very CPU intensive, using the hardware seems optimal. There’s also another way. Audacious has a MIDI plugin that can do both hardware and software synth, so everyone ends up happy.
So how do you do this?
Software Synth, AMIDI Plugin with FluidSynth Backend
This is good for computers that do not have a sound card capable of MIDI playback.
First install Audacious and extras
sudo apt-get install audacious audacious-plugins audacious-plugins-extra
Now open Audacious and right click anywhere on Audacious to bring up the menu. Go to Preference. Click on the Plugins tab and highlight the AMIDI-Plug plugin. Then click Preferences and select the FluidSynth backend. Now select the FluidSynth Backend tab to configure it. You’re going to need to find a general MIDI soundfont. There’s plenty available out there. Now you need to add the location of the soundfont (.SF2) to the SoundFont settings. Now click OK. You should now be able to play back MIDIs
Hardware Synth, AMIDI Plugin with ALSA Backend
This is a little more tricky and you need to have a sound card that is capable of MIDI playback. Any card that uses the emu10k1 driver (e.g. Sound Blaster Audigy 2 and 4) should work since they are capable of loading soundfont wave tables into the sound card.
First let’s install the necessary itemsudo apt-get install audacious audacious-plugins audacious-plugins-extra awesfx
Now open Audacious and right click anywhere on it to bring up the menu. Go to Preferences and select the Plugins tab. Highlight the AMIDI-Plug plugin and click on Preferences. Highlight the ALSA Backend. You can configure extra options for the ALSA backend by clicking on the ALSA Backend tab, but the defaults should be fine. Click OK and close the Preferences dialog. Now you’re going to need a SoundFont. If you have a Sound Blaster Audigy check the installation CD. There should be some soundfonts on there. Copy them to your hard drive somewhere. Now open a terminal and cd to the directory where you put themcd /path/to/soundfont/Now load it into the sound card with asfxloadasfxload soundfont.SF2Now you can close the terminal and go back to Audacious. You should now be able to play MIDI files off the hardware. The only slight inconvenience to this is that when you reboot you will have to reload the soundfont before playing MIDIs.I’ve made a screencast of both ways to do this if you need to see it visually Just be warned the first half came out really loud for some reason, so you might want to turn your volume down a bit. http://www.mediafire.com/?8bdddtxvo1l
这里提供一个下载地址: ftp://ftp.personalcopy.net/pub/Unison.sf2.gz
好了,现在你的视频和音频播放已经完美了!!
/*-----------------------------------------------------*/
*原创文章,转载请保留指向本文的连接
/*-----------------------------------------------------*/
没有评论:
发表评论