Guide - how to compile TVVLCKit build from Dec 28 2015

iOS, iPad, iPhone, tvOS specific usage questions
shaybc
Blank Cone
Blank Cone
Posts: 39
Joined: 27 Mar 2016 13:59

Guide - how to compile TVVLCKit build from Dec 28 2015

Postby shaybc » 31 Mar 2016 08:42

at last after fighting with this framework - i got it to compile,

this is how the terminal looks after the second run of the buildMobileVLCKit.sh is done:

[info] ...vlc_entry__attachment
[info] ...vlc_entry__asf
[info] ...vlc_entry__araw
[info] ...vlc_entry__amem
[info] ...vlc_entry__aiff
[info] ...vlc_entry__afile
[info] ...vlc_entry__aes3
[info] ...vlc_entry__adpcm
[info] ...vlc_entry__adjust
[info] ...vlc_entry__adaptative
[info] ...vlc_entry__file
[info] ...vlc_entry__access_mms
[info] ...vlc_entry__concat
[info] ...vlc_entry__a52
[info] all done


and this is what you should receive after executing the xcodebuild commands (in the terminal):

** BUILD SUCCEEDED **


after my success i don’t want other developers to experience what i went through, so i constructed a complete guide here which you can use as a shell script to fully automate the build of TVVLCKit from date: Dec 28, 2015, these are the steps:
  • 1. first make sure to download Xcode 7.2.1 from here: http://adcdownload.apple.com/Developer_ ... _7.2.1.dmg
    2. copy the Xcode app you just downloaded in to the /Applications folder (rename your current Xcode to Xcode.7.3 or whatever)
    3. open terminal (from /Applications/Utilities/Terminal)
    4. test to make sure you have the TVOS ver 9.1 by running the next command:
    5. xcodebuild -showsdks
    6. make sure a line similar to this appear: “tvOS 9.1 -sdk appletvos9.1”
    7. now i suggest you to copy and paste the following commands one at a time into the terminal window and wait for each command to finish before you execute the next

Code: Select all

# note these instructions are in order to compile TVVLCKit last version of 2015 from last checkin date at: Dec 28, 2015 # Stage 1 git clone http://code.videolan.org/videolan/VLCKit.git cd VLCKit git checkout 24382764560f4c6197362fed9f1adcbbf60a1bbc ./buildMobileVLCKit.sh -t curl -f -L -- "http://live555.com/liveMedia/public/live555-latest.tar.gz" > "MobileVLCKit/ImportedSources/vlc/contrib/tarballs/live.2015.11.09.tar.gz" cd MobileVLCKit/ImportedSources/vlc/contrib/tarballs shasum -a 512 "live.2015.11.09.tar.gz" > ../src/live555/SHA512SUMS cd ../../../../.. sed -i .bak 's/git pull --rebase/#git pull --rebase/;s/git reset --hard ${TESTEDHASH}/#git reset --hard ${TESTEDHASH}/' buildMobileVLCKit.sh sed -i .bak -e '/git reset --hard ${TESTEDHASH}/{' -e 'n;s?git am ../../patches/\*.patch?#git am ../../patches/\*.patch?' -e'}' buildMobileVLCKit.sh cd MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/gsm/src cp code.c code.bak echo -e "#include <string.h>\n$(cat code.c)" > code.c cd ../../../../../../.. ./buildMobileVLCKit.sh -t cd Sources sed -i .bak 's/_url = \[NSURL fileURLWithPath:_url\];/_url = \[NSURL fileURLWithPath:urlString\];/‘ VLCMedia.m sed -i .bak 's/@(titleInfo\[i\]->i_flags & libvlc_title_menu),/@(titleInfo\[i\]->b_menu),/' VLCMediaPlayer.m cd .. # Stage 2: xcodebuild -project "MobileVLCKit.xcodeproj" -target "TVVLCKit" -sdk appletvos9.1 -configuration Release ARCHS="arm64" IPHONEOS_DEPLOYMENT_TARGET=9.1 GCC_PREPROCESSOR_DEFINITIONS="" xcodebuild -project "MobileVLCKit.xcodeproj" -target "TVVLCKit" -sdk appletvsimulator9.1 -configuration Release ARCHS="x86_64" IPHONEOS_DEPLOYMENT_TARGET=9.1 GCC_PREPROCESSOR_DEFINITIONS="" cd build rm -rf TVVLCKit.framework mkdir TVVLCKit.framework lipo -create Release-appletvos/libTVVLCKit.a Release-appletvsimulator/libTVVLCKit.a -o TVVLCKit.framework/TVVLCKit chmod a+x TVVLCKit.framework/TVVLCKit cp -pr Release-appletvos/TVVLCKit TVVLCKit.framework/Headers
the end result of this process should produce a file named: TVVLCKit.framework in size of about 724.1 MB in folder: /VLCKit/build
then you can add it to your Xcode project with other frameworks and have at last a player that plays rtmp,mkv and other exotic stream and file formats,

please note: if you would like to compile the latest version then just remove the line:
git checkout 24382764560f4c6197362fed9f1adcbbf60a1bbc
and after the first run of buildMobileVLCKit.sh script goto "# stage 2:" and continue commands from there (without the middle part)

hope this will help some of you building this framework
(admins - i suggest you pin this one down)

gavla
New Cone
New Cone
Posts: 7
Joined: 23 Apr 2016 15:53

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby gavla » 23 Apr 2016 17:36

Hi thanks for your hard work, I'm also having the same issue you had, would you consider forwarding the resulting framework as my frustration levels are starting to build :)

I am getting fail msg on this command
cd MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/gsm/src
No such file or dir

Thanks for your help

shaybc
Blank Cone
Blank Cone
Posts: 39
Joined: 27 Mar 2016 13:59

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby shaybc » 24 Apr 2016 16:39

not sure this is the right way to go (sharing compiled files) i think it can create problems in the end result project, but i am not sure, however, since i know where are you coming from, here is a link to all compiled versions i successfully created (build folder with the simulator, appletv builds, in the framework or .a forms): https://goo.gl/z7Q0oN

what you need to do is to add the /build/Release-appletvos/libTVVLCKit.a into your target's project from xcode: "General" -> "Linked Frameworks and Libraries"

hope this promotes your goal a little further.

gavla
New Cone
New Cone
Posts: 7
Joined: 23 Apr 2016 15:53

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby gavla » 24 Apr 2016 23:46

Thank you so much for the reply and your frameworks and libs play beautifully on device and sim, the issue is when I come to export this Archive as Xcode throws me an error saying either the framework or lib is not compiled with bit code (required for TVOS, no option to disable). This is so annoying as I know your libs and my project work great but I just can't seem to compile TVVLCKit at this moment with or without bit code, i already appreciate what you've already done but if you could shed any more light on this I would be soo grateful. Also I'm sure your link is filling you cloud space and I have the file now so feel free to relieve you cloud of the space used.

here is the error Xcode throws at me:

ld: bitcode bundle could not be generated because '/Users/APPNAME/TVVLCKit.framework/TVVLCKit(VLCEventManager.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Again thanks for the reply

Gav

shaybc
Blank Cone
Blank Cone
Posts: 39
Joined: 27 Mar 2016 13:59

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby shaybc » 25 Apr 2016 01:04

hi gavla,
so i am guessing this: http://stackexchange.com/users/2096973/gav?tab=activity is you ;-)

the compiled versions i have shared are bitCode enabled, but just in case i made a mistake and shared the previous builds - i have recompiled everything in release mode and shared it again into my dropbox (https://goo.gl/z7Q0oN),
give it about 20 min to upload and then let me know if there is something else i can do for you,

b.t.w. - i would love to receive a promo code to your app once its in the air :-)

Good Luck,
Shay.BC.

gavla
New Cone
New Cone
Posts: 7
Joined: 23 Apr 2016 15:53

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby gavla » 25 Apr 2016 17:06

Haha yes Thats so me and I was sooooo suck with this which makes you a life saver & a champion, and a promo code is the least I can do, but I't still throws the same error:
ld: bitcode bundle could not be generated because '/Users/APPNAME/TVVLCKit.framework/TVVLCKit(VLCEventManager.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I also got the same error when adding libTVVLCKit.a & Headers.

from this I assume you have to enable bit code in the .sh options ./buildMobileVLCKit.sh -t -b where -b is the "enable bit code" if you have already done this then I'm even more lost that I first thought :)

Again thank you sooo much for the help

shaybc
Blank Cone
Blank Cone
Posts: 39
Joined: 27 Mar 2016 13:59

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby shaybc » 26 Apr 2016 03:28

Ok, so thanks to this: http://stackoverflow.com/a/31486233/530884 i understand that the build process is not enough for bitcode compile,
so i did an archive just of the libTVVLCKit.a itself and extracted it from the xCode organizer and put the result in my drop box in the same place (https://goo.gl/z7Q0oN) under folder: "Archive-appletvos"

use it - hopefully this will solve it for you.
although when i checked the command: "otool -l libTVVLCKit.a | grep __LLVM | wc -l" resulted with the same amount of LLVM entries on both .a files (so i am interested to hear what the result is)

but i want you to have a fully working solution for next times, so i will share my entire compiled project so you can re compile it again and again, i will write another answer shortly,

let me know how it goes,
Shay.BC.
Last edited by shaybc on 26 Apr 2016 14:46, edited 1 time in total.

shaybc
Blank Cone
Blank Cone
Posts: 39
Joined: 27 Mar 2016 13:59

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby shaybc » 26 Apr 2016 03:40

i compile the libTVVLCKit.a every time i am building my app from xCode - i have included the MobileVLCKit project into mine by copying the folder under my project folder and simply dragging the .xproj file into my project tree, then i went to my project icon from the project navigator tree, selected my target, displayed general tab and added the libTVVLCKit.a in “Linked Frameworks and libraries” and thats it.

Image

so what i would like to do is to supply you with the entire build folder (in a state that it has downloaded the code from git and downloaded all the imported sources and dependencies) so you would be able to compile it again on your computer,

so i have shared the "buildTVVLCKit 2.zip" its huge (2.57 G !! after you extract it it will get up to 5.5 G) so give it about an hour to finish upload and then download it, save it and work on a copy (cuz i need my space on dropbox, i will try to hold it for as much as i can, but eventually i will delete it, i guess i can hold it for at least 2-3 days)

so in the zip you will find a build script and a folder containing EVERYTHING !!

the build script is outside of the folder, so do this:

Code: Select all

1. extract the "buildTVVLCKit 2.zip" 2. open the file: build_tvvlckit.sh (preferably with xCode but you can do it with textEdit or whatever) 3. open terminal (i usually do sudo -s at this point) 4. cd to the extracted folder 5. start executing the commands (MANUALLY!! one by one) from this line at the script: "# >>>>> gavla, start from here <<<<<<<" (do not start from the top or it will redownload all the files) 6. at the end you should find the .a and .framework files in the folder: "buildTVVLCKit 2/VLCKit/build"
and if this succeed to compile - then take the folder: “VLCKit” (which is under “buildTVVLCKit 2” and move / copy it under your project folder and do the process i described at the beginning of this post,

let me know what happens,

Shay.BC.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby ssbmaccom » 26 Apr 2016 19:00

just worth to mention.
- there is a bug in the event dispatcher in that release, this causes 95% of the crashes of my app in the field (currently about 800 downloads). I havent seen this with the latest build i am currently using ofr building the update.
- replace libstdc++ with libc++, the latter give good performance even with later versions of VLCKit.
- when you build from HEAD and this one fails, restart the build with the -n option, sometimes it takes several attempts to finish the build
- add the ENABLE-BITCODE=1 option when using xcodebuild for tvOS, but skip it when building for simulator, might be, that the option is spelled slightly differently, i would need to look it up again, but i am currently not at my machine.

OK, it is off-topic, but give later releases a try. The only issue is, that still the framerate_num or framrerate_denom are reported incorrectly, it says a 720p stream runs at 100 fps. For interlace video the result is ok. But so far I haven't seen any issues with later builds now.
Only remaining issue, not caused by VLCKit is, that playback starts jittering when there is a lot of traffic on my home network. This started with latest tvOS. Happens mostly, when a TimeMachine backup is running while watching TV. All devices use LAN.

gavla
New Cone
New Cone
Posts: 7
Joined: 23 Apr 2016 15:53

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby gavla » 26 Apr 2016 21:21

Thats amazing and so are you, you champion :) it worked like a dream when I add the lib*.a files for both archive & build for device and sim so here comes a rookie question so I apologise in advance, I followed your instructions for adding the .xcodeproj to my project and added the lib to the linked frameworks but I really couldn't find which #import to use to access the lib or headers in obj-c I'm so sorry for continuing to bother you. And thank you 100 times for the success you've already helped me with.

Gav

shaybc
Blank Cone
Blank Cone
Posts: 39
Joined: 27 Mar 2016 13:59

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby shaybc » 26 Apr 2016 22:00

no need to thank, this is why these forums are here for, some of these grate developers here helped me, and this is my way of giving back (just try to do the same when you are in a giving spot :-)

regarding your question:

i use swift so i have a bridge header and i include the main header that include the rest of them (this should also work for you):

Code: Select all

#import <TVVLCKit/TVVLCKit.h>
if i were you i would import it in my *_Prefix.pch file, this way it will be available in every point of your project
(reference: http://stackoverflow.com/questions/2364 ... e-in-xcode)

Shay.BC.

gavla
New Cone
New Cone
Posts: 7
Joined: 23 Apr 2016 15:53

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby gavla » 26 Apr 2016 22:25

I'm really missing iOS development as I have being the noob again but theres no prefix.pch although my main is still there but i've tried every combination of imports that is around #import <XXX> #import"XXX" @import XXX; it just can't see the lib unless you can spot where I've mage the error below

Image

Image

Again thank you so much for your time... Gav

shaybc
Blank Cone
Blank Cone
Posts: 39
Joined: 27 Mar 2016 13:59

Re: Guide - how to compile TVVLCKit build from Dec 28 2015

Postby shaybc » 27 Apr 2016 00:38

first of all, make sure the TVVLCKit project you added was really copied to your project file hierarchy,

second - make sure that when you build or run your app - that the VLC project is being built as well, search for this:

Image


last: make sure you have the VLCKit root folder in your targets "Build Settings" under "Header Search Paths" like this:

Image

then you can make an import from your objective-c code like this:

Code: Select all

#import <TVVLCKit/TVVLCKit.h> or like this: #import "TVVLCKit/TVVLCKit.h"
so the imports are relative to the search path.

p.s.
as you can see i can show you my app name (since it is already on the App Store and its simple to connect shay.bc with Stream-TV, almost as easy to connect gavla with... just kidding :-) )

good luck.


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 17 guests