VLCKit - build issues and version advice, please
Posted: 09 Apr 2013 14:38
Hi Folks,
I'm doing a proof-of-concept at the moment that needs multicast and RTSP MPEG-2 video streaming integrated with a browser on a Mac, so I of course thought of VLC, since QT doesn't seem to do either. Initially I was looking at the Mac plugin but I note there are issues with Mountain Lion, and there are certain advantages to a full-blown application anyway, so I then turned to VLCKit. The idea would be to run VLCKit alongside a UIWebView. If we can get this working we might be able to put some development resource into helping with VLCKit generally.
First up, as a sanity check, I can build full VLC on the Mac (OS 10.6, XCode 4.2) from 2.0.5 fine, using the instructions at http://wiki.videolan.org/OSXCompile, but with the 2.0.5 source tarball rather than the git fetch. Here's roughly what I did - note I had to set SDKROOT which wasn't set before, otherwise the tool build failed.
The resulting VLC 2.0.5 plays my test MPEG-2 TS files and multicast streams just fine.
So onto VLCKit... I see that VLCKit has moved to its own repo sometime before 2.0.5 (no projects/macosx directory), but I can't work out quite when, and the git logs suggest this was a 2.1 change - slightly confused here... So I tried the instructions at http://wiki.videolan.org/Mac_OS_X_Framework using the git master. This was not quite so painless, but I got there eventually
To save anyone else the pain the main things I had to fix were:
0) (Stupid) - start with a clean shell because the CC etc. exports from the 2.0.5 build stuff things up
1) Fix deployment target to 10.6 in VLCKit/xcodeproj/project.pbxproj (3 places)
2) The "Run VLC configure" target didn't seem to run the first script (631A...) which bootstrapped vlc-unstable, so I ran this manually.
3) Remove calls to VKLog in
So with these fixes the actual build commands were:
Then I built the Examples/test application. To make this run I had to softlink the VLCKit.Framework in build/Release into a Frameworks directory in the app's Contents:
That gave me a running test application - hooray! Problem is as soon as I dragged anything onto the list view pane (which didn't update to show it, incidentally) and pressed Play, it would crash. With a simple MPEG-2 TS file it crashed out with a SEGV, in thread 11:
With an H.264 MOV it did get as far as showing the first frame perfectly but then crashed in the same way.
Any clues from that? I'm afraid I don't (yet) know much about Mac debugging to get any further, although I can swing gdb with the best of them in Linux...
More generally, though, I'm a bit nervous of using the bleeding edge code, and I fully understand it might be completely broken. What would be the best stable version to go for to build a basic VLCKit? We don't really need any features beyond 0.8.x, just multicast and RTSP MPEG-2/H.264 in TS. I have a feeling I may need a recent VLCKit (ObjC code) combined with an older base VLC release. Would such a thing work or are there too many dependencies on 2.1 features?
Many thanks
Paul
I'm doing a proof-of-concept at the moment that needs multicast and RTSP MPEG-2 video streaming integrated with a browser on a Mac, so I of course thought of VLC, since QT doesn't seem to do either. Initially I was looking at the Mac plugin but I note there are issues with Mountain Lion, and there are certain advantages to a full-blown application anyway, so I then turned to VLCKit. The idea would be to run VLCKit alongside a UIWebView. If we can get this working we might be able to put some development resource into helping with VLCKit generally.
First up, as a sanity check, I can build full VLC on the Mac (OS 10.6, XCode 4.2) from 2.0.5 fine, using the instructions at http://wiki.videolan.org/OSXCompile, but with the 2.0.5 source tarball rather than the git fetch. Here's roughly what I did - note I had to set SDKROOT which wasn't set before, otherwise the tool build failed.
Code: Select all
export CC=/Developer/usr/bin/llvm-gcc-4.2
export CXX=/Developer/usr/bin/llvm-g++-4.2
export OBJC=/Developer/usr/bin/llvm-gcc-4.2
export SDKROOT=/Developer/SDKs/
mkdir build
cd build
../extras/package/macosx/build.sh
So onto VLCKit... I see that VLCKit has moved to its own repo sometime before 2.0.5 (no projects/macosx directory), but I can't work out quite when, and the git logs suggest this was a 2.1 change - slightly confused here... So I tried the instructions at http://wiki.videolan.org/Mac_OS_X_Framework using the git master. This was not quite so painless, but I got there eventually
To save anyone else the pain the main things I had to fix were:
0) (Stupid) - start with a clean shell because the CC etc. exports from the 2.0.5 build stuff things up
1) Fix deployment target to 10.6 in VLCKit/xcodeproj/project.pbxproj (3 places)
2) The "Run VLC configure" target didn't seem to run the first script (631A...) which bootstrapped vlc-unstable, so I ran this manually.
3) Remove calls to VKLog in
- Sources/VLCMediaPlayer.m
Sources/VLCMediaThumbnailer.m
Sources/VLCEventManager.m
So with these fixes the actual build commands were:
Code: Select all
xcodebuild -project VLCKit.xcodeproj -verbose -target "Fetch libvlc"
xcodebuild -project VLCKit.xcodeproj -verbose -target "Setup VLC contribs" -configuration Release
export PATH=$PWD/vlc-unstable/extras/tools/build/bin:$PATH
cd vlc-unstable
./bootstrap
cd ..
xcodebuild -project VLCKit.xcodeproj -verbose -target "Run VLC configure" -configuration Release
xcodebuild -project VLCKit.xcodeproj -verbose -target "Make VLC" -configuration Release
xcodebuild -project VLCKit.xcodeproj -verbose -target "Build just VLCKit" -configuration Release
Code: Select all
cd Examples/test
xcodebuild -project test.xcodeproj -arch x86_64 -target test -configuration Release
cd ../..
cd build/Release/test.app/Contents
mkdir Frameworks
cd Frameworks
ln -sf ../../../VLCKit.framework .
Code: Select all
Thread 11 Crashed:
0 libvlccore.5.dylib 0x00000001000c9d6d vout_window_Control + 333
1 libvout_macosx_plugin.dylib 0x00000001184af964 vout_window_SetState + 36
2 libvout_macosx_plugin.dylib 0x00000001184af24b Control + 395
3 libvlccore.5.dylib 0x00000001000b631d vout_display_Control + 349
4 libvlccore.5.dylib 0x00000001000b55e4 vout_ManageDisplay + 1956
5 libvlccore.5.dylib 0x00000001000ccd29 vout_ManageWrapper + 137
6 libvlccore.5.dylib 0x00000001000bfee6 ThreadManage + 166
7 libvlccore.5.dylib 0x00000001000be48a Thread + 762
8 libSystem.B.dylib 0x00007fff841fefd6 _pthread_start + 331
9 libSystem.B.dylib 0x00007fff841fee89 thread_start + 13
Any clues from that? I'm afraid I don't (yet) know much about Mac debugging to get any further, although I can swing gdb with the best of them in Linux...
More generally, though, I'm a bit nervous of using the bleeding edge code, and I fully understand it might be completely broken. What would be the best stable version to go for to build a basic VLCKit? We don't really need any features beyond 0.8.x, just multicast and RTSP MPEG-2/H.264 in TS. I have a feeling I may need a recent VLCKit (ObjC code) combined with an older base VLC release. Would such a thing work or are there too many dependencies on 2.1 features?
Many thanks
Paul