Answer:
Normally, it would go to /usr/local. In /usr/local, you would have subdirectories such as /bin, /etc, /lib, /share, /src. These sub-folders contain appropriate files depending on the type of program that you want to install.
hand-on techniques and consultant services about IT (viết về phân tích kỹ thuật và có dịch vụ tư vấn về IT)
Thứ Bảy, 15 tháng 6, 2013
Thứ Sáu, 14 tháng 6, 2013
HOW-TO: Install OpenCV-2.4.5 and ffmpeg-1.2.1 in Ubuntu 64bits
Bug
After spending several days to install the latest ffmpeg with the latest OpenCV, I discovered that I made a stupid mistakes. The follow is a big-bug that I had met during installing ffmpeg-1.2.1 which create shared library in order for OpenCV to recognize it.
I am writing this post to summerize steps to install ffmpeg a common media cross-platform for OpenCV-2.4.5 to localize it. I recommend you to follow the instructions in [3]. You can also follow [1] and
[2]. Refering to [2], you can test if you install OpenCV correctly (testing section). I copy and paste here for easy to refer.
Testing
An easy way to test that the compilation went well is to use the OpenCV test utilities. For example, to test the core module go to OpenCV-2.4.5/build/bin and run:
Hope it works.
[1] http://vinayhacks.blogspot.sg/2011/11/installing-opencv-231-with-ffmpeg-on-64.html
[2] http://karytech.blogspot.sg/2012/05/opencv-24-on-ubuntu-1204.html
[3] http://www.ozbotz.org/opencv-installation/
[4] https://www.virtualbox.org/ticket/10085
[5] http://linux.die.net/man/8/ldconfig
After spending several days to install the latest ffmpeg with the latest OpenCV, I discovered that I made a stupid mistakes. The follow is a big-bug that I had met during installing ffmpeg-1.2.1 which create shared library in order for OpenCV to recognize it.
'libavutil/intfloat_readwrite.o: relocation R_X86_64_PC32 against undefined symbol `ldexp@@GLIBC_2.2.5'.This error because of bad symbolic link in ubuntu. The reason is that I placed my install folder in shared folder between my computer and Virtualbox VMs [4]. Anyway, if you meet this error, please moving your folder to a safer place, not a shared folder. On the other hand, installing ffmpeg and opencv require you to to have --enable-shared option which create shared-library. So, you need to do the same to all other dependencies, --enable-shared option as in [3]. Other possible remedy, you might want to run ldconfig command to update run-time linker default [5]. The exact structure for this command is
ldconfig [your ffmpeg installer folder].Installation
I am writing this post to summerize steps to install ffmpeg a common media cross-platform for OpenCV-2.4.5 to localize it. I recommend you to follow the instructions in [3]. You can also follow [1] and
[2]. Refering to [2], you can test if you install OpenCV correctly (testing section). I copy and paste here for easy to refer.
Testing
An easy way to test that the compilation went well is to use the OpenCV test utilities. For example, to test the core module go to OpenCV-2.4.5/build/bin and run:
./opencv_test_coreYou should see something like this:
Note that some failures when testing other modules may come from missing image files. To correctly run these tests or samples you should move the corresponding image files from OpenCV-2.4.5/samples to OpenCV-2.4.5/build/bin.
For testing that you can compile your own programs and link against the installed OpenCV libraries I have packaged the face detection sample with all the necessary files and a simple Makefile. Download it here, extract and type:
For testing that you can compile your own programs and link against the installed OpenCV libraries I have packaged the face detection sample with all the necessary files and a simple Makefile. Download it here, extract and type:
makeThis should compile and run with a test image, so you should see something like this:
Hope it works.
[1] http://vinayhacks.blogspot.sg/2011/11/installing-opencv-231-with-ffmpeg-on-64.html
[2] http://karytech.blogspot.sg/2012/05/opencv-24-on-ubuntu-1204.html
[3] http://www.ozbotz.org/opencv-installation/
[4] https://www.virtualbox.org/ticket/10085
[5] http://linux.die.net/man/8/ldconfig
Google Account Video Purchases
Singapore
Thứ Tư, 20 tháng 6, 2012
HOW-TO: Manually Installing Mediaproxy 2.5 on Ubuntu 12.04 server 64 bits
Media-proxy
is a media relay for RTP/RTCP and UDP streams that works in tandem with
OpenSIPS to provide NAT traversal capability for media streams from SIP user
agents located behind NAT. Mediaproxy supports ICE negotiation by behaving like
a TURN relay candidate and the policy can be controlled from OpenSIPS
configuration.
Mediaproxy
2 is a Python project from AG-projects which is consisted of (at least) two components: A dispatcher and a
relay.
For more
details, please skim at http://mediaproxy.ag-projects.com/
If you
want to install Mediaproxy by a Debian repository, you can refer to http://mediaproxy.ag-projects.com/projects/mediaproxy/wiki/InstallationGuide.
There
are many installation guide found on Internet such as
But none
of it is perfect for my case, Ubuntu server 12.04 64 bits, I tried to search on
Google for solution and had this hand-on experience. This article is aimed to
provide good example for installing Mediaproxy in Ubuntu server 64 bits. Try to
do it step by step, do it smoothly you
need some knowledge about basic GNU installation and python installation.
Install kernel support
#apt-get install iptables
#apt-get install gcc
#apt-get install g++
Development libraries and headers
for some existing packages
#apt-get
install libgpg-error-dev
#apt-get
install python-dev
Install
Linux libnetfilter_conntrack
Libnfnetlink
Suggestion version: libnfnetlink-1.0.0.tar.bz2
Unzip
#tar xvjf libnfnetlink-1.0.0.tar.bz2
Change to the sub-directory created when you
unzipped the tarball: #cd libnfnetlink-1.0.0/
#./configure
#make
#make
install
libnfnetlink-dev
#apt-get install libnfnetlink-dev
libnetfilter_conntrack
Similarly, we do the same thing with previous one.
#wget http://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-1.0.1.tar.bz2
libnetfilter_conntrack-dev
#apt-get install libnetfilter-conntrack-dev
Install Python 3.2.3
Install
the new release of Python from the URL.
#tar -xf
Python-3.2.3.tgz
#./configure
#make
Install some Python packages
Ctypes
Suggested version: ctypes-1.0.2.tar.gz
#wget http://downloads.sourceforge.net/project/ctypes/ctypes/1.0.2/ctypes-1.0.2.tar.gz
Unzip: #tar -xvzf ctypes-1.0.2.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd ctypes-1.0.2/
Build and install the library:
./setup.py build
./setup.py install
#wget http://downloads.sourceforge.net/project/ctypes/ctypes/1.0.2/ctypes-1.0.2.tar.gz
Unzip: #tar -xvzf ctypes-1.0.2.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd ctypes-1.0.2/
Build and install the library:
./setup.py build
./setup.py install
Python-application
Suggested version: python-application-1.3.1.tar.gz
#wget http://pypi.python.org/packages/source/p/python-application/python-application-1.3.1.tar.gz#md5=615d670fcda2aa5a01de7bc12baa1fdf
Unzip: #tar -xvzf python-application-1.3.1.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd python-application-1.3.1/
Build and install the library:
./setup.py build
./setup.py install
#wget http://pypi.python.org/packages/source/p/python-application/python-application-1.3.1.tar.gz#md5=615d670fcda2aa5a01de7bc12baa1fdf
Unzip: #tar -xvzf python-application-1.3.1.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd python-application-1.3.1/
Build and install the library:
./setup.py build
./setup.py install
Python-cjson
Suggested version: python-cjson-1.0.5.tar.gz
#wget http://pypi.python.org/packages/source/p/python-cjson/python-cjson-1.0.5.tar.gz#md5=4d55b66ecdf0300313af9d030d9644a3
Unzip: #tar -xvzf python-cjson-1.0.5.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd python-cjson-1.0.5/
Build and install the library:
#./setup.py build
#./setup.py install
#wget http://pypi.python.org/packages/source/p/python-cjson/python-cjson-1.0.5.tar.gz#md5=4d55b66ecdf0300313af9d030d9644a3
Unzip: #tar -xvzf python-cjson-1.0.5.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd python-cjson-1.0.5/
Build and install the library:
#./setup.py build
#./setup.py install
Python-gnutls
Suggested version: python-gnutls-1.2.4.tar.gz
#wget http://pypi.python.org/packages/source/p/python-gnutls/python-gnutls-1.2.4.tar.gz#md5=e3536c421291a791869d875a41dcb26a
Unzip: #tar -xvzf python-gnutls-1.2.4.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd python-gnutls-1.2.4/
Build and install the library:
#./setup.py build
#./setup.py install
#wget http://pypi.python.org/packages/source/p/python-gnutls/python-gnutls-1.2.4.tar.gz#md5=e3536c421291a791869d875a41dcb26a
Unzip: #tar -xvzf python-gnutls-1.2.4.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd python-gnutls-1.2.4/
Build and install the library:
#./setup.py build
#./setup.py install
Install
Python-Zope Interface
Similarly, we do install this package from this url:
#wget
http://old.zope.org/Products/ZopeInterface/3.3.0/zope.interface-3.3.0.tar.gz
Install Twisted
#wget
http://pypi.python.org/packages/source/T/Twisted/Twisted-12.1.0.tar.bz2#md5=f396f1d6f5321e869c2f89b2196a9eb5
Install both of them similarly with other installation.
Install libgcrypt, gmp and gnutls
from source tarball
In order
to escape some unnecessary when installing media-proxy, you should install
libgcrypt from source, albeit you can do in apt-get.
Libgcrypt
Suggested
version: libgcrypt-1.5.0.tar.bz2
Unzip: #tar
-xvjf libgcrypt-1.5.0.tar.bz2
Change to the sub-directory created when you unzipped the tarball: #cd libgcrypt-1.5.0/
Build and install the library:
Change to the sub-directory created when you unzipped the tarball: #cd libgcrypt-1.5.0/
Build and install the library:
./configure --libdir=/usr/local/lib
make
make install
make
make install
Gmp
Before
installing nettle, you must install
GMP. If you accidently install nettle previously, please install gmp first and
then reinstall nettle.
Suggested
version: gmp-5.0.5.tar.bz2
#wget ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.5.tar.bz2
And don’t forget .sig file for untar: #wget
ftp://ftp.gmplib.org/pub/gmp-5.0.5/gmp-5.0.5.tar.bz2.sig
Unzip: #tar -xvjf gmp-5.0.5.tar.bz2
Change to the sub-directory created when you unzipped the tarball: #cd gmp-5.0.5/
Build and install the library:
Change to the sub-directory created when you unzipped the tarball: #cd gmp-5.0.5/
Build and install the library:
./configure
make
make install
make
make install
Install nettle
Suggested
version: nettle-2.4.tar.gz
#wget http://www.lysator.liu.se/~nisse/archive/nettle-2.4.tar.gz
Unzip: #tar -xvzf nettle-2.4.tar.gz
Change to the sub-directory created when you unzipped the tarball: #cd nettle-2.4/
Build and install the library:
Change to the sub-directory created when you unzipped the tarball: #cd nettle-2.4/
Build and install the library:
./configure
make
make install
make
make install
Install zlib
Install p11-kit
Then install gnutls
Suggested
version: gnutls-3.0.9.tar.xz
#wget ftp://ftp.gnu.org/gnu/gnutls/gnutls-3.0.9.tar.xz
And don’t forget .sig file for untar: #wget
ftp://ftp.gnu.org/gnu/gnutls/gnutls-3.0.9.tar.xz.sig
Unzip: #tar -xvzf gnutls-3.0.9.tar.xz
Change to the sub-directory created when you unzipped the tarball: #cd gnutls-3.0.9/
Build and install the library:
Change to the sub-directory created when you unzipped the tarball: #cd gnutls-3.0.9/
Build and install the library:
./configure --with-included-libtasn1
--libdir=/usr/local/lib
make
make install
make
make install
Manually copy some run-time
libraries to /usr/lib
Copy the
following dynamic libraries from /usr/local/lib to /usr/lib
libgcrypt.so.11.7.0 (only if you installed from source)
libgnutls.so.27
libgnutls.so.27.0.1
libgnutls-openssl.so.27
libgnutls-openssl.so.27.0.1
libgcrypt.so.11.7.0 (only if you installed from source)
libgnutls.so.27
libgnutls.so.27.0.1
libgnutls-openssl.so.27
libgnutls-openssl.so.27.0.1
For the RADIUS accounting module
#wget http://pypi.python.org/packages/source/p/pyrad/pyrad-2.0.tar.gz#md5=e95f2cef1a191c1c891779dff8fb0255
Mediaproxy 2
Suggested version: mediaproxy-2.5.2.tar.gz
#wget http://download.ag-projects.com/MediaProxy/mediaproxy-2.5.2.tar.gz
Suggested location to copy and then unzip the tarball: /usr/local
Unzip: #tar -xzf mediaproxy-2.5.2.tar.gz
Change to the sub-directory created when you unzipped the tarball
Build and install the library (system wide):
./setup.py build
./setup.py install
Suggested version: mediaproxy-2.5.2.tar.gz
#wget http://download.ag-projects.com/MediaProxy/mediaproxy-2.5.2.tar.gz
Suggested location to copy and then unzip the tarball: /usr/local
Unzip: #tar -xzf mediaproxy-2.5.2.tar.gz
Change to the sub-directory created when you unzipped the tarball
Build and install the library (system wide):
./setup.py build
./setup.py install
Enable
IP Forwarding by making changes in /etc/sysctl.conf file...
Permanently enable ip forwarding,,,
# gedit /etc/sysctl.conf &
...
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
Permanently enable ip forwarding,,,
# gedit /etc/sysctl.conf &
...
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
Then,
try these commands
# echo 1 > /proc/sys/net/ipv4/ip_forward
# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
# echo 1 > /proc/sys/net/ipv4/ip_forward
# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
Make
directory, copy necessary files to proper directories, and setup ownership:
#mkdir /var/run/mediaproxy
#cp config.ini.sample /etc/mediaproxy/config.ini
#cp tls/* /etc/mediaproxy/tls/
#mkdir /var/run/mediaproxy
#cp config.ini.sample /etc/mediaproxy/config.ini
#cp tls/* /etc/mediaproxy/tls/
Config.ini
OpenSIPS+MediaProxy
Integration:
# mkdir /var/run/mediaproxy
# gedit config.ini &
Make following changes in file...
# mkdir /var/run/mediaproxy
# gedit config.ini &
Make following changes in file...
Change
IP address according to your server.
[Relay]
dispatchers = mydomain.net:5060 _sip._udp.mydomain.net
port_range = 50000:60000
log_level = DEBUG
on_hold_timeout = 1800
[Dispatcher]
listen = 10.1.10.205:50000
management_use_tls = no
log_level = DEBUG
accounting = radius
[Radius]
; This section needs to be configured if radius accounting is enabled
; OpenSIPS RADIUS configuration file. All RADIUS cofiguration parameters will
; be read from this file, including dictionary files.
;
;config_file = /etc/opensips/radius/client.conf
config_file = /etc/freeradius/clients.conf
; Additional dictionary file with MediaProxy specific attributes.
;additional_dictionary = radius/dictionary
additional_dictionary = /etc/freeradius/dictionary
[OpenSIPS]
socket_path = '/var/run/opensips/socket'
Now edit opensips.cfg file to include MediaProxy...
#
# ----- nat_traversal
#**
loadmodule "nat_traversal.so"
#**
modparam("nat_traversal", "keepalive_interval", 90)
modparam("nat_traversal", "keepalive_method", "OPTIONS")
modparam("nat_traversal", "keepalive_from", "sip:keepalive@mydomain.com")
#
# --> nathelper
#**
loadmodule "nathelper.so"
#**
modparam("nathelper", "natping_interval", 60)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper", "received_avp", "$avp(i:801)")
modparam("nathelper", "sipping_from", "sip:pinger@mydomain.com")
#
#**
loadmodule "mediaproxy.so"
#**
#--------------- Default Values
modparam("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy/dispatcher.sock")
modparam("mediaproxy", "mediaproxy_timeout", 500)
modparam("mediaproxy", "signaling_ip_avp", "$avp(s:nat_ip)")
modparam("mediaproxy", "media_relay_avp", "$avp(s:media_relay)")
#--------------- Main Routing Logic
#
[Relay]
dispatchers = mydomain.net:5060 _sip._udp.mydomain.net
port_range = 50000:60000
log_level = DEBUG
on_hold_timeout = 1800
[Dispatcher]
listen = 10.1.10.205:50000
management_use_tls = no
log_level = DEBUG
accounting = radius
[Radius]
; This section needs to be configured if radius accounting is enabled
; OpenSIPS RADIUS configuration file. All RADIUS cofiguration parameters will
; be read from this file, including dictionary files.
;
;config_file = /etc/opensips/radius/client.conf
config_file = /etc/freeradius/clients.conf
; Additional dictionary file with MediaProxy specific attributes.
;additional_dictionary = radius/dictionary
additional_dictionary = /etc/freeradius/dictionary
[OpenSIPS]
socket_path = '/var/run/opensips/socket'
Now edit opensips.cfg file to include MediaProxy...
#
# ----- nat_traversal
#**
loadmodule "nat_traversal.so"
#**
modparam("nat_traversal", "keepalive_interval", 90)
modparam("nat_traversal", "keepalive_method", "OPTIONS")
modparam("nat_traversal", "keepalive_from", "sip:keepalive@mydomain.com")
#
# --> nathelper
#**
loadmodule "nathelper.so"
#**
modparam("nathelper", "natping_interval", 60)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper", "received_avp", "$avp(i:801)")
modparam("nathelper", "sipping_from", "sip:pinger@mydomain.com")
#
#**
loadmodule "mediaproxy.so"
#**
#--------------- Default Values
modparam("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy/dispatcher.sock")
modparam("mediaproxy", "mediaproxy_timeout", 500)
modparam("mediaproxy", "signaling_ip_avp", "$avp(s:nat_ip)")
modparam("mediaproxy", "media_relay_avp", "$avp(s:media_relay)")
#--------------- Main Routing Logic
#
Starting
MediaProxy Dispatcher...
#./media-dispatcher --no-fork
#./media-dispatcher &
#./media-dispatcher --no-fork
#./media-dispatcher &
The most
notorious error I have met: “Libnettle 2.4 was not found” although nettle was
installed.
Solution: This is because I did not
install GMP before install Nettle, so Nettle did not create libhogweed for
gnutls installing progress.
Nhãn:
64 bits,
mediaproxy 2.5,
Mediaproxy installation,
NAT traversal,
Opensips,
SIP,
stun server,
ubuntu 12.04,
ubuntu server 64 bits
Google Account Video Purchases
Ho Chi Minh City, Vietnam
Đăng ký:
Bài đăng (Atom)