analyser
Posts: 5
Joined: Tue Jun 25, 2019 5:00 pm

How do I add "time shifting" to Raspberry Pi TV HAT

Tue Jun 25, 2019 5:39 pm

Hi

This is question before buying..to understand if it's passable.

I would like to build a server that receive DVB T2 channel and:

1. Send the channels to wifi
(this I think I can build https://www.youtube.com/watch?v=eTSd8klU_yE )



2. Record automatically the last 24 hours of (at least) 3 channels,
3. Delete automatically Recorded channels that older than 24 hours
Same places call it "time shifting" and same "catch up"

setup:
Raspberry Pi 4 with 4GB and 128 GB sd card
Raspberry Pi TV HAT
Raspbian with tvheadend


So is this passable ? and if it does, how do I do that ?



Thanks:)
Last edited by analyser on Tue Jun 25, 2019 7:14 pm, edited 1 time in total.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13142
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Tue Jun 25, 2019 5:54 pm

analyser wrote:
Tue Jun 25, 2019 5:39 pm

Same places call it "time shifting" and same "catch up"
I call it "recording a television program".

analyser
Posts: 5
Joined: Tue Jun 25, 2019 5:00 pm

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Tue Jun 25, 2019 6:53 pm

:)

This is not a "standard" recording television, this is more like "back in time"

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13142
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Tue Jun 25, 2019 7:45 pm

What is the difference?

You mean it records in three circular buffers all having 24H capacity?
while also streaming the same three video channels to Ethernet...
sound like a tall order indeed.
what storage device can accept three video streams (unencoded) in real time?

is the TV hat even capable of receiving three TV program's at the same time?
I know that the SD-card interface has been enhanced to give twice the performance (with some high end cards), but continuous writes of three different TV streams????

good luck with this, I think you will need it... :mrgreen:

analyser
Posts: 5
Joined: Tue Jun 25, 2019 5:00 pm

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Tue Jun 25, 2019 9:25 pm

Thanks for your reply,
let me explain myself with an example


It need to record three channels in circular of 24H
Now, it will only play a recorded channel if I open the channel and click on back button


For example:
There is a good series on channel 2, that you like to which, but unfortunately you missed it (stuck on traffic or what ever...)
So you open your TV (Mi Box in my my case) > "TV app"> channel 2>and then click on back button on your remote to "go back in time" to the start of your series


My plan is to use Raspberry Pi TV HAT (DVB T2) on the Raspberry Pi 4
All recorded channels will be stored on the raspberry pi sd card


Is this possible from software and hardware perspektive ?
How about circular record for only one channel

gkreidl
Posts: 6335
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Wed Jun 26, 2019 4:14 am

I do quite a lot of TV recording on the RPi. I'm not using the TV HAT, but a DVB-S2 receiver connected via USB.

I do not use tvheadend, but mumudvb using my own frontend. My software can stream single channels, multiple channels from one Transponder or a comple transponder (all channels).

You should NEVER use the SD card for recording but an external HDD (or maybe SSD). The SD will wear out soon.

I have not tried recording multiple channels at the same time because everything (HDD, DVB, TCP or UDP streaming over ethernet) runs throught the same USB-2 channel. But with USB-3 on the RPi 4 it shouldn't be a problem at all.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Wed Jun 26, 2019 4:34 am

gkreidl wrote:
Wed Jun 26, 2019 4:14 am
You should NEVER use the SD card for recording but an external HDD (or maybe SSD). The SD will wear out soon.
Isn't recording video exactly one of the things that SD cards are designed for? Surely this will give less wear that normal OS usage.

Having said that, I use an external 240GB SSD for storing my tvheadend recordings. Mostly for space reasons.
Unreadable squiggle

gkreidl
Posts: 6335
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Wed Jun 26, 2019 6:35 am

rpdom wrote:
Wed Jun 26, 2019 4:34 am
gkreidl wrote:
Wed Jun 26, 2019 4:14 am
You should NEVER use the SD card for recording but an external HDD (or maybe SSD). The SD will wear out soon.
Isn't recording video exactly one of the things that SD cards are designed for? Surely this will give less wear that normal OS usage.

Having said that, I use an external 240GB SSD for storing my tvheadend recordings. Mostly for space reasons.
The OP wants to record 3 DVB-T2 (HD) channels for 24 hours. One HD channel may need 70-90 GB for 24 h recording. So this application would write approx. 240 GB per day (and remove it afterwards) to the SD card. The SD card must be large enough (256 GB at least) and it would almost get a complete rewrite every day.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Wed Jun 26, 2019 7:06 am

gkreidl wrote:
Wed Jun 26, 2019 6:35 am
rpdom wrote:
Wed Jun 26, 2019 4:34 am
gkreidl wrote:
Wed Jun 26, 2019 4:14 am
You should NEVER use the SD card for recording but an external HDD (or maybe SSD). The SD will wear out soon.
Isn't recording video exactly one of the things that SD cards are designed for? Surely this will give less wear that normal OS usage.
The OP wants to record 3 DVB-T2 (HD) channels for 24 hours. One HD channel may need 70-90 GB for 24 h recording. So this application would write approx. 240 GB per day (and remove it afterwards) to the SD card. The SD card must be large enough (256 GB at least) and it would almost get a complete rewrite every day.
That shouldn't be a problem. How many writes is each block good for? About 10,000? So one write per block per day would give 10,000 days of use (at best).

The problems occur with things like log file writes where the same block is written to over and over again. Even with wear levelling this can kill a card faster than writing three large video files a day to it.
Unreadable squiggle

gkreidl
Posts: 6335
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Wed Jun 26, 2019 7:57 am

rpdom wrote:
Wed Jun 26, 2019 7:06 am
gkreidl wrote:
Wed Jun 26, 2019 6:35 am
rpdom wrote:
Wed Jun 26, 2019 4:34 am


Isn't recording video exactly one of the things that SD cards are designed for? Surely this will give less wear that normal OS usage.
The OP wants to record 3 DVB-T2 (HD) channels for 24 hours. One HD channel may need 70-90 GB for 24 h recording. So this application would write approx. 240 GB per day (and remove it afterwards) to the SD card. The SD card must be large enough (256 GB at least) and it would almost get a complete rewrite every day.
That shouldn't be a problem. How many writes is each block good for? About 10,000? So one write per block per day would give 10,000 days of use (at best).

The problems occur with things like log file writes where the same block is written to over and over again. Even with wear levelling this can kill a card faster than writing three large video files a day to it.
That's true. But both of us use either an external SSD or HDD for TV recording :-)
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

analyser
Posts: 5
Joined: Tue Jun 25, 2019 5:00 pm

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Wed Jun 26, 2019 8:19 am

Thanks all for your replies,

It's 1 HD channel and 2 sd
I dont think storage is the problem, I can use external HDD

I dont know if:

A. Raspberry Pi TV HAT can capture 3 dvb t2 channel at the same time ?
B. Can TVheadend record 3 channel and delete them in 24H circle ?
C. Does the Kodi add on support "back in time"



It look like I can do "pause" for a channel.
https://kodi.wiki/view/Tvheadend
https://tvheadend.readthedocs.io/en/lat ... timeshift/

User avatar
thagrol
Posts: 3178
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Wed Jun 26, 2019 12:14 pm

May I suggest an alternative approach though as I don't have a TV Hat this is speculative.

If all three channels are on the same mux, why not just write the entire mux to your buffer storage? Then decode that via the TV hat when needed.

More data, sure but also more options on plackback and possible less processing during recording.

No idea if the raw mux can be accessed through the TV hat and passed back to it for decoding.

If the three channels you want aren't on the same mux you won't be able to do what you want with the TV hat. I understand it has only a single tuner so can only access a single mux at a time.
Arguing with strangers on the internet since 1993.

analyser
Posts: 5
Joined: Tue Jun 25, 2019 5:00 pm

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Wed Jun 26, 2019 1:22 pm

Yes, they are on the same mux and storage is not a problem.

Your idea is to build a server from scratch, and it's too much job...

User avatar
davidcoton
Posts: 5083
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: How do I add "time shifting" to Raspberry Pi TV HAT

Mon Jul 01, 2019 1:31 pm

analyser wrote:
Wed Jun 26, 2019 1:22 pm
it's too much job...
Big ideas seldom have simple answers. So if you want to do something different, expect it to be a lot of work. If you dn't want to do the work, you are stuck with what existing products will do. You should be able to fing the documentation with Google, if not, it's still a big job to work out how to do it.
Signature retired

Return to “Beginners”