Wednesday, March 3, 2010

Freeview ( DVB-T ) Linux / Fedora in New Zealand.

I dont have anything fancy other than a fairly good CPU. Its an AMD Athlon(tm) 64 X2 Dual Core Processor 4000+.

I have an avermedia A800 DVB-T tuner from www.nicegear.co.nz

I DO NOT have a VDPAU enabled graphics card which can do on board H.264 decoding for me. That will be soon though. Need to save a bit of cash first.

I am in New Zealand so there are some special areas of concern that needed to be addressed.

Here is a very brief rundown of how i get free view working in my linux.

**** COMMENT ****
Here is a great website. I use this now for post processing.
http://quadpoint.org/projects/simplerip#audio_and_video_bitrates

On my fedora system i have to change -oac copy to -oac pcm and of course I still use my compiled mplayer and the -lavdopts fast:threads=2 option on the 3 lines.

Steps to get Mplayer working.


********************************************************************************
******************** ~./mplayer/channels.conf **********************************
********************************************************************************

TV ONE:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:250+100:300:1200
TV2:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:251+101:301+1010:1201
TVNZ 6:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:252+102:302+1020:1202
TVNZ 7:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:253+103:303+1025:1203
TV3:570000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:450+300:410:1300
C4:570000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:451+301:401:1301
TV3 PLUS1:570000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:452+302:402:1302
Maori Television:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:550+200:600:1400
Parliament TV :666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:551+201:601:1401
Test Channel:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:552+202:602:1402
ChineseTV:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:553+203:603:1403
PRIME:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:554+204:604:1404
Reserved 6KSD:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0:605:1405
Freeview | HD:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:556+206:606:1406
Radio NZ National:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0+220:620:2000
Radio NZ Concert:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0+221:621:2001
BaseFM:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:559+209:609:2002
tvCentral:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:560+210:610:1408

********************************************************************************
******************** The DEVEL FILES I INSTALLED ( RELEVANT ONES ) *************
********************************************************************************

Feb 03 21:38:08 Installed: alsa-lib-devel-1.0.22-2.fc12.x86_64
Feb 04 14:32:30 Installed: xorg-x11-drv-nvidia-devel-190.53-1.fc12.x86_64
Feb 04 14:37:13 Installed: gstreamer-devel-0.10.25.1-3.fc12.x86_64
Feb 04 14:37:15 Installed: gstreamer-plugins-base-devel-0.10.25.1-2.fc12.x86_64
Feb 04 14:37:16 Installed: gstreamer-plugins-bad-devel-0.10.17-2.fc12.x86_64
Feb 04 14:37:17 Installed: gstreamer-plugins-good-devel-0.10.17-4.fc12.x86_64
Feb 04 14:42:59 Installed: libvdpau-devel-0.3-1.fc12.x86_64
Feb 04 15:02:07 Installed: x264-devel-0.0.0-0.26.20091026gitec46ace7.fc12.x86_64
Feb 04 15:52:22 Installed: libXvMC-devel-1.0.4-8.fc12.x86_64
Feb 18 17:46:24 Installed: kernel-devel-2.6.31.12-174.2.19.fc12.x86_64
Feb 23 21:53:46 Installed: lame-devel-3.98.2-3.fc11.x86_64
Feb 23 21:53:47 Installed: xvidcore-devel-1.2.1-3.fc12.x86_64


Make sure you also have the relevant libraries that go with these development
packages.


********************************************************************************
******************* COMPILE MPLAYER WITH MULTI THREADING ***********************
********************************************************************************

grab mplayer svn
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

now get ffmpeg-mt
git clone git://gitorious.org/ffmpeg/ffmpeg-mt.git

replace the libav* folders in mplayer-svn with the libav* folders in ffmpeg-mt

cd mplayer
./configure
*** FOR 64 BIT FEDORA use ./configure --libdir=/usr/lib64

*** WHEN this completes have a look to see which modules are compiled in. The
*** video out, video codecs, audio out and audio codecs will be listed.
*** If you are missing any you need or think you might need then install the
*** relevant library and -devel packages and run ./configure again.

make

********************************************************************************
******************* RESULTS FROM MY ./configure ********************************
********************************************************************************

Enabled optional drivers:
Input: dvdnav(internal) ftp pvr tv-v4l2 tv-v4l tv libdvdcss(internal) dvdread(internal) vcd dvb network
Codecs: xvid libavcodec(internal) real xanim faad2(internal) libmpeg2(internal) mp3lib(internal) tremor(internal)
Audio output: alsa oss v4l2 mpegpes(dvb)
Video output: v4l2 pnm jpeg matrixview opengl mpegpes(dvb) fbdev xvidix cvidix vdpau xv x11 xover yuv4mpeg md5sum tga

Disabled optional drivers:
Input: vstream radio tv-dshow live555 nemesi cddb cdda smb
Codecs: libschroedinger libdirac x264 libdv libopencore_amrwb libopencore_amrnb qtx win32 faac musepack libdca liba52 libtheora speex toolame twolame libmad liblzo gif OpenJPEG
Audio output: sun openal jack pulse nas esd arts ivtv dxr2 sdl
Video output: zr zr2 ivtv dxr3 dxr2 sdl vesa gif89a svga caca aa ggi xmga mga winvidix 3dfx dga xvmc dfbmga directfb bl xvr100 tdfx_vid wii s3fb tdfxfb

********************************************************************************
******************* Here is a link to a person who did it in mandriva **********
********************************************************************************
http://blog.linuxbox.co.nz/2008/08/hauppauge-wintv-hvr900-on-mandriva.html

********************************************************************************
******************* Various mplayer commands ***********************************
********************************************************************************

RECORD A CHANNEL INDEFINATELY ( KILL OR CTRL+C TO END THE THING )
#!/bin/bash
/home/dave/devel/mplayer-mt/mplayer_svn/mplayer -dvbin file=/home/dave/.mplayer/channels.conf -dumpfile /home/dave/Videos/$1.ts -dumpstream dvb://"$2"


ENCODE A RECORDING
#!/bin/bash
/home/dave/devel/mplayer-mt/mplayer_svn/mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd -vf scale=480:576,harddup -srate 44100 -af lavcresample=44100 -lavcopts vcodec=mpeg2video:mbd=2:keyint=15:vrc_buf_size=917:vrc_minrate=600:vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224:aspect=16/9 -ofps 25 -lavdopts fast:threads=4 -mc 10 -o /data/$1.mpg -quiet $1


WATCH A RECORDING. THIS IS THE RAW STREAM CAPTURED DURING BY THE RECORD A CHANNEL SCRIPT ABOVE.

#!/bin/bash
/home/dave/devel/mplayer-mt/mplayer_svn/mplayer -vc ffh264 -vo gl -lavdopts fast:threads=4 -vf pp=fd -mc 10 -framedrop -cache 10240 -delay -0.3 /home/dave/Videos/$1


WATCH TV STRAIGHT. THIS IS FINE FOR ALL CHANNELS EXCEPT TV3 WHICH IS AT FULL HD AND MY CPU DOESNT DECODE IT FAST ENOUGH. EVEN IN MULTI THREADING.

#!/bin/bash
/home/dave/devel/mplayer-mt/mplayer_svn/mplayer -vo gl -lavdopts fast:threads=2 -mc 10 -framedrop -vf pp=fd -cache 10240 -delay -0.3 dvb://"$1"

So have fun.
Post a Comment