<link></link>
<atom:link href="index.rss" rel="self" type="application/rss+xml" />
+ <item>
+ <title>Recording video from cron using VLC</title>
+ <link>Recording_video_from_cron_using_VLC.html</link>
+ <guid isPermaLink="true">Recording_video_from_cron_using_VLC.html</guid>
+ <pubDate>Sun, 5 Apr 2009 10:00:00 +0200</pubDate>
+ <description>
+<p>One think I have wanted to figure out for a along time is how to
+run vlc from cron to do recording of video streams on the net. The
+task is trivial with mplayer, but I do not really trust the security
+of mplayer (it crashes too often on strange input), and thus prefer
+vlc. I finally found a way to do it today. I spent an hour or so
+searching the web for recipes and reading the documentation. The
+hardest part was to get rid of the GUI window, but after finding the
+dummy interface, the command line finally presented itself:</p>
+
+<blockquote><pre>URL=http://www.ping.uio.no/video/rms-oslo_2009.ogg
+SAVEFILE=rms.ogg
+DISPLAY= vlc -q $URL \
+ --sout="#duplicate{dst=std{access=file,url='$SAVEFILE'},dst=nodisplay}" \
+ --intf=dummy</pre></blockquote>
+
+<p>The command stream the URL and store it in the SAVEFILE by
+duplicating the output stream to "nodisplay" and the file, using the
+dummy interface. The dummy interface and the nodisplay output make
+sure no X interface is needed.</p>
+
+<p>The cron job then need to start this job with the appropriate URL
+and file name to save, sleep for the duration wanted, and then kill
+the vlc process with SIGTERM. Here is a complete script
+<tt>vlc-record</tt> to use from <tt>at</tt> or <tt>cron</tt>:</p>
+
+<blockquote><pre>#!/bin/sh
+set -e
+URL="$1"
+SAVEFILE="$2"
+DURATION="$3"
+DISPLAY= vlc -q "$URL" \
+ --sout="#duplicate{dst=std{access=file,url='$SAVEFILE'},dst=nodisplay}" \
+ --intf=dummy < /dev/null > /dev/null 2>&1 &
+pid=$!
+sleep $DURATION
+kill $pid
+wait $pid</pre></blockquote>
+</description>
+ </item>
+
<item>
<title>Standardize on protocols and formats, not vendors and applications</title>
<link>Standardize_on_protocols_and_formats__not_vendors_and_applications.html</link>
</description>
</item>
- <item>
- <title>Frikanalen og jul i studentrådet</title>
- <link>Frikanalen_og_jul_i_studentr__det.html</link>
- <guid isPermaLink="true">Frikanalen_og_jul_i_studentr__det.html</guid>
- <pubDate>Wed, 11 Mar 2009 23:40:00 +0100</pubDate>
- <description>
-<p>I går
-<a href="http://lists.nuug.no/pipermail/interesserte/2009-March/000387.html">lanserte</a>
-NUUGs videogruppe
-<a href="http://www.frikanalen.no">Frikanalen</a> med
-<a href="http://www.nuug.no/pub/video/frikanalen/frontpage.cgi">åpne
-standarder</a>, og resultatet av noen intense uker med arbeide kunne
-endelig presenteres. Jeg har tro på åpen kanalkonseptet som
-Frikanalen er et eksempel på, der borgerne får anledning til å
-kringkaste sitt syn på en åpen og demokratisk måte. Jeg er veldig
-glad vi har fått gjort kanalen tilgjengelig i Ogg Theora, slik at alle
-kan få tilgang til opptakene på web, og slipper å måtte installere MS
-Silverlight for å spille av opptakene.</p>
-
-<p>Frikanalen har en brokete historie, og dagens inkarnasjon er ikke
-helt slik foreningen Åpen kanal planla det for mange år siden, noe som
-er bakgrunnen for at det fredag 13. mars 2009 kl 09:00 starter en
-rettsak i Oslo tingrett der Kringkasterforeningen (tidligere
-foreningen Åpen kanal) har saksøkt kulturdepartementet over
-konsesjonsvilkårene til Frikanalen. Jeg er spent på resultatet.</p>
-
-<p>I arbeidet med Frikanalen med åpne standarder, så har vi hatt glede
-av å se en rekke av innslagene som er tilgjengelig. Her er mye
-religiøst sludder, fra
-<a href="http://www.nuug.no/pub/video/frikanalen/fetchvideo.cgi?videoId=720">vandring
-i jerusalem</a> via
-<a href="http://www.nuug.no/pub/video/frikanalen/fetchvideo.cgi?videoId=779">religiøst
-vinklede nyheter</a> til
-<a
-href="http://www.nuug.no/pub/video/frikanalen/fetchvideo.cgi?videoId=2077">kreasjonisk
-retorikk</a>, men også fine
-<a href="http://www.nuug.no/pub/video/frikanalen/fetchvideo.cgi?videoId=407">dokumentarer
-om redningsselskapet</a> og
-<a href="http://www.nuug.no/pub/video/frikanalen/fetchvideo.cgi?videoId=2204">interessante
-tegneserieanmeldelser</a>. Det jeg derimot har hatt størst glede av,
-er
-
-<a href="http://www.nuug.no/pub/video/frikanalen/fetchvideo.cgi?videoId=1556">jul
-i studentrådet</a>, der hver episode var en fest å se på. Jeg håper
-NUUG lykkes med å få ut sine opptak med like stor suksess.</p>
-</description>
- </item>
-
</channel>
</rss>