1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from April
2009</title>
5 <description>Entries from April
2009</description>
10 <title>Recording video from cron using VLC
</title>
11 <link>../../../Recording_video_from_cron_using_VLC.html
</link>
12 <guid isPermaLink=
"true">../../../Recording_video_from_cron_using_VLC.html
</guid>
13 <pubDate>Sun,
5 Apr
2009 10:
00:
00 +
0200</pubDate>
15 <p
>One think I have wanted to figure out for a along time is how to
16 run vlc from cron to do recording of video streams on the net. The
17 task is trivial with mplayer, but I do not really trust the security
18 of mplayer (it crashes too often on strange input), and thus prefer
19 vlc. I finally found a way to do it today. I spent an hour or so
20 searching the web for recipes and reading the documentation. The
21 hardest part was to get rid of the GUI window, but after finding the
22 dummy interface, the command line finally presented itself:
</p
>
24 <blockquote
><pre
>URL=http://www.ping.uio.no/video/rms-oslo_2009.ogg
26 DISPLAY= vlc -q $URL \
27 --sout=
"#duplicate{dst=std{access=file,url=
'$SAVEFILE
'},dst=nodisplay}
" \
28 --intf=dummy
</pre
></blockquote
>
30 <p
>The command stream the URL and store it in the SAVEFILE by
31 duplicating the output stream to
"nodisplay
" and the file, using the
32 dummy interface. The dummy interface and the nodisplay output make
33 sure no X interface is needed.
</p
>
35 <p
>The cron job then need to start this job with the appropriate URL
36 and file name to save, sleep for the duration wanted, and then kill
37 the vlc process with SIGTERM. Here is a complete script
38 <tt
>vlc-record
</tt
> to use from
<tt
>at
</tt
> or
<tt
>cron
</tt
>:
</p
>
40 <blockquote
><pre
>#!/bin/sh
43 SAVEFILE=
"$
2"
44 DURATION=
"$
3"
45 DISPLAY= vlc -q
"$URL
" \
46 --sout=
"#duplicate{dst=std{access=file,url=
'$SAVEFILE
'},dst=nodisplay}
" \
47 --intf=dummy
< /dev/null
> /dev/null
2>&1 &
51 wait $pid
</pre
></blockquote
>
56 <title>Fransk idiotlovforslag hinker gjennom parlamentet
</title>
57 <link>../../../Fransk_idiotlovforslag_hinker_gjennom_parlamentet.html
</link>
58 <guid isPermaLink=
"true">../../../Fransk_idiotlovforslag_hinker_gjennom_parlamentet.html
</guid>
59 <pubDate>Fri,
10 Apr
2009 00:
10:
00 +
0200</pubDate>
61 <p
><a href=
"http://www.dagbladet.no/
2009/
04/
09/kultur/musikk/fildeling/tekno/
5689356/
">Dagbladet
62 melder at det franske idiotforslaget om å kutte Internet-forbindelsen
63 til alle som blir anklaget for å ha brutt opphavsretten
3 ganger
</a
>
64 ble nedstemt i dag med
21 mot
15 stemmer. Vinklingen i Dagbladet er
65 litt merkelig når en vet at det samme forslaget ble vedtatt i
66 parlamentets andre kammer med
12 mot
4 stemmer, etter at det
67 <a href=
"http://opendotdotdot.blogspot.com/
2009/
04/hadopi-law-passed-by-
12-votes-to-
4.html
">overraskende
68 ble foreslått å ta saken opp til votering
22:
45 sist torsdag
</a
>,
69 etter sigende i strid med vanlige rutiner i det franske parlamentet.
</p
>
71 <p
>Det hele blir ennå mer komisk når et vet at
72 <a href=
"http://www.zeropaid.com/news/
10034/political_hypocrisy_french_president_sued_for_copyright_infringement/
">presidentens
73 parti er blitt anklaget for å ha brutt opphavsretten
</a
>. Mon tro om
74 partet skal miste internet-forbindelsen hvis de får
2 anklager til
75 rettet mot seg.
</p
>