[vlc-devel] First steps on MacOS X

Saúl Ibarra Corretgé saul at ag-projects.com
Thu Apr 29 16:39:39 CEST 2010


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,

-- 
Saúl Ibarra Corretgé
AG Projects



More information about the vlc-devel mailing list