Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
have you tried the -d switch to run in daemon mode? –  bdowning Mar 7 '12 at 13:08
add comment

1 Answer

up vote 3 down vote accepted

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).
share|improve this answer
    
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 Mar 7 '12 at 18:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.