[vlc-devel] First steps on MacOS X
Olivier Aubert
olivier.aubert at liris.cnrs.fr
Thu Apr 29 18:14:43 CEST 2010
Hello
The python bindings from git.videolan.org have been updated last week
for 1.1. Looking at the commit messages, I agree that I should have put
somewhere that support for 1.1 was updated.
sealibora reported a (now closed) bug against python bindings
https://trac.videolan.org/vlc/ticket/3421 but did not inform that he had
done some work, too bad (sealibora, if you are reading this, please get
in touch).
For the exact .dylib name, I have just fixed this.
Lastly, for your actual issue, did you try simply playing a video file,
to try to pinpoint the problem?
Regards,
Olivier
On Thu, 2010-04-29 at 16:39 +0200, Saúl Ibarra Corretgé wrote:
> Hi all,
>
> I've started using libvlc a couple of days ago, and after a lot of
> reading I'm still confused about libvlc on MacOS.
>
> The project I'm working on is written in python, so I'm using the ctypes
> bindings.
>
> First problem I found is related to the version: 1.0.x will be
> deprecated, so I guess I should start developing on 1.1. However, python
> bindings from the repo at git.videolan.org don't seem updated to latest
> API changes. I found this repo which contains the binding generators
> apparently updated to 1.1: http://github.com/sealibora/vlc-python.git
>
> Also, bindings try to import libvlc.2.dylib, but currently it's
> libvlc.dylib, right?
>
> Once I had vlc.py corretly generated, I wanted to try a simple example:
> open a window with the webcam feed.
>
> On GNU/Linux I tried the following code:
>
> import vlc
> from time import sleep
>
> args = ['--ignore-config',
> '-vv']
> instance = vlc.Instance(args)
> player = vlc.MediaPlayer(instance)
> media = instance.media_new('v4l2:///dev/video0', 'v4l2-standard=0')
> player.set_media(media)
> player.play()
>
> while True:
> try:
> sleep(1)
> except:
> break
>
> player.stop()
> player.release()
> instance.release()
>
> This works, but modifying it a little for MacOS doesn't:
>
>
> import vlc
> from time import sleep
>
> plugin_path = '/Applications/VLC.app/Contents/MacOS/plugins/'
> args = ['--ignore-config',
> '--no-audio',
> '--no-media-library',
> '--plugin-path='+plugin_path,
> '-vv']
> instance = vlc.Instance(args)
> player = vlc.MediaPlayer(instance)
> media = instance.media_new('qtcapture://')
> player.set_media(media)
> player.play()
>
> while True:
> try:
> sleep(1)
> except:
> break
>
> player.stop()
> player.release()
> instance.release()
>
> No window is shown, but I can see log messages claiming camera is open :-S
>
> My last attempt was to do a simple python cocoa application which should
> paint the video in a NSView. I passed the NSView object to set_nsobject
> method, but I always get TypeError back :-S
>
> Am I missing something? Sorry if it's something obvious, but I tried
> everything I could think of so far.
>
> Thanks in advance for any hint.
>
>
> Kind regards,
>
More information about the vlc-devel
mailing list