<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>讓 VLC 幫我預約錄影</title>
<link>http://blog.roodo.com/justinlove/archives/8398091.html/</link>
<description><![CDATA[



請注意：這些步驟都是在終端機下執行，需具備 vim、crontab 與 Unix 檔案路徑的基本概念。若有需要學習請參考文後連結。
0. 調查你所要錄的節目播出時間與網路位址
1. 建立呼叫VLC錄影的命令稿，並在裡面寫好要擷取的位址、存檔的路徑
vi rtv.command


  #!/bin/bash
  /Applications/VLC.app/Contents/MacOS/VLC udp://@xx.xx.xx.xxx:xxx —demux=dump —demuxdump-file=”/vlcdump.ts” —demuxdump-append

說明：a) udp://@xx.xx.xx.xxx:xxx 請填你所要錄網路位址
b) ”/vlcdump.ts” 請填入你所要存檔的路徑
c) —demuxdump-append 是讓如果串流影片播到一半有中斷的話，可以持續寫入在同一檔案的尾巴，才不會把原本錄的覆蓋掉 
2. 讓 rtv.command 擁有執行的權限
chmod +x rtv.command
3. 建立讓 VLC 停止錄影 AppleScript
vi quitvlc.scpt

  tell application “VLC”
      quit
  end tell

說明：這一段 AppleScript 很簡單，就只是叫 VLC 關掉。但這卻是預約錄影很重要的地方，不然會錄到硬碟爆掉。
4. 利用 crontab 建立排程讓 VLC 預約錄影並在節目結束時呼叫 AppleScript 來關閉 VLC 結束錄影
crontab -e

  #record tv show
  40 10 * * * ./rtv.command
  10 12 * * * osascript quitvlc.scpt

說明：這邊也很簡單，就是給定日期或時間要電腦幫我們執行前面寫的命令稿，已達到預約錄影的效果。
省電應用：可以利用「系統偏好設定 > 能源節約器 > 排程」來控制電腦休眠、喚醒、關機等選項，已達到節能減碳之功效。

終於寫完了～突然讓我想到一句很久以前的廣告詞「他傻瓜我聰明」:-p
link1: 鳥哥的 Linux 私房菜 -- vim 程式編輯器
link2: 鳥哥的 Linux 私房菜 -- 例行性命令的建立 [crontab]
link3: AppleScript 2.1 Help: 在終端機命令列裡執行 AppleScript 工序指令]]>
	</description>
<language>zh-tw</language>
<generator>Roodo Blog System</generator>
<copyright>All Rights Reserved</copyright>
<atom:link href="http://blog.roodo.com/justinlove/archives/8398091-comment.xml" rel="self" type="application/rss+xml" />
<item>
	<title>回應：讓 VLC 幫我預約錄影</title>
	<description><![CDATA[不需要找錄影的選項
因為這篇教學是要教讓VLC自己錄
你只要去找錄好的 vlcdump.ts 檔案就好]]>
	</description>
	<link>http://blog.roodo.com/justinlove/archives/8398091.html</link>
	<guid>http://blog.roodo.com/justinlove/archives/8398091.html#comment-19350353</guid>
		<category>文章回應</category>
	<pubDate>Sun, 14 Jun 2009 12:19:50 +0800</pubDate>
</item>
<item>
	<title>回應：讓 VLC 幫我預約錄影</title>
	<description><![CDATA[抱歉有事想請問一下版主，關於vlc錄影的問題…

那就是…我找不到錄影的選項啊啊啊！
串聯是有成功，也能正常播放，但裡面卻找不到
錄影的選項…（難道是我設定的問題嗎？）]]>
	</description>
	<link>http://blog.roodo.com/justinlove/archives/8398091.html</link>
	<guid>http://blog.roodo.com/justinlove/archives/8398091.html#comment-19346895</guid>
		<category>文章回應</category>
	<pubDate>Sat, 13 Jun 2009 20:51:17 +0800</pubDate>
</item>
<item>
	<title>回應：讓 VLC 幫我預約錄影</title>
	<description><![CDATA[好啦
有空再寫GUI版
不然1、3步驟可用草莓編輯器代替，但檔案要放家目錄下。]]>
	</description>
	<link>http://blog.roodo.com/justinlove/archives/8398091.html</link>
	<guid>http://blog.roodo.com/justinlove/archives/8398091.html#comment-18625751</guid>
		<category>文章回應</category>
	<pubDate>Fri, 27 Feb 2009 19:12:57 +0800</pubDate>
</item>
<item>
	<title>回應：讓 VLC 幫我預約錄影</title>
	<description><![CDATA[有沒有可以變得更好吸收的方法啊～
終端機苦手XD]]>
	</description>
	<link>http://blog.roodo.com/justinlove/archives/8398091.html</link>
	<guid>http://blog.roodo.com/justinlove/archives/8398091.html#comment-18625299</guid>
	<author>appleseed0323@gmail.com(appleseed)</author>	<category>文章回應</category>
	<pubDate>Fri, 27 Feb 2009 16:31:02 +0800</pubDate>
</item>
</channel>
</rss>