@ompugao_ blog

hello this wonderful world

deploy TV recording environment

I'll write down how to deploy the TV recording environment on Linux using pt3.

Thanks to all of developers of pt3's linux driver.

My environment is as follows.

  • uname -a
    • => Linux 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux

  • lsb_release -a
    • => No LSB modules are available.

    • => Distributor ID: Debian

    • => Description: Debian GNU/Linux 6.0.6 (squeeze)

    • => Release: 6.0.6

    • => Codename: squeeze

install packages

sudo aptitude install pkg-config subversion git-core libccid libpcsclite-dev pcsc-tools build-essential autoconf automake linux headers-`uname -r` mercurial-common pcscd

install driver

cd ~/src
git clone https://github.com/m-tsudo/pt3.git
cd pt3
make
sudo make install

install recpt1 (a command for recording)

cd ..
hg clone http://hg.honeyplanet.jp/pt1/
cd pt1
edit decoder.h and pt1_dev.h

    diff -r b14397800eae recpt1/decoder.h
    --- a/recpt1/decoder.h  Wed Jun 27 06:56:33 2012 +0900
    +++ b/recpt1/decoder.h  Sat Oct 06 00:12:12 2012 +0900
    @@ -3,6 +3,9 @@
     #define _DECODER_H_

     #include "config.h"
    +#include <inttypes.h>
    +#include <unistd.h>
    +//#include "stdint.h"

     #ifdef HAVE_LIBARIB25

    diff -r b14397800eae recpt1/pt1_dev.h
    --- a/recpt1/pt1_dev.h  Wed Jun 27 06:56:33 2012 +0900
    +++ b/recpt1/pt1_dev.h  Sat Oct 06 00:12:12 2012 +0900
    @@ -3,24 +3,24 @@
     #define _PT1_DEV_H_

     char *bsdev[NUM_BSDEV] = {
    -    "/dev/pt1video1",
    -    "/dev/pt1video0",
    -    "/dev/pt1video5",
    -    "/dev/pt1video4",
    -    "/dev/pt1video9",
    -    "/dev/pt1video8",
    -    "/dev/pt1video13",
    -    "/dev/pt1video12"
    +    "/dev/pt3video1",
    +    "/dev/pt3video0",
    +    "/dev/pt3video5",
    +    "/dev/pt3video4",
    +    "/dev/pt3video9",
    +    "/dev/pt3video8",
    +    "/dev/pt3video13",
    +    "/dev/pt3video12"
     };
     char *isdb_t_dev[NUM_ISDB_T_DEV] = {
    -    "/dev/pt1video2",
    -    "/dev/pt1video3",
    -    "/dev/pt1video6",
    -    "/dev/pt1video7",
    -    "/dev/pt1video10",
    -    "/dev/pt1video11",
    -    "/dev/pt1video14",
    -    "/dev/pt1video15"
    +    "/dev/pt3video2",
    +    "/dev/pt3video3",
    +    "/dev/pt3video6",
    +    "/dev/pt3video7",
    +    "/dev/pt3video10",
    +    "/dev/pt3video11",
    +    "/dev/pt3video14",
    +    "/dev/pt3video15"
     };

     // 変換テーブル(ISDB-T用)

./autogen.sh
./configure --prefix=/usr/local/ #--enable-b25
make && sudo make install

check the operatioin of B-CAS card reader

pcsc_scan
#=> ... 
#=> 0: SCM SCR 3310 NTTCom[Vendor Interface] 00 0
#=> ...
# B-CAS reader works correctly if you get a message noted previously.
#/etc/init.d/pcscd を見ても pcscd が自動起動するかどうかわからないので、もし自動起動しなかったら、
# Do not start from this script
があるところの if ~ fi 全体をコメントアウトしておくでいいはず。
    #if [ $1 = "start" -a -d /sys/fs/cgroup/systemd ]
    #    then
    #     # Do not start from this script
    #     exit 0
    #fi

try to record

recpt1 --b25 --strip 25 30 test.ts
recpt1 25 30 test.ts --device /dev/pt3video*
# then you get a ts file, which includes a low-quality movie.

install recpt1 which includes arib25(decoder)

sudo aptitude install pkg-config
cd ~/src/pt1
hg up -C -r 73 
(or
    wget http://hg.honeyplanet.jp/pt1/rev/c44e16dbb0e2
)
cd arib25
make && sudo make install
#this line generates /usr/local/bin/b25 file.

# And then, configure/compile recpt1 again.
# please check that configure script dump the following line.
""checking for create_arib_std_b25 in -larib25... yes""

install epgrec

install epgdumpr

cd src
#get epgdumppr2.tar.gz from http://www.mda.or.jp/epgrec/index.php?plugin=attach&refer=インストール前の準備&openfile=epgdumpr2.tar.gz
tar axvf epgdumpr2.tar.gz  
cd epgdumpr2
make
sudo cp epgdumpr2 /usr/local/bin/
sudo aptitude install at
sudo vipasswd
### www-dataがnologinの場合は/bin/shにする

install and set up mysql

spare someone the details.

install epgrec

sudo aptitude insatll apache2 libapache2-mod-php5 php5-mysql
cd /var/www
sudo git clone git://git.sourceforge.jp/gitroot/epgrec/epgrec.git
sudo chown www-data:www-data epgrec -R
cd epgrec
sudo chmod 777 cache templates_c video thumbs settings
sudo cp config.php.sample config.php
sudo vi config.php
...
sudo cp do-record.sh.pt1 do-record.sh

# Then access http://localhost/epgrec and continue to set up.
# following this site ↓

epgrecのインストールと設定 - 録画予約システムepgrec

That's all.

links

Comments