MythTV Primer An introduction to MythTV By Gus Wirth 21 Apr 2011
MythTV ● A Digital TV Recorder ● Media player ● Other video ● Music ● Photos ● Games ● Web ● Motion (video monitoring system) ● Other plugins
Overview Backend Database Schedules Frontend Video Source Storage
Components ● Backend ● Recorder ● Streamer ● Scheduler ● Transcoder (opt) ● Commercial Detection and marking
Components ● Database ● MySQL ● Stores all recording info – Show names and times – Recording rules – Recorded/Previously recorded shows – Stations
Components ● Video sources ● Tuners – ATSC (digital) Over-The-Air – NTSC (analog) Over-The-Air, some cable – QAM 64/256 Cable (clear only) ● Video capture – NTSC composite – NTSC S-Video – HD Firewire video camera – V4L2 video source
Components ● Storage ● File system – local or remote – Must handle huge files ● Need lots of space: – NTSC ~2GB/hr – ATSC ~8GB/hr
Components ● Schedules ● Provide program names, times, length ● Maybe get program category ● Other program info – Repeat – Actors – Directors – Brief description of episode
Components ● Frontend ● Schedule ● Playback ● Plugins
Building a system ● What do you want to record? ● Over-The-Air (OTA) – – ATSC (digital) MPEG2-TS – NTSC (analog) (obsolete in US except low power) ● Hardware transcoding MPEG2-PS ● Software transcoding MPEG2/4, RTjpeg, other ● Cable – QAM 64/256 unencrypted only (getting rare) [1] – NTSC direct (increasingly rare) – Converter box ● Other video source [1] Negligible chance with upcoming HDHomeRun Prime from Silicon Dust
Requirements ● Recording/Backend ● Hardware encoding – 600MHz CPU – 256 MB RAM – Less if no commercial detection ● Software encoding (NTSC) – 1GHz CPU – 512MB RAM
Requirements ● Playback/Frontend ● Brute force – NTSC ● 1 GHz CPU ● 128 MB RAM – HD (1080i) ● 2.8 GHz CPU ● 512 MB RAM ● Hardware assist (nVidia card with VDPAU) – Intel Atom or AMD Sempron (lowest power) – 256 MB RAM
About accelerated playback ● Hardware decoding support ● XvMC – X video Motion Compensation (MPEG-2) – nVidia, Intel, Via (XvMC-VLD) – Deprecated, discontinued in mythtv-0.25 ● VDPAU – Video Decode and Presentation API for Unix (MPEG-2, H.264, VC-1) – nVidia – Works great, well supported with other apps also ● CrystalHD (Broadcom Hardware) – Not yet in MythTV but experimentally supported – Not worth the cost if you have a regular PC
About accelerated playback ● Hardware decoding support (continued) ● XvBA – X video Bitstream Acceleration – ATI/AMD – Not working ● VA-API – Video Acceleration Application Programming Interface – Intel, maybe ATI/AMD – Not working but Real Soon (TM) ● Bottom Line: nVidia video card or brute force ● Might change with migration to OpenGL rendering
Choose a capture device ● Tuner/capture card PCI/PCIe inside PC ● HDHomeRun (external tuner) ● Can provide virtual tuners for multi-stream broadcasts ● USB tuner/capture ● Set-top Firewire (rare) ● External capture ● Hauppauge HD-PVR
Choose a capture device (cont) ● Check compatibility ● mythtv.org ● ● ● Mailing lists and forums
Schedules ● Schedules Direct ● Commercially obtained data, download from Internet ● $20/year subscription - well worth it ● built in to MythTV ● XML format, can be downloaded with other apps ● EIT - Event Information Tables (ATSC) ● Dependent on station ● Difficult to work with, must read tuner for info ● Other - you're on your own
Software Installation ● USE A DISTRIBUTION! ● LinHES - – Linux Home Entertainment System, previously known as Knoppmyth – Based on Arch Linux ● Mythdora - – Based on Fedora ● Mythbuntu - – Based on Ubuntu ● MiniMyth -
Software Installation (cont) ● Plan to install at least twice ● Read the instructions on mythtv.org ● ● Read distributions instructions
Troubleshooting ● Schedules - tvlistings.py ● Downloads the XML directly to a file for analysis ● Tuner/Capture card ● Xawtv - ● mplayer - can read video device directly ● ivtvctl - for certain cards ● Database ● Command line tools ● MyPHPAdmin
Troubleshooting (cont) ● Playback ● mplayer - play file directly ● mediainfo - – Is the file what you think it is? ● xorg.conf – Correct video driver selected (e.g. nvidia, intel, ati, via) – Acceleration enabled (e.g. XvMC) – Secondary display enabled if required – DRI and DRM ● top - CPU consumption