Code:
if anyone could write an idiot's guide to setting up NPVR on any linux distro
You first have to have a working tv tuner with kernel firmware support.
Daily recording TV.
If the machine is asleep, then wake it up with cron or at.
Example, record for 1 hour, go to sleep:
Code:
#! /usr/bin/env bash
#dvb:// recorder. Requires dvbv5-zap and a dvb_channel.conf
#Path for output file
cd $HOME/tv
#Path to channels.conf
conf="$HOME/.mplayer/dvb_channel.conf"
#Get channels ID's from conf
channels=$(grep -oP '(?<=\[).*(?=\])' < "$conf")
#Recording time seconds
t=3600
PS3="
Enter channel number: "
#If mobile antenna, allow antenna adjust
message="
Select channel then adjust antenna for best signal quality
while watching signal output. Press (enter) to record that
channel once good signal is acquired. (enter) again to stop.
-----------------------------------------------------
Select a channel. Ctrl C to exit.
"
#Main loop
while :; do
clear
echo "$message"
select opt in $channels; do
#No Overwrite of .ts files
num=1
until [ ! -e tv$num.ts ]; do
num=$(( $num + 1 ))
done
#Output to tv"$num".ts
dvbv5-zap -ssrc "$conf" "$opt" -o tv"$num".ts &
sleep "$t"
pkill dvbv5-zap
#Go to sleep
sudo systemctl suspend
break
done
done
See:
man bash
man systemctl
man cron
man at
man dvbv5-zap
It's a mpeg2 transport stream
Code:
ffprobe -hide_banner tv1.ts
[mpeg2video @ 0x55d87ccf6440] Invalid frame dimensions 0x0.
Last message repeated 34 times
[mpegts @ 0x55d87ccf2700] PES packet size mismatch
Input #0, mpegts, from 'tv1.ts':
Duration: 00:00:18.78, start: 58238.524667, bitrate: 2756 kb/s
Stream #0:0[0x41]: Video: mpeg2video (Main), yuv420p(tv, top first), 704x480 [SAR 40:33 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x44]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
I would run that through ffmpeg if I was going to keep it.
Code:
ffmpeg -i tv1.ts -c:a copy -c:v copy tv1.mp4
Or re encode it into x264/mp4.
From the desktop as I write this.
Code:
curl -F'file=@rtv1.jpg' https://0x0.st
https://0x0.st/zD91.jpg
curl -F'file=@rtv2.jpg' https://0x0.st
https://0x0.st/zD9j.jpg
https://0x0.st/zD91.jpg
https://0x0.st/zD9j.jpg
Use kaffeine or whatever player that you wish.