tvos compilation problem

iOS, iPad, iPhone, tvOS specific usage questions
Vetru85
New Cone
New Cone
Posts: 7
Joined: 16 Nov 2015 21:04

Re: tvos compilation problem

Postby Vetru85 » 18 Nov 2015 11:13

Can you upload a libTVVLCkit.a file compiled with the archive function??
Or upload the complete package compiled!
Thanks a lot

Vibou
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Nov 2015 10:58

Re: tvos compilation problem

Postby Vibou » 18 Nov 2015 13:33

I have an issue with my current .a or i don't know but the player is only buffering it never play the rtsp stream. Weird it was workinig before with a previous version... Anyone experiences this issue ?

I m on tvOS 9.0
-- I put a delegate on both player and media here is what I got in my logs:
player buffering
media NothingSpecial
player playing
media playing
player buffering
media playing
player buffering
media playing

here is some part of my code

on my viewDidLoad I put
I have a UIView named playerView.

Code: Select all

@IBOutlet weak var playerView: UIView!{ didSet{ player.drawable = playerView } } func playMedia(){ let media = VLCMedia(URL: validatedStreamInfo.stream) self.player.media = media self.player.play()
This code was working with a VLCKit from 2 weeks ago, and not anymore...
I ve got no error and the logs said that media playing and player buffering. Weird...

Vibou
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Nov 2015 10:58

Re: tvos compilation problem

Postby Vibou » 18 Nov 2015 16:12

This guy solve my issue sorry for cross posting.
https://forum.videolan.org/viewtopic.ph ... 9&p=433850

Vibou
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Nov 2015 10:58

Re: tvos compilation problem

Postby Vibou » 18 Nov 2015 17:36

Here is my advice to successfuly build VLCKit
1. Start from a clear directory
2. Git clone the repository

before diving into building change 2 things:
In the VLCMedia.m file in the Source folder change things accordingly to this post: https://forum.videolan.org/viewtopic.ph ... 9&p=433850

In the VLCMediaPlayer.h in the header folder add an import to

Code: Select all

#import "UIKit/UIKit"

3. launch the script with "./buildMobileVLCKit.sh -t" at least 2 or 3 times (it will fail)
4. launch the script with "./buildMobileVLCKit.sh -t -s" at least 2 times
5. launch the script with "./buildMobileVLCKit.sh -t" this time it should work and it should end with:

Code: Select all

[info] ...vlc_entry__adaptative [info] ...vlc_entry__file [info] ...vlc_entry__access_mms [info] ...vlc_entry__concat [info] ...vlc_entry__a52 [info] all done
6. launch the script with "./buildMobileVLCKit.sh -t -s" this time it should work too for the simulator and it should end with:

7. in XCode create a workspace. Add your project in it. Add VLCKit project in it too.
8. Change the build settings for VLCKit to use tvOS:
Base SDK -> latest tvOS
Architectures: Std architectures (arm64)

8.2 In the build settings view select the target MobileVLCKit in the linking section change Other all librarian Flags from
$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios-iPhone/*
to
$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios-AppleTV/core/libcompat.a

9. Build MobileVLCKit as generic tvOSDevice and all other target (repeat the 8.2 for all target if necessary)

I think for apple TV you only need to build TVVLCKit but if you want to have the whole library compiling for tvOS here is how to do so.

Be careful though because VideoToolbox is not available on tvOS !

If someone has better workaround I would love to hear them !

Vetru85
New Cone
New Cone
Posts: 7
Joined: 16 Nov 2015 21:04

Re: tvos compilation problem

Postby Vetru85 » 18 Nov 2015 18:39

Amazing ... I am continuing to try building...it always goes wrong.
Help me plaese!!

@vibou: can you upload for me your complete folder at the end of step 6? please...

Vibou
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Nov 2015 10:58

Re: tvos compilation problem

Postby Vibou » 18 Nov 2015 19:31

the folder is more than 5gigs big so it s a little bit complicated to submit. However can you give me a hint on the last error you got ? If no error appear, try to find in the console log somewhere where an error occurs. It can help to find out why it does not build.

Vetru85
New Cone
New Cone
Posts: 7
Joined: 16 Nov 2015 21:04

Re: tvos compilation problem

Postby Vetru85 » 18 Nov 2015 21:52

i have followed your instructions but the fifth block me.I receive many errors from the building and it is impossible for me to report them.

The my final folder is 2gb..much less of your :(

Vetru85
New Cone
New Cone
Posts: 7
Joined: 16 Nov 2015 21:04

Re: tvos compilation problem

Postby Vetru85 » 19 Nov 2015 18:01

@matrog please,can you generate and upload a new libTVVLCKit.a file with bitcode??

Vibou
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Nov 2015 10:58

Re: tvos compilation problem

Postby Vibou » 19 Nov 2015 22:07

Would be great to understand why it is blocking can you post the log of the build somewhere?

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 21 Nov 2015 08:29

try this, it should have bitcode enabled

https://mega.nz/#!GFwGRBhL!UHKjsLoyR_-F ... MxZHkpSLWU

Vetru85
New Cone
New Cone
Posts: 7
Joined: 16 Nov 2015 21:04

Re: tvos compilation problem

Postby Vetru85 » 23 Nov 2015 18:06

It works ! Thanks a lot!

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: tvos compilation problem

Postby ssbmaccom » 26 Nov 2015 16:46

Here is my advice to successfuly build VLCKit
1. Start from a clear directory
2. Git clone the repository

before diving into building change 2 things:
In the VLCMedia.m file in the Source folder change things accordingly to this post: https://forum.videolan.org/viewtopic.ph ... 9&p=433850

In the VLCMediaPlayer.h in the header folder add an import to

Code: Select all

#import "UIKit/UIKit"
...SNIP...
I am quite new to use and build VLCKit, especially for AppleTV.

Aside to some of the issues mentioned here I have seen the issue, that the mirror used to download Apache ant is not available anymore. I don't know, how important ant is for the build process, but it would make sense to change the scripts accordingly and switch to another mirror server.
The script is using "http://apache.mirrors.ovh.net/ftp.apach ... /binaries/" but using this in the browser gives a 404 Error. Switching to (for example) "http://archive.apache.org/dist/ant/binaries/" should fix this issue.

Also it looks like gas-preprcoessor should be available, which was quite easy to fix, but is not mentioned.

Anyway I tried several of the approaches mentioned above on my Mac and the build always failed at several stages and even if I follow above guide, I do not get the library built. Especially I see git errors, when I run "./buildMobileVLCKit.sh -t" more than once, which aborts the build. Git complains, that the new pull request can't be done, as unstaged changes are in my work copy of the vlc repository. As I don't change anything there, this may be caused, while the patches get applied. After the first build I always have to add "-n" to disable download activities.

On my side - I would also be fine to use a binary distribution of the TVVLCKit. The download offered above works, but it looks like it does not support the simulator, which would help me a lot in the development process. Adding simulator and offering the library again would solve my current urges.

Last not least - referring to the thread opener - I also was intending to build an App that supports my vu+ Solo2 STB, which is running Enigma2. Retrieving services info is already solved but the AVPlayer included in tvOS does not support the TS-Streams. So TVVLCKit would solve my problems. Maybe we both could cooperate on building this app for all the users of Enigma2 STBs.

[EDIT] last block is referring to the opener of the thread linked here. It anyway would be easiest when I try to get in touch with him directly.

Cheers,

SSB

mhergon
New Cone
New Cone
Posts: 6
Joined: 22 Nov 2015 22:25

Re: tvos compilation problem

Postby mhergon » 26 Nov 2015 17:58

Hi,

Could someone explain me how to integrate "libTVVLCKit.a" in a Swift project?

Thanks!

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: tvos compilation problem

Postby ssbmaccom » 26 Nov 2015 18:13

I do not use Swift at all (yet). But the official document provided by Apple shall describe the howto sufficiently. TVVLCKit simply implements a Obj-C class you can use from Swift like any other ObjC Class as provided by Cocoa Framework.

See: https://developer.apple.com/library/tvo ... 16-CH2-ID0
As far as I remember, that also was a session during WWDC15 about this topic. A video about this should be available online.

mhergon
New Cone
New Cone
Posts: 6
Joined: 22 Nov 2015 22:25

Re: tvos compilation problem

Postby mhergon » 27 Nov 2015 10:50

I do not use Swift at all (yet). But the official document provided by Apple shall describe the howto sufficiently. TVVLCKit simply implements a Obj-C class you can use from Swift like any other ObjC Class as provided by Cocoa Framework.

See: https://developer.apple.com/library/tvo ... 16-CH2-ID0
As far as I remember, that also was a session during WWDC15 about this topic. A video about this should be available online.
Hi ssbmaccom,

The problem is not the import. I don't know which of this options must be used:

Code: Select all

#import <MobileVLCKit/MobileVLCKit.h> #import <TVVLCKit/MobileVLCKit.h> #import "MobileVLCKit.h"
I tried with multiple options but nothing works...

mhergon
New Cone
New Cone
Posts: 6
Joined: 22 Nov 2015 22:25

Re: tvos compilation problem

Postby mhergon » 29 Nov 2015 12:28

Hi,

Anyone could upload a small example? (no need to include the library, only the references)

Thanks!

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: tvos compilation problem

Postby ssbmaccom » 30 Nov 2015 14:19

Now I finally was able to build livvlc for tvOS. Maybe I was not patient enough or something has been fixed in the meantime.

While building TVVLCKit I ran into the following issues:

Code: Select all

/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMedia.m:825:72: warning: 'stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in tvOS 9.0 - Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid. [-Wdeprecated-declarations] _url = [NSURL URLWithString:[[NSString stringWithUTF8String:p_url] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
This deprecated function should get replaced with something like:

Code: Select all

_url = [NSURL URLWithString:[[NSString stringWithUTF8String:p_url] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]];
I am not sure, which NSCharacterSet would be the best choice.

The below one looks a bit more difficult to me.

Code: Select all

/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:99:66: warning: undeclared selector 'mediaPlayerPositionChanged:' [-Wundeclared-selector] withMethod:@selector(mediaPlayerPositionChanged:) ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:143:66: warning: undeclared selector 'mediaPlayerMediaChanged:' [-Wundeclared-selector] withMethod:@selector(mediaPlayerMediaChanged:) ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:173:70: warning: undeclared selector 'mediaPlayerSnapshot:' [-Wundeclared-selector] withMethod:@selector(mediaPlayerSnapshot:) ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:177:80: warning: undeclared selector 'mediaPlayerSnapshot:' [-Wundeclared-selector] withDelegateMethod:@selector(mediaPlayerSnapshot:) ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:501:5: error: implicit declaration of function 'libvlc_video_set_textrenderer_bool' is invalid in C99 [-Werror,-Wimplicit-function-declaration] libvlc_video_set_textrenderer_bool(_playerInstance, libvlc_textrender_fontforcebold, [fontForceBold boolValue]); ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:501:5: note: did you mean 'libvlc_video_set_textrenderer_int'? In file included from /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1: In file included from /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit_Prefix.pch:9: In file included from /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit/ImportedSources/vlc/include/vlc/vlc.h:43: /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit/ImportedSources/vlc/include/vlc/libvlc_media_player.h:1528:17: note: 'libvlc_video_set_textrenderer_int' declared here LIBVLC_API void libvlc_video_set_textrenderer_int( libvlc_media_player_t *p_mi, ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:501:57: error: use of undeclared identifier 'libvlc_textrender_fontforcebold'; did you mean 'libvlc_textrender_fontcolor'? libvlc_video_set_textrenderer_bool(_playerInstance, libvlc_textrender_fontforcebold, [fontForceBold boolValue]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libvlc_textrender_fontcolor In file included from /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1: In file included from /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit_Prefix.pch:9: In file included from /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit/ImportedSources/vlc/include/vlc/vlc.h:43: /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit/ImportedSources/vlc/include/vlc/libvlc_media_player.h:1522:5: note: 'libvlc_textrender_fontcolor' declared here libvlc_textrender_fontcolor, ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1289:31: error: use of undeclared identifier 'libvlc_MediaPlayerChapterChanged' libvlc_event_attach(p_em, libvlc_MediaPlayerChapterChanged, HandleMediaChapterChanged, (__bridge void *)(self)); ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1315:31: error: use of undeclared identifier 'libvlc_MediaPlayerChapterChanged' libvlc_event_detach(p_em, libvlc_MediaPlayerChapterChanged, HandleMediaChapterChanged, (__bridge void *)(self)); ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1239:17: warning: method definition for 'mediaPlayerTitleChanged:' not found [-Wincomplete-implementation] @implementation VLCMediaPlayer (Private) ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:195:1: note: method 'mediaPlayerTitleChanged:' declared here - (void)mediaPlayerTitleChanged:(NSNumber *)newTitle; ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1239:17: warning: method definition for 'mediaPlayerChapterChanged:' not found [-Wincomplete-implementation] @implementation VLCMediaPlayer (Private) ^ /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:196:1: note: method 'mediaPlayerChapterChanged:' declared here - (void)mediaPlayerChapterChanged:(NSNumber *)newChapter; ^ 6 warnings and 4 errors generated. ** BUILD FAILED **
Well I was able to get it built by simply commenting out some stuff plus adding simple implementations for the two missing methods, which were already declared in the beginning of the file. They don't do anything wrathful, but anyway it is building now and simply won't send the notifications.

I assume this is work in progress, and things will get fixed soon.

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: tvos compilation problem

Postby ssbmaccom » 01 Dec 2015 10:00

Hi,

I did a brief testing of the new VLC builds on my AppleTV and my iPad.
On iPad I have seen a crash (report sent via the CrashReporter). Also performance was more than poor when trying to access a live stream from my STB using the services.m3u.
Also on AppleTV the performance was poor, even though it is connected to my LAN. Playback from my App using TVVLCKit is much better (fps of the stream).

Last not least, switching chapters (which would switch the channel in the m3u) is not working. Looks like vlc is too busy showing single frames to actually switch the chapter - or I was not patient enough.

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: tvos compilation problem

Postby ssbmaccom » 01 Dec 2015 10:13

ah, while building VLCKit from HEAD (not master, but the iOS-2.7 branch), I saw a crash in clang. I reported that to Apple.
I only have seen this on my private MBP, not on the company MBP.

I will retry on the company MBP now ;-)

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: tvos compilation problem

Postby ssbmaccom » 03 Dec 2015 08:46

Hi,
I tried to rebuild on Tuesday night, after the new beta VLC was available for iOS and tvOS via Testflight. This time building of libvlc was smooth for tvOS device and simulator. Great work, thanks. I also built TVVLCKit from HEAD (brnach iOS-2.7) and it also was building with a few warnings about not implemented methods.

I need to check, if I have built TVVLCKit with bitcode, otherwise I will try that. Then I can share the build result, if no-one else is capable of doing it. I just need to check, where Ican share the build result. libTVVLCKit.a as debug build with device and simulator is about 750 kByte in size. Too much for my usual cloud shares ;-)

Felix, I send some more details about my VLC for iOS and tvOS tests and things I have seen using TVVLCKit in my own APP project via Mail.

turbolag
New Cone
New Cone
Posts: 3
Joined: 09 Jan 2016 16:31

Re: tvos compilation problem

Postby turbolag » 09 Jan 2016 16:38

Any luck generating a lib for tvOS with bitcode?

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: tvos compilation problem

Postby ssbmaccom » 11 Jan 2016 23:22

At the moment, build is not that smooth anymore. build for the libVLC has to be triggered multiple times until it finishes. - hopefully...

@turbolag: simply build the TVVLCKit project with "Archive", then you will get a lib, stripped and with bitcode.

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 16 Jan 2016 09:29

At the moment, build is not that smooth anymore. build for the libVLC has to be triggered multiple times until it finishes. - hopefully...

@turbolag: simply build the TVVLCKit project with "Archive", then you will get a lib, stripped and with bitcode.
this procedure work fine....btw...here's the version with bitcode and simulator

https://mega.nz/#!CAxkmSxI!2JCXteEcK7rF ... zvVT__4MYk

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: tvos compilation problem

Postby ssbmaccom » 16 Jan 2016 16:36

Hi,

well, sometimes it works smoothly, sometimes the build of libVLC has to be started more than once until all is fine.

In my project I use a small script to perform the build of VLCKit (in a directory next to my Xcode project to keep the repository clean):

Code: Select all

cd .. if [ -d "./VLCKit" ] ; then # pull VLCKit repository cd "VLCKit" git pull else # clone the VLCKit repository git clone http://code.videolan.org/videolan/VLCKit.git cd "VLCKit" fi # build lbvlc for tvOS Device ./buildMobileVLCKit.sh -t # build lbvlc for tvOS Simulator, skipped # ./buildMobileVLCKit.sh -t -s xcodebuild -project MobileVLCKit.xcodeproj -target TVVLCKit -configuration Release # change directory to where ever want it get copied to cd <your project directory> # check if library built was successful, if yes, copy the build results # otherwise prompt a warning if [ -f "../../VLCKit/build/Release-appletvos/libTVVLCKit.a" ] ; then if [ -d "VLCKit" ] ; then rm -rf ./VLCKit/libTVVLCKit.a else mkdir "VLCKit" fi # copy build result into the project cp ../../VLCKit/build/Release-appletvos/libTVVLCKit.a ./VLCKit/libTVVLCKit.a cp ../../VLCKit/build/Release-appletvos/TVVLCKit/* ./VLCKit/TVVLCKit/ else echo "built was not not successful, please retry." fi
It does not create the library with bitcode and I skip to lipo with the simulator, as it is anyway unsuitable for testing (poor performance). Bitcode creation has to be done manually to grap the final library for AppStore submission. That's feasible IMHO.

And sometimes this works fine for builds from scratch (empty directory) and with updates (not removing the VLCKit directory.
But sometimes this build fails - in that case I do not replace the old library, so I can continue to work on it.

obia
Blank Cone
Blank Cone
Posts: 20
Joined: 11 Apr 2014 13:34

Re: tvos compilation problem

Postby obia » 19 Jan 2016 16:59

Strange, I downloaded add linked to this library but still get the error when I'm archiving:

Code: Select all

bitcode bundle could not be generated because '/xxx/xxx/libTVVLCKit.a(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)
At the moment, build is not that smooth anymore. build for the libVLC has to be triggered multiple times until it finishes. - hopefully...

@turbolag: simply build the TVVLCKit project with "Archive", then you will get a lib, stripped and with bitcode.
this procedure work fine....btw...here's the version with bitcode and simulator

https://mega.nz/#!CAxkmSxI!2JCXteEcK7rF ... zvVT__4MYk


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

Who is online

Users browsing this forum: No registered users and 7 guests