3

I'm trying to run VLC headless from a cron job. The idea is to grab single images from a RTSP stream every two minutes and (later, and in another script) ftp them to a distant machine. The command line I use is (added linebreaks for clarity):

vlc -I dummy rtsp://somesourceaddress/
--rate=1 --vout=dummy
--video-filter=scene --start-time=0 --stop-time=1 --scene-format=png --scene-prefix=img1 --scene-path=/tmp/ --scene-replace 
vlc://quit

However, while this works beautifully from a terminal window inside an X session, running this from cron results in the following error message:

[0x81d1154] inhibit interface error: Failed to connect to the D-Bus 
session daemon: Unable to autolaunch a dbus-daemon 
without a $DISPLAY for X11
[0x81d1154] main interface error: no suitable interface module
[0x81d15fc] main interface error: no suitable interface module
[0x80503fc] main libvlc error: interface "globalhotkeys,none" 
initialization failed
[0x81d15fc] dummy interface: using the dummy interface module...

So, where can I obtain suitable values for $DISPLAY if there is none? Or how can I create the DBUS connection manually?

1
  • have you tried the -d switch to run in daemon mode?
    – bsd
    Commented Mar 7, 2012 at 13:08

1 Answer 1

3

Are these errors really fatal, i.e. do you still get the output you want?

  1. The $DISPLAY error message probably only concerns screensaver inhibition, adding --no-disable-screensaver could solve it (otherwise you can probably ignore it, it's non-fatal). VLC shouldn't need a D-Bus connection for what you're trying to do.
  2. You could also try using cvlc, which apparently doesn't use any interface (this sounds like it's related).
1
  • Thanks for pointing out the meaning of the "inhibit interface error". It turned out to be non-fatal, indeed. I did not try cvlc since I need to run the controlling script as root, so I use vlc-wrapper already and did not want to complicate things further.
    – jstarek
    Commented Mar 7, 2012 at 18:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .