Kodi Community Forum

Full Version: librtmp - Help Thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2014-03-23, 17:17)Shani-08 Wrote: [ -> ]Hi Guys,
I finally got time and understood what was going wrong with Frodo rtmp, please get the final one from http://ge.tt/8lt0oFR1
I have tested it myself and can confirm its working. However, I have tested on Frodo 12.3 vanilla. If you have any other variation then you have to give it a test. I can't promise its going for work anywhere else but don't have any reason why it shouldn't.

The problem was that after compiling Gotham rtmp file, i thought Frodo would be same. It turns out that reading the readme pays off at last
Frodo uses the Crystax NDK while Gotham supports Google's Android NDK. that's why it was crashing. Finally, after couple of hundred tries (lol) i am now able to compile produce Frodo rtmp with correct patches etc.
Enjoy and update here if it works for you. Don't forget to set the 755 rights etc etc. and keep the original file save.
On many of the Android variations, after the reboot, it recovers the old file from xbmc apk so create some batch file or new apk etc, i guess you guys can do that yourselves.

Updated and it doesn't crash my xbmc! , great job dude congratulatins. How can i give reputation points? Can you tell me a stream that uses new librmpt to check? Red penguins channels not working for me
Glad to see its not crashing.
There is an addon under my repo (jagobd.com), some bangladeshi streams, so perhaps you wont understand a thing Smile but most of it channels requires new rtmp file.
try that and see if videos playing for you.
You can get my repo from fusion, look in /world/Pakistani
(2014-03-23, 18:19)Shani-08 Wrote: [ -> ]Your experience is not quite different than mine, Gotham build was 100 times better and quicker. I had to reset my environment twice as i suspected something is a miss and it was complaining about everything that i could think off. However, these are the steps, not different than xbmc's ready me.
My environment, Windows Pc 64bit, with VirtualBox running Ubuntu 13.10 64 bit
Here are the steps, this is just to get RTMP compiled, the goal is not to create apk, therefore we will ignore errors or stop compiling as soon as rtmp has compiled. you are welcome to go through the readme and do the needful.

1. I followed this Read me, so anything not clear or requires more info, have a look here https://github.com/xbmc/xbmc/blob/Frodo/...ME.android

2. from the readme perform step two
Code:
sudo apt-get install build-essential default-jdk git curl autoconf unzip zip zlib1g-dev gawk gperf cmake

3. also install the following as well
Code:
sudo apt-get install lib32stdc++6
There would be some other libraries but you will know in the beginning due to errors, sorry i don't remember all of them.

4. Download the SDK from http://developer.android.com/sdk/index.html any latest will do.

5. Download the NDK from https://www.crystax.net/download/android-ndk-r7-crystax-5.beta3-linux-x86.tar.bz2
Please dont use any other NDK.

6.Create Four directories, one for SDK and another for NDK and extract the files we downloaded there, third one for ToolChain and fourth for TarBall

7. Install latest JRE and JDK

8. Now we need to setup SDK, remember the folder,, replace with <android-sdk> with real folder name
Code:
cd <android-sdk>/tools
./android update sdk -u -t platform,platform-tool

9. Now setup NDK, so replace <android-ndk> with the correct folder name and <android-toolchain> with toolchain name

Code:
cd <android-ndk>
cd build/tools
./make-standalone-toolchain.sh --ndk-dir=../../  --install-dir=<android-toolchain> --platform=android-9

my example looks like ./make-standalone-toolchain.sh --ndk-dir=../../ --install-dir=/opt/toolchainF --platform=android-9


10. now we need download the source code, we need to download the Frodo Branch, give a name to <SourceCodefolder>

Code:
cd $HOME
git clone -b Frodo git://github.com/xbmc/xbmc.git <SourceCodefolder>
cd <SourceCodefolder>
git submodule update --init addons/skin.touched

11. Now we build dependencies

Code:
cd $HOME/<SourceCodefolder>/tools/android/depends
./bootstrap
sudo ./configure --with-tarballs=<pathToTarFolder> --with-sdk=<pathToSDK> --with-ndk=<pathToNDK> --with-toolchain=<pathTotoolchain>


my example looks like,
sudo ./configure --with-tarballs=/opt/xbmc-tarballsF --with-sdk=/opt/android-sdk-linux --with-ndk=/opt/android-ndk-r7-crystax-5.beta3 --with-toolchain=/opt/toolchainF

12. finally make, i have tried with -j20 and etc but it worked with single threaded so give it a try.
Code:
sudo make

13. It will take long time and might stop working, i tried sudo make clear and couple of times went back to step 11 when nothing was working.
you can try clear on specific libraries. If and when you see that <sourceFolder>/tools/android/target/librtmp is filled with source code and it compiling then you can start modifying the rtmp source to produce the library. you need to make sure that openssl was compiled successfully.

When the compilation of RTMP works then you will find the binary file in <toolchainFolder>/staging/armeabi-v7a/lib

Thank you so much.

It appears I was following all of the correct steps, except I didn't realize the importance of the Java pieces as much, but the biggest difference was, I was using the official r9 SDK because the readme's kept making a big deal even saying somewhere "We no longer use Crystax" or wording of that nature.

I've been using Crystax's since the beginning to make the original Android librtmp's mainly because I heard the default one has funky C implantation and that often causes librtmp to "blow up" when attempting to compile.
(2014-03-23, 19:40)RedPenguin Wrote: [ -> ]
(2014-03-23, 18:19)Shani-08 Wrote: [ -> ]Your experience is not quite different than mine, Gotham build was 100 times better and quicker. I had to reset my environment twice as i suspected something is a miss and it was complaining about everything that i could think off. However, these are the steps, not different than xbmc's ready me.
My environment, Windows Pc 64bit, with VirtualBox running Ubuntu 13.10 64 bit
Here are the steps, this is just to get RTMP compiled, the goal is not to create apk, therefore we will ignore errors or stop compiling as soon as rtmp has compiled. you are welcome to go through the readme and do the needful.

1. I followed this Read me, so anything not clear or requires more info, have a look here https://github.com/xbmc/xbmc/blob/Frodo/...ME.android

2. from the readme perform step two
Code:
sudo apt-get install build-essential default-jdk git curl autoconf unzip zip zlib1g-dev gawk gperf cmake

3. also install the following as well
Code:
sudo apt-get install lib32stdc++6
There would be some other libraries but you will know in the beginning due to errors, sorry i don't remember all of them.

4. Download the SDK from http://developer.android.com/sdk/index.html any latest will do.

5. Download the NDK from https://www.crystax.net/download/android-ndk-r7-crystax-5.beta3-linux-x86.tar.bz2
Please dont use any other NDK.

6.Create Four directories, one for SDK and another for NDK and extract the files we downloaded there, third one for ToolChain and fourth for TarBall

7. Install latest JRE and JDK

8. Now we need to setup SDK, remember the folder,, replace with <android-sdk> with real folder name
Code:
cd <android-sdk>/tools
./android update sdk -u -t platform,platform-tool

9. Now setup NDK, so replace <android-ndk> with the correct folder name and <android-toolchain> with toolchain name

Code:
cd <android-ndk>
cd build/tools
./make-standalone-toolchain.sh --ndk-dir=../../  --install-dir=<android-toolchain> --platform=android-9

my example looks like ./make-standalone-toolchain.sh --ndk-dir=../../ --install-dir=/opt/toolchainF --platform=android-9


10. now we need download the source code, we need to download the Frodo Branch, give a name to <SourceCodefolder>

Code:
cd $HOME
git clone -b Frodo git://github.com/xbmc/xbmc.git <SourceCodefolder>
cd <SourceCodefolder>
git submodule update --init addons/skin.touched

11. Now we build dependencies

Code:
cd $HOME/<SourceCodefolder>/tools/android/depends
./bootstrap
sudo ./configure --with-tarballs=<pathToTarFolder> --with-sdk=<pathToSDK> --with-ndk=<pathToNDK> --with-toolchain=<pathTotoolchain>


my example looks like,
sudo ./configure --with-tarballs=/opt/xbmc-tarballsF --with-sdk=/opt/android-sdk-linux --with-ndk=/opt/android-ndk-r7-crystax-5.beta3 --with-toolchain=/opt/toolchainF

12. finally make, i have tried with -j20 and etc but it worked with single threaded so give it a try.
Code:
sudo make

13. It will take long time and might stop working, i tried sudo make clear and couple of times went back to step 11 when nothing was working.
you can try clear on specific libraries. If and when you see that <sourceFolder>/tools/android/target/librtmp is filled with source code and it compiling then you can start modifying the rtmp source to produce the library. you need to make sure that openssl was compiled successfully.

When the compilation of RTMP works then you will find the binary file in <toolchainFolder>/staging/armeabi-v7a/lib

Thank you so much.

It appears I was following all of the correct steps, except I didn't realize the importance of the Java pieces as much, but the biggest difference was, I was using the official R9 SDK because the readme's kept making a big deal even saying somewhere "We no longer use Crystax" or wording of that nature.

I've been using Crystax's since the beginning to make the original Android librtmp's mainly because I heard the default one has funky C implantation and that often causes librtmp to "blow up" when attempting to compile.

You're welcome. Well, if you want to spend a whole night compiling then do anything other than Crystax for Frodo, But Gotham, is totally another beast which requires that you use google's sdk and ndk. Perhaps, you got confused same way as i did, when i read the readme of Frodo ,having worked on Gotham already, i thought they are talking about same sdk/ndk and went ahead with official one... what a waste of time that was?!!?
(2014-03-23, 19:46)Shani-08 Wrote: [ -> ]You're welcome. Well, if you want to spend a whole night compiling then do anything other than Crystax for Frodo, But Gotham, is totally another beast which requires that you use google's sdk and ndk. Perhaps, you got confused same way as i did, when i read the readme of Frodo ,having worked on Gotham already, i thought they are talking about same sdk/ndk and went ahead with official one... what a waste of time that was?!!?

Also I noticed I was most likely using the Gotham code, thinking my buddy uses Gotham for libstagefright but I didn't realize all you really did was mainly compile the librtmp. For some reason I was under the assumption you were compiling the entire XBMC. But now it all makes sense now.
Yep. not full XBMC, just the dependencies. That includes the librtmp and dependent binraries that it requires, mainly crypto and ssl etc.
I could have done better job by just compiling librtmp and couple of binaries but i wasn't brave enough.

Now that i understand more, i should be able to find best way to compile, would be 5 mins job, if it works. Smile

-shani

(2014-03-23, 20:28)RedPenguin Wrote: [ -> ]
(2014-03-23, 19:46)Shani-08 Wrote: [ -> ]You're welcome. Well, if you want to spend a whole night compiling then do anything other than Crystax for Frodo, But Gotham, is totally another beast which requires that you use google's sdk and ndk. Perhaps, you got confused same way as i did, when i read the readme of Frodo ,having worked on Gotham already, i thought they are talking about same sdk/ndk and went ahead with official one... what a waste of time that was?!!?

Also I noticed I was most likely using the Gotham code, thinking my buddy uses Gotham for libstagefright but I didn't realize all you really did was mainly compile the librtmp. For some reason I was under the assumption you were compiling the entire XBMC. But now it all makes sense now.
(2014-03-23, 20:35)Shani-08 Wrote: [ -> ]Yep. not full XBMC, just the dependencies. That includes the librtmp and dependent binraries that it requires, mainly crypto and ssl etc.
I could have done better job by just compiling librtmp and couple of binaries but i wasn't brave enough.

Now that i understand more, i should be able to find best way to compile, would be 5 mins job, if it works. Smile

-shani

(2014-03-23, 20:28)RedPenguin Wrote: [ -> ]
(2014-03-23, 19:46)Shani-08 Wrote: [ -> ]You're welcome. Well, if you want to spend a whole night compiling then do anything other than Crystax for Frodo, But Gotham, is totally another beast which requires that you use google's sdk and ndk. Perhaps, you got confused same way as i did, when i read the readme of Frodo ,having worked on Gotham already, i thought they are talking about same sdk/ndk and went ahead with official one... what a waste of time that was?!!?

Also I noticed I was most likely using the Gotham code, thinking my buddy uses Gotham for libstagefright but I didn't realize all you really did was mainly compile the librtmp. For some reason I was under the assumption you were compiling the entire XBMC. But now it all makes sense now.

Wow, I know I already thanked you but I have to thank you again, LoL.

I followed your steps and it seems the Frodo vs the Gotham actually is compiling properly.

I could be wrong but it felt like to me the Gotham kept trying to compile with Ubuntu's own gcc vs the toolchain.
Thanks again. Now I am patiently waiting to thank you again when you release your binaries for android Smile
(2014-03-23, 21:48)Shani-08 Wrote: [ -> ]Thanks again. Now I am patiently waiting to thank you again when you release your binaries for android Smile

Everything worked like a charm, but now comes the fun part getting the patch into the librtmp code, as a normal patching gives tons of "FAILED" and is giving me rej files.
Ah, for that I did this both for frodo and Gotham.
Start with Gotham, Get the 2.3 code, apply ksv and your personal changes. Now apply Apply couple of changes manually, which exists rtmp.c file where they are checking specific website, copy that from xbmc into your new code and that's it.

I did my best to compare and it seems to me that they either had same patches or less hence no point in apply patches in the xbmc code.
I did this for Gotham and then used the same Gotham code for frodo.
Simples!!
(2014-03-23, 19:39)Shani-08 Wrote: [ -> ]Glad to see its not crashing.
There is an addon under my repo (jagobd.com), some bangladeshi streams, so perhaps you wont understand a thing Smile but most of it channels requires new rtmp file.
try that and see if videos playing for you.
You can get my repo from fusion, look in /world/Pakistani

Every channel I tried it worked, great job!. Now I have to create an apk with that, I tried to create one but I am getting parse error when I try to execut it :S
Hi,does this file work for android too?
Thanks.
It works only on Android actuallySmile but this is for Frodo. For Gotham beta there is a file in few posts back..

(2014-03-24, 14:37)patria o muerte Wrote: [ -> ]Hi,does this file work for android too?
Thanks.

(2014-03-24, 14:30)kokoui Wrote: [ -> ]
(2014-03-23, 19:39)Shani-08 Wrote: [ -> ]Glad to see its not crashing.
There is an addon under my repo (jagobd.com), some bangladeshi streams, so perhaps you wont understand a thing Smile but most of it channels requires new rtmp file.
try that and see if videos playing for you.
You can get my repo from fusion, look in /world/Pakistani

Every channel I tried it worked, great job!. Now I have to create an apk with that, I tried to create one but I am getting parse error when I try to execut it :S

Are you trying creating an apk for XBMC or only for librtmp? I am not sure if we can do this, if its allowed then it would be great as you don't have to create APK for xbmc and a small apk for librtmp would do the job . I will look into later when i get time.
I think he's talking about compile the whole xbmc with the new librtmp.

Well I'm creating an addon module to use this external librtmp and avoid the original lib. This allows the rtmp streaming without replacing this file.
(2014-03-24, 15:31)Shani-08 Wrote: [ -> ]It works only on Android actuallySmile but this is for Frodo. For Gotham beta there is a file in few posts back..

(2014-03-24, 14:37)patria o muerte Wrote: [ -> ]Hi,does this file work for android too?
Thanks.

(2014-03-24, 14:30)kokoui Wrote: [ -> ]
(2014-03-23, 19:39)Shani-08 Wrote: [ -> ]Glad to see its not crashing.
There is an addon under my repo (jagobd.com), some bangladeshi streams, so perhaps you wont understand a thing Smile but most of it channels requires new rtmp file.
try that and see if videos playing for you.
You can get my repo from fusion, look in /world/Pakistani

Every channel I tried it worked, great job!. Now I have to create an apk with that, I tried to create one but I am getting parse error when I try to execut it :S

Are you trying creating an apk for XBMC or only for librtmp? I am not sure if we can do this, if its allowed then it would be great as you don't have to create APK for xbmc and a small apk for librtmp would do the job . I will look into later when i get time.

Yep i amtrying to built an xbmc apk with the custom file but with no success at the moment;(