sudo -u www-data /var/www/epgrec/getepg.php ... Segmentation fault (core dumped)
epgdump test '/tmp/__temp.ts' -
recpt1
--sid
all
,hd
,sd1
,sd2
,sd3
,1seg
recpt1 --strip --b25 --sid all 25 30 test25.ts
recpt1 --strip --b25 --sid hd 25 30 test25.ts
recpt1 --strip --b25 --sid sd1,sd2,sd3 25 30 test25.ts
recpt1 --strip --b25 --sid 1seg 25 30 test25.ts
mysql> show tables; +----------------------+ | Tables_in_epgrec | +----------------------+ | Recorder_categoryTbl | | Recorder_channelTbl | | Recorder_keywordTbl | | Recorder_logTbl | | Recorder_programTbl | | Recorder_reserveTbl | | mt_autoscan | | mt_cds_active_item | | mt_cds_object | | mt_internal_setting | +----------------------+
mysql> set names utf8; mysql> select channel,name from Recorder_channelTbl order by id; +---------+-----------------------------+ | channel | name | +---------+-----------------------------+ | 27 | NHK総合1・東京 | | 26 | NHKEテレ1東京 | | 25 | 日テレ1 | | 22 | TBS1 | | 21 | フジテレビ | | 24 | テレビ朝日 | | 23 | テレビ東京1 | | 20 | TOKYO MX1 | +---------+-----------------------------+
set names utf8; update Recorder_channelTbl set name='(1)NHK総合1・東京' where channel=27; update Recorder_channelTbl set name='(2)NHKEテレ1東京' where channel=26; update Recorder_channelTbl set name='(4)日テレ1' where channel=25; update Recorder_channelTbl set name='(6)TBS1' where channel=22; update Recorder_channelTbl set name='(8)フジテレビ' where channel=21; update Recorder_channelTbl set name='(5)テレビ朝日' where channel=24; update Recorder_channelTbl set name='(7)テレビ東京1' where channel=23; update Recorder_channelTbl set name='(9)TOKYO MX1' where channel=20;
※まだ途中
sudo apt-get install git cd /tmp git clone git://git.sourceforge.jp/gitroot/epgrec/epgrec.git
定期的、バージョンアップ前はやったほうが良い
mkdir epgrec-backup cd epgrec-backup # 設定ファイル cp /var/www/epgrec/config.php . cp /var/www/epgrec/do-record.sh . # サムネイルディレクトリ cp -r /var/www/epgrec/thumbs . # ビデオディレクトリ(巨大なので注意) cp -r /var/www/epgrec/video .
mysqldump -u epgrec -p`cat ~/.mysql-pw-epgrec` --single-transaction epgrec | gzip > mysql.epgrec.`date +%Y%m%d`.gz
cat mysql.epgrec.YYYYMMDD.gz | gunzip | mysql -u epgrec -p`cat ~/.mysql-pw-epgrec` epgrec
cp recordedTable.html.patch /var/www/epgrec/templates cd /var/www/epgrec/templates patch -p0 < recordedTable.html.patch
cd /tmp/ wget http://hp.vector.co.jp/authors/VA038175/download/tssplitter_lite.zip unzip tssplitter_lite.zip cd tssplitter_lite/ wget http://microgroove.jp/tmp/tssplitter_lite.diff patch -p0 < tssplitter_lite.diff make sudo cp tssplitter_lite/tssplitter_lite /usr/local/bin/
ffmpeg -i test.ts
tssplitter_lite input.ts output.ts [PROGRAM ID]
vi /var/www/epgrec/config.php ---- $RECORD_MODE = array( // ※ 0は必須で、変更不可です。 0 => array( 'name' => 'Full TS', // モードの表示名 'suffix' => '.ts', // ファイル名のサフィックス ), 1 => array( 'name' => 'HD split', 'suffix' => '_hd.ts', ), 2 => array( 'name' => 'Smartphone', 'suffix' => '.ts', ), 3 => array( 'name' => 'Auto Encode Test', 'suffix' => '.ts', ), 4 => array( 'name' => 'TS split', 'suffix' => '.ts', ), ); ----
OUTPUT=/var/www/epgrec/video/test.ts CHANNEL=20 SID=hd DURATION=30 TUNER=0 MODE=4 TYPE=GR /var/www/epgrec/do-record.sh
sudo sh -c "cat >> /etc/apt/sources.list << 'EOS' deb http://ppa.launchpad.net/handbrake-ubuntu/ppa/ubuntu lucid main deb-src http://ppa.launchpad.net/handbrake-ubuntu/ppa/ubuntu lucid main EOS" wget http://zeonic.ath.cx/pt2/handbrake.pub sudo apt-key add handbrake.pub sudo apt-get update sudo apt-get install handbrake-cli
sudo apt-get install mplayer
sudo apt-get install gpac
sudo reboot
cd /var/www/epgrec/ vim config.php ---- $RECORD_MODE = array( // ※ 0は必須で、変更不可です。 0 => array( 'name' => 'Full TS', // モードの表示名 'suffix' => '.ts', // ファイル名のサフィックス ), 1 => array( 'name' => 'HD split', 'suffix' => '_hd.ts', ), 2 => array( 'name' => 'Smartphone', 'suffix' => '.ts', ), 3 => array( 'name' => 'Auto Encode Test', 'suffix' => '.ts', ), ); ----
#!/bin/sh echo "CHANNEL : $CHANNEL" echo "DURATION: $DURATION" echo "OUTPUT : $OUTPUT" echo "TUNER : $TUNER" echo "TYPE : $TYPE" echo "MODE : $MODE" echo "SID : $SID" RECORDER=/usr/local/bin/recpt1 #出力するファイルの名前だけを切りだし(例:/path/to/save/hoge.ts → hoge.ts) FILENAME=${OUTPUT##*/} if [ ${MODE} -eq 0 ]; then $RECORDER --b25 --strip $CHANNEL $DURATION ${OUTPUT} >/dev/null elif [ ${MODE} -eq 1 ]; then $RECORDER --b25 --strip --sid $SID $CHANNEL $DURATION ${OUTPUT} >/dev/null elif [ ${MODE} -eq 2 ]; then $RECORDER --b25 --strip --sid $SID $CHANNEL $DURATION ${OUTPUT} cd /tmp/ #HD部だけを分離したtsファイルからさらに音声と動画に分離 ffmpeg -i ${OUTPUT} -vn -acodec libfaac -ac 2 -ar 48000 -ab 96k /tmp/$FILENAME.novideo.aac mplayer -dumpvideo ${OUTPUT} -dumpfile /tmp/$FILENAME.noaudio.ts #HandbrakeCLIで動画だけのtsファイルをMP4形式の動画にエンコ #-X 1280 -Y 720 とするとiPadで再生できる HandBrakeCLI -i $FILENAME.noaudio.ts -O -f mp4 -X 480 -Y 270 -e x264 -b 400 --loose-anamorphic -o $FILENAME.mp4 #音声を付加 MP4Box -add $FILENAME.novideo.aac $FILENAME.mp4 #元のフォルダに戻しておく。Apacheの領域内に戻して外部参照してもOK mv $FILENAME.mp4 ${OUTPUT}.480x270.mp4 #後始末 rm -rf /tmp/$FILENAME* elif [ ${MODE} -eq 3 ]; then $RECORDER --b25 --strip --sid $SID $CHANNEL $DURATION ${OUTPUT} > /dev/null START=`date '+%s'` cd /tmp/ mplayer -dumpaudio ${OUTPUT} -dumpfile /tmp/$FILENAME.novideo.aac mplayer -dumpvideo ${OUTPUT} -dumpfile /tmp/$FILENAME.noaudio.ts HandBrakeCLI -i $FILENAME.noaudio.ts -f mp4 -e x264 -b 5000 --loose-anamorphic -o $FILENAME.mp4 MP4Box -add $FILENAME.novideo.aac $FILENAME.mp4 mv $FILENAME.mp4 ${OUTPUT}.mp4 rm -rf /tmp/$FILENAME* END=`date '+%s'` TIME=`expr $END - $START` echo 保存用の$FILENAMEの変換が終了しました > /var/www/epgrec/data.txt echo `date`に終了。 $TIME秒かかりました >> /var/www/epgrec/data.txt # mutt -s 保存用_$FILENAME hoge@example.com -F /home/hoge/.mutt/muttrc < /var/www/epgrec/data.txt #自動変換が信頼できるなら元のtsファイルを消す rm -rf ${OUTPUT} fi
スマートフォン用 OUTPUT=/var/www/epgrec/video/test.ts CHANNEL=20 SID=hd DURATION=30 TUNER=0 MODE=2 TYPE=GR /var/www/epgrec/do-record.sh 保存用 OUTPUT=/var/www/epgrec/video/test.ts CHANNEL=20 SID=hd DURATION=30 TUNER=0 MODE=3 TYPE=GR /var/www/epgrec/do-record.sh
/var/www/epgrec/recomplete.php id
sudo apt-get -y install samba swat
pdbedit -a -u ユーザー名:ユーザーの追加 pdbedit -x ユーザー名:ユーザーの削除
sudo mkdir /etc/skel/samba cat > mkhomedir.sh << 'EOS' #!/bin/bash # /home/ユーザ名/samba ディレクトリを一括作成 for user in `ls /home` do id $user > /dev/null 2>&1 [ $? -eq 0 ] && \ [ ! -d /home/$user/samba ] && \ mkdir /home/$user/samba && \ chown $user:$user /home/$user/samba && \ echo "/home/$user/samba create" done EOS chmod 755 mkhomedir.sh sudo ./mkhomedir.sh
sudo mkdir /home/samba sudo chown nobody:root /home/samba
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak sudo su -c "cat > /etc/samba/smb.conf << 'EOS' [global] smb ports = 139 debug level = 0 dos charset = CP932 unix charset = UTF-8 display charset = UTF-8 server string = MediaCenter passdb backend = tdbsam obey pam restrictions = yes load printers = No disable spoolss = Yes ldap ssl = no hosts allow = 192.168.1., 127. printing = bsd cups options = raw print command = lpr -r -P'%p' %s lpq command = lpq -P'%p' lprm command = lprm -P'%p' %j map archive = no create mask = 0664 force create mode = 0600 directory mask = 0775 force directory mode = 0700 workgroup = WORKGROUP dns proxy = no log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes map to guest = bad user usershare allow guests = yes [homes] comment = Home Directories path = %H read only = No browseable = No vfs objects = recycle recycle:repository = .recycle recycle:keeptree = no recycle:versions = yes recycle:touch = no recycle:maxsize = 0 recycle:exclude = *.tmp ~$* [printers] comment = All Printers path = /var/spool/samba printable = Yes browseable = No guest ok = no read only = yes create mask = 0700 [pt2] comment = pt2 path = /var/www/epgrec/video read only = No guest ok = no vfs objects = recycle recycle:repository = .recycle recycle:keeptree = no recycle:versions = yes recycle:touch = no recycle:maxsize = 0 recycle:exclude = *.tmp ~$* EOS" sudo service smbd restart sudo sysv-rc-conf smbd on
sudo vi /etc/cron.daily/recyclewatch ---- #!/bin/bash # vim: ts=4:sw=4:tw=80 for user in `ls /home/` do if [ -d /home/$user/.recycle ]; then /usr/bin/find "/home/$user/.recycle/" -mtime +7 -exec rm -rf {} \; fi if [ -d /home/$user/samba/.recycle ]; then /usr/bin/find "/home/$user/samba/.recycle/" -mtime +7 -exec rm -rf {} \; fi done if [ -d /var/www/epgrec/video/.recycle ]; then /usr/bin/find "/var/www/epgrec/video/.recycle/" -mtime +7 -exec rm -rf {} \; fi ---- chmod +x /etc/cron.daily/recyclewatch
sudo su - passwd
sudo apt-get -y install swat
sudo apt-get install mediatomb ffmpegthumbnailer
mysql -u epgrec -p`cat ~/.mysql-pw-epgrec` epgrec < /usr/share/mediatomb/mysql.sql
sudo vi /etc/default/mediatomb ---- NO_START="no" INTERFACE="eth0" ## MediaTomb will be started on port 49152 MT_PORT="49152" ----
sudo cp mediatomb-transcoding-* /usr/local/bin/ sudo chmod +x /usr/local/bin/mediatomb-transcoding-* sudo cp config.xml /etc/mediatomb/ # パスワードを編集 sudo vim /etc/mediatomb/config.xml ---- <password>***</password> ---- sudo service mediatomb restart sudo sysv-rc-conf mediatomb on
ffmpegthumbnailer -i test.ts -o test.jpg -t 1
vim /etc/mediatomb/config.xml ---- <transcoding enabled="no"> ---- service mediatomb restart # トランスコードのログを見る less /tmp/mediatomb-transcoding-video.log
sudo tail -f /var/log/mediatomb.log
/usr/share/doc/mediatomb-common/examples/mediatomb-transcode 汎用ビデオ /usr/share/doc/mediatomb-common/examples/mediatomb-transcode --video-common 汎用オーディオ /usr/share/doc/mediatomb-common/examples/mediatomb-transcode --audio-common
vim /etc/mediatomb/config.xml ---- <agent command="/usr/local/bin/mediatomb-transcoding-video" arguments="%in %out %seconds" can-seek="yes"/> ---- service mediatomb restart
ifconfig
sudo apt-get install sysv-rc-conf sudo service mysql start sudo sysv-rc-conf mysql on
vim /etc/mysql/my.cnf ---- [client] default-character-set=utf8 [mysqld] skip-character-set-client-handshake character-set-server=utf8 default-storage-engine=InnoDB innodb_file_format=Barracuda innodb_file_per_table = 1 # MySQL ABでは、搭載メモリの80%とも書かれている # default:8388608 (8MB) innodb_buffer_pool_size=16M [mysql] default-character-set=utf8 prompt="\u@\h[\d]> " auto-rehash [mysqldump] default-character-set=utf8 ---- sudo service mysql restart
vim /etc/mysql/my.cnf ---- [client] default-character-set=utf8 [mysqld] skip-character-set-client-handshake character-set-server=utf8 default-table-type=InnoDB # MySQL ABでは、搭載メモリの80%とも書かれている # default:8388608 (8MB) innodb_buffer_pool_size=16M [mysql] default-character-set=utf8 prompt="\u@\h[\d]> " auto-rehash [mysqldump] default-character-set=utf8 ---- sudo service mysql restart
mkpasswd.pl -l 16 > ~/.mysql-pw-epgrec echo "GRANT ALL PRIVILEGES ON *.* TO epgrec@localhost IDENTIFIED BY '`cat ~/.mysql-pw-epgrec`';FLUSH PRIVILEGES;create database epgrec;" | mysql -u root -p`cat .mysql-pw-root` mysql ログインできるか確認 mysql -u epgrec -p`cat ~/.mysql-pw-epgrec` -h localhost epgrec
sudo apt-get install at ※www-dataがある場合は削除 sudo vi /etc/at.deny sudo vi /etc/passwd ---- www-data:x:33:33:www-data:/var/www:/bin/sh ----
sudo apt-get install ffmpeg
sudo apt-get install mediatomb
cd /var/www/epgrec/ cp config.php.sample config.php cp --archive do-record.sh.pt1 do-record.sh sudo vi config.php ---- $GR_CHANNEL_MAP = array( "GR27" => "27", // NHK 総合 "GR26" => "26", // NHK Eテレ "GR25" => "25", // 日本テレビ "GR24" => "24", // テレビ朝日 "GR22" => "22", // TBS "GR23" => "23", // テレビ東京 "GR21" => "21", // フジテレビ "GR20" => "20", // 東京MX // "GR18" => "18", // テレ神 // "GR30" => "30", // 千葉 // "GR32" => "32", // テレ玉 // "GR28" => "28", // 大学 ); ---- cd /var/www/epgrec/ cat > .htaccess << 'EOS' Options Indexes EOS
cd /tmp/ wget "http://sourceforge.jp/frs/redir.php?m=globalbase&f=%2Fepgrec%2F46704%2Fepgrec-20100322fix1.tar.gz" -O epgrec-20100322fix1.tar.gz tar -xf epgrec-20100322fix1.tar.gz cd /var/www/epgrec/ patch -p1 < $WORK_DIR/epgrec-20100322fix1.diff cd /tmp/ wget "http://sourceforge.jp/frs/redir.php?m=keihanna&f=%2Fepgrec%2F46851%2Fepgrec-20100322fix2.tar.gz" -O epgrec-20100322fix2.tar.gz tar -xf epgrec-20100322fix2.tar.gz cd /var/www/epgrec/ patch -p1 < $WORK_DIR/epgrec-20100322fix2.diff
sudo cp /var/www/epgrec/cron.d/getepg /etc/cron.d/ sudo chmod 644 /etc/cron.d/getepg
sudo -u www-data /var/www/epgrec/getepg.php &
アンテナ - 2分配器 -- ダブル分波器 - TV |- ダブル分波器 - PT2
【3500円以上お買い上げで送料無料】【4300個突破!】【ポイント3倍... 価格:2,590円(税込、送料別) |
sudo lspci | grep -i Multimedia 03:0a.0 Multimedia controller: Xilinx Corporation Device 222a (rev 01)
sudo sh -c 'echo "blacklist earth-pt1" >> /etc/modprobe.d/blacklist.conf'
sudo apt-get update sudo apt-get upgrade sudo reboot
bash ubuntu-12.04.sh
wget http://zeonic.ath.cx/pt2/ubuntu.sh bash ubuntu.sh
ls -l /dev/pt1* crw-rw-rw- 1 root video 250, 0 2011-02-27 17:44 /dev/pt1video0 crw-rw-rw- 1 root video 250, 1 2011-02-27 17:44 /dev/pt1video1 crw-rw-rw- 1 root video 250, 2 2011-02-27 17:44 /dev/pt1video2 crw-rw-rw- 1 root video 250, 3 2011-02-27 17:44 /dev/pt1video3
pcsc_scan PC/SC device scanner V 1.4.16 (c) 2001-2009, Ludovic Rousseau <ludovic.rousseau@free.fr> Compiled with PC/SC lite version: 1.5.3 Scanning present readers... 0: SCM SCR 3310 NTTCom 00 00 ... 中略 Possibly identified card (using /usr/share/pcsc/smartcard_list.txt): 3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99 B-CAS ... CTRL+Cで中断
recpt1 --list Available Channels: 13-62: Terrestrial Channels 101ch: NHK BS1 102ch: NHK BS2 103ch: NHK BShi 141ch: BS Nittele 151ch: BS Asahi 161ch: BS-TBS 171ch: BS Japan 181ch: BS Fuji 191ch: WOWOW 192ch: WOWOW2 193ch: WOWOW3 200ch: Star Channel 211ch: BS11 Digital 222ch: TwellV C13-C63: CATV Channels CS2-CS24: CS Channels
checksignal [channel] # 例:日本テレビの例 checksignal 25 device = /dev/pt1video2 C/N = 33.962446dB CTRL+Cで中断
cat > rectest.sh << 'EOS' #!/bin/bash for ((i=20;i<63;i++)) do echo recording channel $i /usr/local/bin/recpt1 --strip --b25 --sid hd $i 30 test$i.ts &> /dev/null done EOS chmod 700 rectest.sh ./rectest.sh