Having problems capturing a snapshot when using python libvlc to capture a UDP stream.
The following script does a grand job of making the recording but fails to get the snapshot
Code: Select all
import vlc
from time import sleep
# set up recording
vlc_instance = vlc.libvlc_new(0, [])
vlc_media = vlc.libvlc_media_new_location(vlc_instance, 'udp/ps://@227.1.0.1:11111')
vlc.libvlc_media_add_option(vlc_media, ':sout=#standard{mux=ps,dst=/home/vds/libvlc_poc/foo.ps,access=file} ')
vlc.libvlc_media_add_option(vlc_media, ':mtu=32768')
vlc.libvlc_media_add_option(vlc_media, ':start-time=0')
vlc.libvlc_media_add_option(vlc_media, ':stop-time=30')
vlc.libvlc_media_add_option(vlc_media, ':udp-caching=5000')
vlc.libvlc_media_add_option(vlc_media, ':snapshot-path=/home/vds/libvlc_poc/')
vlc.libvlc_media_add_option(vlc_media, ':snapshot-format=png')
vlc_player = vlc.libvlc_media_player_new_from_media(vlc_media)
vlc.libvlc_media_player_play(vlc_player)
# take a snapshot midway through
sleep(20)
print 'taking snapshot now....'
result = vlc.libvlc_video_take_snapshot(vlc_player, 0, '/home/vds/libvlc_poc/foo.png', 0, 0)
print 'taken snapshot... result was %s' % result
sleep(20)
Code: Select all
[vds@dev18 libvlc_poc]$ python record.py
[0x109e1e0] inhibit interface error: Failed to connect to the D-Bus session daemon: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.
[0x109e1e0] main interface error: no suitable interface module
[0x7f4024004100] mux_ps mux: Open
taking snapshot now....
taken snapshot... result was -1
Bonus points for telling me how to disable the dbus stuff - using the RPMForge rpm vlc-1.1.13-1.el6.rf.x86_64 on RHEL 6.2, which is obviously compiled with dbus enabled... I don't need dbus at all as these scripts will eventually run unattended under Django..
thanks for any input
Graham