android ktv 开发过程2

ffmpeg  编译好像成功了。但是启动ffmpeg时失败了。错误:

ffmpeg: relocation error: /usr/local/lib/libavfilter.so.1: symbol sws_isSupportedInput, version LIBSWSCALE_0 not defined in file libswscale.so.0 with link time reference

应该是依赖的包有问题,网上找资料,很少,几乎没有参照。只能重新编译。

后来发现下面的帖子,使用Yum安装。成功。 http://gofedora.com/how-to-install-ffmpeg-ffmpeg-php/

I was randomly browsing the internet and reading about making a website look better and I encountered ffmpeg-php. ffmpeg is a very powerful tool to record, convert and stream audio and video. Its a very rich tool almost supporting every format out there in the world. It can convert any format to any other format provided the codec. ffmpeg-phpis an extension for PHP that provides a rich library to access info about audio and video files. The good thing about ffmpeg-php is that it can retrieve all info about any audio/video file subjected to the condition that the particular audio/video format is supported by your ffmpeg installation. So, now you have a clear idea that you can do wonders with audio/videos while showing them on your site :)

I tried some of the functionalities and they worked out of the box. Here’s is complete how to on installing ffmpeg and ffmpeg-php.

FFMPEG:

I tried installing ffmpeg from rpms provided by several Fedora repositories but after installation ffmpeg doesn’t seem to work. After several tries, I installed ffmpeg from source rpms and it worked. Below, I will describe how to install ffmpeg from source rpm.

Step 1:

Make sure that you have ‘rpmbuild’ installed by issuing

[root@bordeaux saini]# rpm -q rpmbuild [Enter]

command. If the above says that rpmbuild is not installed, then install it using yum as given below

[root@bordeaux saini]# yum install rpmbuild [Enter] (do as root)

Step 2:

Download the latest src rpm of ffmpeg from rpmfind.net. Issue the command given below

[root@bordeaux saini]# rpm -hiv ffmpeg-x.x.x.xx-xxx.src.rpm [Enter] (do as root)

Step 3:

Go to ‘/usr/src/redhat/SPECS/’ directory and issue the command given below

1
2
[root@bordeaux saini]# cd /usr/src/redhat/SPECS/ [Enter]
[root@bordeaux SPECS]# rpmbuild -ba ffmpeg.spec [Enter] (do as root)

If it gives an error like package ‘xyz’ is need by ffmpeg. Then install the package ‘xyz’ using yum as

[root@bordeaux SPECS]# yum install xyz [Enter] (do as root)

After installing the dependencies, issue the rpmbuild command ‘rpmbuild -ba ffmpeg.spec’. Now ffmpeg rpms will be build and they will be stored in ‘/usr/src/redhat/RPMS/i386/’.

Step 4:

Go the ‘/usr/src/redhat/RPMS/i386/’ (x86_64 instead of i386 if your OS is 64 bit). Install all the rpms that were built by rpmbuild.

[root@bordeaux saini]# rpm -hiv *.rpm [Enter] (do as root)

Thats it. ffmpeg is now successfully installed on your computer. Half the job is done. Now lets proceed with ffmpeg-php installation.

FFMPEG-PHP:

We will install ffmpeg-php from source bundle.

Step 1:

Make sure that ‘php-devel’ installed on your machine by issuing

[root@bordeaux saini]# rpm -q php-devel [Enter]

command. If the above command says the ‘php-devel’ is not installed, then install it using the following command.

[root@bordeaux saini]# yum install php-devel [Enter] (do as root)

Step 2:

Download the latest version of ffmpeg-php from here. Unpack the file you have downloaded.

1
2
[root@bordeaux saini]# bunzip2 -d ffmpeg-php-0.5.1.tbz2 [Enter]
[root@bordeaux saini]# tar -xvf ffmpeg-php-0.5.1.tar [Enter]

Step 3:

Issue the following command in sequence if everything goes fine.

1
2
3
4
5
[root@bordeaux saini]# cd ffmpeg-php-0.5.1 [Enter]
[root@bordeaux ffmpeg-php-0.5.1]# phpize [Enter]
[root@bordeaux ffmpeg-php-0.5.1]# ./configure [Enter]
[root@bordeaux ffmpeg-php-0.5.1]# make [Enter]
[root@bordeaux ffmpeg-php-0.5.1]# make install [Enter] (do as root)

Step 4:

Open ‘/etc/php.ini’ and add a line ‘extension=ffmpeg.so’ in the category ‘Dynamic Extensions’. For help see the image below.
FFMPEG PHP PHPini Module

Step 5:

Restart apache web server aka ‘httpd’ service by issuing the command.

[root@bordeaux saini]# service httpd restart [Enter] (do as root)

Step 6:

Write a test php file and test your ffmpeg-php installation.

phpinfo();

Save the above code in ‘info.php’ and save the file in ‘/var/www/html/’ and browse http://localhost/info.php . If you see something like this.
FFMPEG PHP Linux
Then the ffmpeg-php is successfully installed on your machine. Now you can jump into the world of video manipulation via your website.

问题分割线---------------------------------------------------------------------------------------------------------------------------------------------

MKV文件中有原声和伴奏音轨/KTv文件格式必须有一个vedio,两个audio track,主唱一个audio track,伴唱一个audio track.
参考链接: http://zhidao.baidu.com/question/227735962.html
这个也收藏一下:
http://zhidao.baidu.com/question/203784496.html

据说左右声道是VCD用的,双音轨是DVD用的。
两者在电脑上面放有什么区别吗?或者在电脑上怎么区分一个视频到底是左右声道的还是DVD双音轨的。
怎么用最简单的方法实现双音轨,做成伴奏和原唱的那种卡拉OK视频!

VCD使用立体声音源,立体声音源是亮个独立的单声道音源构成,在电脑上播放表现为两个音箱一边是伴奏一边是清唱,远一点听感觉不明显,但都是单声道!!!(少数播放软件可以选听一个声道,但不会改变它的实质)。
DVD支持8条音轨,每条都是立体声,也就是说DVD的伴奏与清唱都是立体声!!!!!在电脑上播放也要选择音轨,除非它有三条音轨,否则不会出现有伴奏的原唱。
简单实现卡拉OK效果的方法就是VCD的方法,伴奏、人声都用单声道。
最好的办法是你用播放来区分。很多播放软件不支持多音轨切换和左右声道切换,所以推荐你使用POWER DVD这个软件播放,既可以切换左右声道也可以切换不同的音轨。
还有一个比较直观的方法,一首歌曲,如果是VCD版本一般文件大小在30-50M,DVD版本的文件大小在100M以上。
用DVD-LAB PRO这个软件,可以实现在一个视频下添加多音轨,最多支持8个音轨。
做DVD KTV的话,你需要先在音频软件里把原唱和伴奏对齐,分别保存为WAV格式,然后到DVD-LAB PRO里面去添加音轨。 
回答者: wk211 | 十二级 | 2010-12-6 20:52
VCD是声道的概念,即一个音轨只能包含两个声道。而DVD是多音轨的概念,最多可有8条音轨,比如一部电影有英语,汉语和粤语,这就需要有三条音轨放置这三种语言。DVD中,一条音轨也可放置多个声道,比如6个(5.1声道),
如果一段视频包含两个声道,用它转换制作的VCD在影碟机中可切换,但是做成的DVD就不能切换,这是为什么?因为电脑中可切换,我想应该是影碟机没有这个功能。如果将两个声道转换成两条音轨的话,DVD中就可通过声道键切换了。
因此,带有双声道音频的视频,在制作DVD时,就要注意声道在碟机上切换的问题。一般的方法是将视频文件的音频左声道输出一个音频文件,右声道输出一个音频文件,然后在制作DVD时,用专业级的DVD制作软件,如Adobe Encore DVD 进行制作。后来我发现,有一个名叫TMPGEnc DVD author的DVD制作可以将声道直接转换成DVD中的两条音轨,于是以后做这个就非常的容易了。 



posted @ 2011-04-25 16:28  jrvin  阅读(1958)  评论(0编辑  收藏  举报