Project

General

Profile

How to move file after recording?

Added by Stefan N. almost 8 years ago

Hi there,

how could I automatically move a recording to another folder (which is mounted to a remote SMB share) after it has been finished? Sorry if this is a silly question, but I'm new to TVH and the linux world.

Best regards

Stefan


Replies (16)

RE: How to move file after recording? - Added by Anthony Thomas almost 8 years ago

How remote?

If it is on your LAN then you should be able to record directly to it.

RE: How to move file after recording? - Added by Stefan N. almost 8 years ago

That's what I did so far, but I have many artifacts in the recordings. One told me not to record to a LAN share as this might cause the issues and record to the attached USB stick (using RPi3). But I need the files on my LAN server so this would only be an option if I could have them moved automatically.

Or might the artifacts have a different root cause? They look like skips of about 1-2 secs, so parts of the movie/sound are actually missing, it's not only noise/artifacts.

RE: How to move file after recording? - Added by Ulrich Buck almost 8 years ago

Alternatively use the "Post-processor command" described here:
http://docs.tvheadend.org/webui/config_dvr/
You will need to be familiar with the linux command line for this.

RE: How to move file after recording? - Added by Anthony Thomas almost 8 years ago

Post-processor commands, as Ulrich has mentioned would be a good route.

I guess you could be overloading the USB bus or the network connection isn't so great. When you had the artifacts were you using a wired LAN connection or WiFi?

RE: How to move file after recording? - Added by Stefan N. almost 8 years ago

I just use LAN. I meanwhile did some tests and found out the artifacts also appear when recording to USB. Seems to correlate with "Continuity counter error" that appear while recording.
I read in the forum about this issue, but the root cause can be anything. I now upgraded my Raspbian with apt and will get a premium antenna cable to connect the used PC-TV 461e USB to the multiswitch. Maybe this will help already. If not, I have to come back here. I you have some more tips on possible root causes, feel free to post here :)

RE: How to move file after recording? - Added by Robert Cameron almost 8 years ago

Remember with RPis, the network, USB and SD card are all on the same bus. So recording, streaming, input, &c. are all sharing the same limited amount of bandwidth. Errors in recording can usually be traced to this shortcoming.

RE: How to move file after recording? - Added by Stefan N. almost 8 years ago

Sure, but the RPi3 has a good punch of power, in addition I use the USB Bootloader, so no SD card is used at all and I also do not use USB so much, only for the DVB card. The only thing the RPi has to do is recording the streams, not even HD streams, only SD, and save them on the network share. No input, no Live TV in parallel, nothing. I had used a RPi2 with OpenELEC before and everything worked fine there, so I do not think it is a performance issue.

RE: How to move file after recording? - Added by Anthony Thomas almost 8 years ago

If the OpenELEC setup worked, go back to that with LibreELEC. You can run it headless if you want to.

RE: How to move file after recording? - Added by Stefan N. almost 8 years ago

I read several times that Raspbian would be much better for the Pi than OpenELEC. What's the benefit of LibreELEC? If it is possible to avoid setting up the whole PI again from scratch, I would prefer that, it took me two days to get everything setup and running ^^

RE: How to move file after recording? - Added by Robert Cameron almost 8 years ago

Stefan N. wrote:

Sure, but the RPi3 has a good punch of power, in addition I use the USB Bootloader, so no SD card is used at all and I also do not use USB so much, only for the DVB card. The only thing the RPi has to do is recording the streams, not even HD streams, only SD, and save them on the network share. No input, no Live TV in parallel, nothing. I had used a RPi2 with OpenELEC before and everything worked fine there, so I do not think it is a performance issue.

Except, it's the DVB input stream on USB, the network stream to save to your network share, and when you have any clients, the network stream reading in from the network share again, and out to the clients. So, if you have a client watching, that is 4 things all going on simultaneously on the same bus. Also, the RPi only does 100Mb ethernet, not GbE.

RE: How to move file after recording? - Added by Chris MacIntosh-Dixon almost 8 years ago

I use a rpi2, running raspbian for the tvh service with 2 DVB S2 (HD) usb freesat recievers. All recordings are stored on file server (SMB) share on LAN. LAN is running on a 1GbE switch. With this in play I can record 2 HD Streams and watch a third without any drops or issues with the recordings. THE total USB bandwidth is 480Mbps, this I would calculate should be sufficent to run approx 6 channels (HD@15Mbps both from the USB reciever and across the LAN). I haven't any experience of running tvh on [open|libre]elec, but on the raspbian Jessie OS i use the processor is sitting at approx 5% during normal ops.

RE: How to move file after recording? - Added by Stefan N. almost 8 years ago

I managed to move the file after recording, just using a move command. However, this causes another issue:

After moving the file, the recording is flagged as broken with "File missing". I could avoid that by copying the file, but then the copy is not deleted on the share when removing the recording in TVHeadend. And I do not have enough space on the Pi to record several movies.

The main problem is that my SMB share spins down the drives after a certain while. And when TVHeadend wants to start a recording while the drives are spinned down, the recording fails. Is it somehow possible to trigger an action that the drives are spinned up before a recording starts, some kind to pre processing like requesting a file list from the SMB share?

RE: How to move file after recording? - Added by Mark Clarkstone almost 8 years ago

Stefan N. wrote:

I managed to move the file after recording, just using a move command. However, this causes another issue:

After moving the file, the recording is flagged as broken with "File missing". I could avoid that by copying the file, but then the copy is not deleted on the share when removing the recording in TVHeadend. And I do not have enough space on the Pi to record several movies.

The main problem is that my SMB share spins down the drives after a certain while. And when TVHeadend wants to start a recording while the drives are spinned down, the recording fails. Is it somehow possible to trigger an action that the drives are spinned up before a recording starts, some kind to pre processing like requesting a file list from the SMB share?

Just create a simple script that writes to the share & then get tvh to call it before it begins the recording (the "Pre-processor command" setting for the DVR profile).

RE: How to move file after recording? - Added by Stefan N. almost 8 years ago

I only know about a Post-processor command, where do I find the Pre-processor command?

RE: How to move file after recording? - Added by Mark Clarkstone almost 8 years ago

Stefan N. wrote:

I only know about a Post-processor command, where do I find the Pre-processor command?

Right above the post processor in my version (latest git).

RE: How to move file after recording? - Added by Stefan N. almost 8 years ago

I've installed the lastest release on my RPi3 with is 4.8 Jessie. What do I have to do to get the version which you have, because it seems I do not have this preprocessor option...

    (1-16/16)