Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   rtmpdump (http://stream-recorder.com/forum/forumdisplay.php?f=54)
-   -  

RTMPDump - how do I compile source code in Linux like Ubuntu?

(http://stream-recorder.com/forum/showthread.php?t=4229)

bat999 04-29-2011 01:14 PM

Re: Where can I download the latest version of rtmpdump (source + binaries)?


 
Hi
Thanks for your work KSV.
I've used the binaries with Windows.:)

When the program runs it says:-
Code:

RTMPDump v2.3 r568 (Compiled by KSV)
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL

But when I compile RTMPDump from SVN for Linux, it says:-
Code:

RTMPDump v2.3
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL

Please can somebody explain how I can get my SVN compiled Linux RTMPDump to display the revision number?
Is it a matter of editing a file before I compile?:confused:

svnpenn 04-29-2011 02:46 PM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
make VERSION=r568

bat999 04-29-2011 03:13 PM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
Quote:

Originally Posted by svnpenn (Post 28304)
make VERSION=r568

Very close! :D

make VERSION=r568 gives:-
Code:

RTMPDump r568
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL

So I've used:-
make VERSION="v2.3\ r568"

This gives:-
Code:

RTMPDump v2.3 r568
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL

Thanks for the help.:cool: :cool:

In case anyone's interested, this is the command I used to compile for Ubuntu:-

Code:

svn co svn://svn.mplayerhq.hu/rtmpdump/trunk rtmpdump && \
cd rtmpdump && \
make VERSION="v2.3\ r568" && \
sudo checkinstall --pakdir "$HOME/Desktop" --pkgname rtmpdump \
--pkgversion "2.3-r568" --backup=no --deldoc=yes --default && sudo ldconfig


tommieie 08-28-2011 04:54 AM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
Quote:

Originally Posted by BirdOfPrey (Post 25888)
Hi all!
I'm quite a fan of RTMPDump as it allows me to schedule the download of my favourite live streams and watch them when I have the time for them, with a little program I made.

In some cases when an error was thrown RTMPDump2.3 does not close the window (specifically when recv receives -1) so I needed to modify librtmp to suit my needs.
Although the README file on the source package is quite helpful it seems it is a bit outdated, so here is a guide to compile RTMPDump with the current release.

Here is my experience with compiling RTMPDump2.3 with Ubuntu Maverick.
First compile I compiled for linux to see if all is ok.
Download and install OpenSSL:
Code:

wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz
tar xvzf openssl-1.0.0d.tar.gz
cd openssl-1.0.0d
./config
make
sudo make install

Download and install libz:
Code:

wget http://zlib.net/zlib-1.2.5.tar.gz
tar xvzf zlib-1.2.5.tar.gz
cd zlib-1.2.5
./configure
make
sudo make install

go to cd rtmpdump-2.3 directory and edit Makefile line
Code:

LIB_OPENSSL=-lssl -lcrypto
to
Code:

LIB_OPENSSL=-lssl -lcrypto -ldl
finally make the project
Code:

make INC=-I/usr/local/ssl/include/ LDFLAGS=-L/usr/local/ssl/lib
If all goes ok, you'll get the rtmpdump binary built!

Having the linux version built I started the adventure of cross compiling it for windows
So I extracted the rtmpdump-2.3 tgz to another folder, rtmpdump-2.3Win in order not to screw up the linux built version
Code:

wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz
tar xvzf rtmpdump-2.3.tgz rtmpdump-2.3Win
cd rtmpdump-2.3Win/

PS-the svn version didn't compile, use the tzg version!

To cross compile anything for windows you need mingw32 which you get with the command
Code:

sudo apt-get install mingw32

Then configure the openSSL for windows
Code:

wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz
tar xvzf openssl-1.0.0d.tar.gz
cd openssl-1.0.0d
./Configure mingw --prefix=`pwd`/win32libs -DL_ENDIAN -DOPENSSL_NO_HW  --cross-compile-prefix=i586-mingw32msvc-
make

Get zlib already compiled for windows (less hassle this way)
Code:

wget http://zlib.net/zlib125-dll.zip
unzip zlib125-dll.zip
cd lib
cp zdll.lib libz.a

Then issue this magic command, where you should replace
  • -I/home/birdofprey/rtmpdump-2.3Win/openssl-1.0.0d/include/ for the path where the openssl includes are located (ssl.h, rc4.h, etc).
  • -I/home/birdofprey/rtmpdump-2.3Win/include/ for the path where the zlib includes are located (zlib.h, zconf.h)
  • -L/home/birdofprey/rtmpdump-2.3Win/openssl-1.0.0d/ with the path that leads you to the newly built windows libs libcrypto.a and libssl.a
  • -L/home/birdofprey/rtmpdump-2.3Win/lib for the path of your extracted libz.a.


Code:

make SYS=mingw INC="-I/home/birdofprey/rtmpdump-2.3Win/openssl-1.0.0d/include/ -I/home/birdofprey/rtmpdump-2.3Win/include/ -I/usr/i586-mingw32msvc/include/ -I/usr/local/include/" LDFLAGS="-L/home/birdofprey/rtmpdump-2.3Win/openssl-1.0.0d/ -L/usr/i586-mingw32msvc/lib/ -L/home/birdofprey/rtmpdump-2.3Win/lib" XCFLAGS="-DWIN32 -D_WIN32" CROSS_COMPILE=i586-mingw32msvc-
et voila you get a brand new rtmpdump.exe

to test it on linux do
Code:

sudo apt-get install wine
wine rtmpdump

and you'll get the marvelous strings::D

Code:

RTMPDump v2.3 Mod BirdOfPrey
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
err:systray:initialize_systray Could not create tray window
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
fixme:toolhelp:Heap32ListFirst : stub
ERROR: You must specify a hostname (--host) or url (-r "rtmp://host[:port]/playpath") containing a hostname

To put it working on windows you need to put rtmpdump.exe, librtmp.dll and zlib1.dll in the same folder.

Have fun compiling RTMPDump!:cool: :cool:

Can you help me with this compile? I'm fairly new to compiling C-code in Ubuntu, but I did follow your manual very carefully, however I get the following error:

tom@ubuntu:~/Downloads/rtmpdump-2.3$ make INC=-I/usr/local/ssl/include/ LDFLAGS=-L/usr/local/ssl/lib
make[1]: Entering directory `/home/tom/Downloads/rtmpdump-2.3/librtmp'
gcc -shared -Wl,-soname,librtmp.so.0 -L/usr/local/ssl/lib -o librtmp.so.0 rtmp.o log.o amf.o hashswf.o parseurl.o -lssl -lcrypto -lz
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s23_meth.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [librtmp.so.0] Error 1
make[1]: Leaving directory `/home/tom/Downloads/rtmpdump-2.3/librtmp'
make: *** [librtmp/librtmp.a] Error 2
tom@ubuntu:~/Downloads/rtmpdump-2.3$

Can you please give an indication where it does go wrong?

Thanks!

bat999 08-28-2011 06:45 AM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
Quote:

Originally Posted by tommieie (Post 32004)
Can you help me with this compile? I'm fairly new to compiling C-code in Ubuntu

Which version of Ubuntu is installed?

tommieie 08-29-2011 12:44 AM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
Ubuntu 11.04 it is

bat999 08-29-2011 05:03 AM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
Quote:

Originally Posted by tommieie (Post 32024)
Ubuntu 11.04 it is

No need to compile RTMPDump v2.3 yourself.
It's in the 11.04 repo.
Code:

sudo apt-get install rtmpdump

tommieie 08-30-2011 11:16 AM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
thank you mr, that worked!

karlo2105 09-20-2011 02:15 AM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
For Ubuntu linux users, you can add this PPA to get the latest rtmpdump version. :D

StreamRecorder 09-29-2013 03:28 AM

Re: RTMPDump - how do I compile source code in Linux like Ubuntu?


 
How to compile rtmpdump with KSV patches in Ubuntu 13.04
Download rtmpdump from git://git.ffmpeg.org/rtmpdump
Code:

git clone git://git.ffmpeg.org/rtmpdump
Install dependencies
Code:

sudo apt-get install build-essential gcc make subversion libssl-dev
Download KSV patch from https://github.com/K-S-V/Scripts/releases/tag/v2.4. Extract the archive and put the Patch.diff file into the folder with rtmpdump sources. Apply the KSV patch:
Code:

patch -p0 -i Patch.diff
If rtmpdump is already installed via sudo apt-get install, then do the following:
Code:

rtmpdump installed
cd librtmp
make
sudo cp librtmp.so.0 /lib
cd ..

Compile and install rtmpdump
Code:

make SYS=posix
sudo make install



All times are GMT -6. The time now is 02:56 AM.