Skip to content

Instantly share code, notes, and snippets.

@lg
Last active April 5, 2020 15:48
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lg/5c8c8e24355e07d68042 to your computer and use it in GitHub Desktop.
Save lg/5c8c8e24355e07d68042 to your computer and use it in GitHub Desktop.
Building MobileVLCKit for AppleTV: TVVLCKit
# note these instructions are as of Dec 28, 2015
# the vlc and vlckit repos are super complex and have thousands of dependencies from everywhere on the internet.
# so, you'll need to mess with things a bit
git clone http://code.videolan.org/videolan/VLCKit.git
cd VLCKit
./buildMobileVLCKit.sh -t
# it might then error after a a few minutes with a live555 build problem.
# fix it by manually downloading the .tar.gz live555 from their website: http://live555.com/liveMedia/public/
# and put it into MobileVLCKit/ImportedSources/vlc/contrib/tarballs/
# and do a 'shasum -a 512' on the tar.gz file and update the SHA in MobileVLCKit/ImportedSources/vlc/contrib/src/live555/SHA512SUMS
# and update MobileVLCKit/ImportedSources/vlc/contrib/src/live555/rules.mak to use this new filename
# and comment out these lines from buildMobileVLCKit.sh:
# git pull --rebase
# git reset --hard ${TESTEDHASH}
# git am ../../patches/*.patch
# then run it again
./buildMobileVLCKit.sh -t
# you'll notice nothing gets built at the end. to make the actual .a files:
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=""
# then make the .framework file:
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
# then copy the TVVLCKit.framework into your project
# then open the SimplePlayback iOS example and import all the same frameworks into your appletv project (a couple might not exist on apple tv, thats ok)
# for swift, add a bridging header and add '#import <TVVLCKit/TVVLCKit.h>' to it
# the code for a simple video to start playing:
# this goes in the class definitions
# let mp = VLCMediaPlayer()
# this goes in the playback method
# mp.drawable = window!
# mp.media = VLCMedia(URL: NSURL(string: "http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4"))
# mp.play()
# i have a sample project up (it's big because the libs are huge):
# http://cl.ly/2D3e29113B2O
# note that i have a 4GB/day limit on cloudapp, so you might need to try again tomorrow if im out of bw
@dmatveichev
Copy link

Work fine even with no " live555 build problem"! BUT...
When I try to archive project I have an error:
ld: bitcode bundle could not be generated because '~/xCode/ProjectName/TVVLCKit.framework/TVVLCKit(VLCMedia.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)

Can you help to fix it?

@dmatveichev
Copy link

ok, seems I fixed it.
Just add BITCODE_GENERATION_MODE=bitcode
to the lines:
xcodebuild -project "MobileVLCKit.xcodeproj" ....

Copy link

ghost commented Sep 28, 2016

I got the error
dyld: Symbol not found: _clock_gettime
Referenced from: /Users/nxn/Desktop/VLC/VLCKit/VLCKit/MobileVLCKit/ImportedSources/vlc/extras/tools/build/bin/xzcat (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib

make: *** [ffmpeg] Error 1
xcodebuild: error: SDK "appletvos9.1" cannot be located.
xcodebuild: error: SDK "appletvsimulator9.1" cannot be located.
build_tvvlckit.sh: line 31: cd: build: No such file or directory
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: Release-appletvos/libTVVLCKit.a (No such file or directory)
chmod: TVVLCKit.framework/TVVLCKit: No such file or directory
cp: Release-appletvos/TVVLCKit: No such file or directory

Can you help to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment