[HowTo] Autoedit – Fully automated DVR with commercial detection


#42

Hello,

first of all thank´s a lot for your tut.

I followed all the steps and the installation part seems to work.

If I try to record sth. nothing happens. The output file won´t be touched. The task goes into the autoeditqueue. But than nothing happens.

Then I removed the --wait option in Tvheadend and it ends with an error

(Error while transcoding. The original video file is kept.
02.10.2018 10:45:01 : Aborting…
02.10.2018 10:45:01 )

I didnt add the cron cause I want to get the movies transcoded after recording. But they only get registered in the queue. What then?

Would be great if you could help me.

Please be patient of my bad English.

Greetings.


#43

Hi,

the problem you describe is a little thin to pinpoint exactly.

If you want to transcode it is preferable to transcode after searching for commercials and at a time your system is not used otherwise. That’s exactly the reason I added the --wait switch and cron job. What you described above is the expected behaviour for --wait: Queue the file and do nothing else. The actual processing is done when the cron job starts (or you run autoedit manually).

„Error while transcoding“ indicates either your command for ffmpeg is broken or the file is not accessible. If I had to guess I’d go for wrong file permissions. Keep in mind tvheadend runs on it’s own user so it may not be able to access directories you created with your username.

Please provide:

  • a full log showing the error
  • the full command from tvh
  • your settings file
  • what system you are running

to show more details. Also file info (ls -Alh) of the source’s directory, the source file itself and the target directory might help.

Cheers
Fretzke


#44

Hello,

thanks for reply. Sorry for my late reaction. My system crashed and I had to set it up completly new.

Openmediavault Arrakis is running on a Microserver from HP N40L.

Tvheadend ist installed ontop of the system, Emby is also installed.

I now try to get away from MySql cause of the issues with the latest Libreelec Milhouse Build and SQL.

So now I reinstalled everything on a clean system and here is the following:

TVH default profile post processor command : /usr/bin/autoedit --input "%f" --title "%t" --comskip --transcode peg2_mmal h264_omx 2000k --rename --wait

TVH movies post processor command: /usr/bin/autoedit --input "%f" --title "%t" --comskip --transcode mpeg2_mmal h264_omx 2000k --rename --movie --wait

The logs and settings:

autoedit:

06.10.2018 13:30:00 : New video recorded. The file name is /sharedfolders/Raid/Aufnahmen/TV/2018-10-06/rbb Berlin HD/Verrueckt nach Meer (114)/_ts .
06.10.2018 13:30:00 : Appending video file to queue.
07.10.2018 02:00:01 :
07.10.2018 02:00:10 : Start processing...
07.10.2018 02:00:10 : Fetched next file from queue. Processing /sharedfolders/Raid/Aufnahmen/TV/2018-10-06/rbb Berlin HD/Verrueckt nach Meer (114)/_ts.
07.10.2018 02:00:10 : Cannot move video file to temporary place. Missing permission?
07.10.2018 02:00:10 : Aborting...

ls -Alh ´root´

root@openmediavault:~# ls -Alh
insgesamt 276M
-rw------- 1 root  root  11K Okt 14 09:24 .bash_history
-rw-r--r-- 1 root  root  570 Jan 31  2010 .bashrc
-rw-r--r-- 1 root  root 6,1K Okt  6 12:27 comskip.ini
-rw-r--r-- 1 root  root  50M Sep 20 04:55 emby-server-deb_3.5.3.0_amd64.deb
-rw-r--r-- 1 root  root  50M Sep 20 04:55 emby-server-deb_3.5.3.0_amd64.deb.1
-rw-r--r-- 1 root  root  134 Okt  5 11:22 .inputrc
-rw-r--r-- 1 root  root 178M Okt  6 12:15 jdk-8u181-linux-x64.tar.gz
-rw------- 1 root  root  606 Okt  7 15:11 .mysql_history
drwxr-xr-x 2 root  root 4,0K Okt  6 12:27 .nano
-rw-r--r-- 1 root  root    0 Okt  7 13:43 netstat
drwxr-xr-x 2 root  root 4,0K Okt  6 12:17 .oracle_jre_usage
-rw-r--r-- 1 root  root  148 Aug 17  2015 .profile
-rw-r--r-- 1 root  root   66 Okt  6 12:32 .selected_editor
drwxr-xr-x 2 root  root 4,0K Okt  6 12:26 sources
drwx------ 2 root  root 4,0K Okt  5 11:22 .ssh
drwxr-xr-x 2 Thilo 1000 4,0K Jul  7  2009 tevii_ds3000
-rw-r--r-- 1 root  root 322K Nov 20  2014 tevii_ds3000.tar.gz
-rw-r--r-- 1 root  root  205 Okt  6 12:20 .wget-hsts

ls -Alh Target

root@openmediavault:/sharedfolders/Raid/Aufnahmen# ls -Alh
insgesamt 36K
-rw-rw-r--+ 1 root root     0 Okt  7 02:00 autoedit.lockfile
-rwxrwxr-x+ 1 kodi users 2,8K Okt 14 02:00 autoedit.log
-rwxrwxr-x+ 1 kodi users  154 Okt  6 13:30 autoeditQueue.txt
drwxrwxr-x+ 2 kodi users 4,0K Okt  6 12:31 Movies
drwxrwxr-x+ 3 kodi users 4,0K Okt  6 12:40 TV

settings:

##Change personal settings here:
#
#Change the encoding table to be used
export LANG=de_DE.UTF-8

#Path where the processed files will be stored. Filebot will create corresponding subfolders here.
outfolder="/sharedfolders/Raid/Aufnahmen/"

#default ini file for comskip if parameter not givven
comskipINI="/home/comskip.ini"

##Filebot settings:
#language
language="de"

#Naming format for series
#Standard is "series_title (year)/season.episode_title.file_extension"
#e.g. "Breaking Bad (2008)/S04E01.Box Cutter.mkv"
#Including capital letters and spaces, file will be stored in the same directory
nameFormatSeries='/sharedfolders/Raid/Aufnahmen/TV/{n.ascii().replaceAll(/[?]+$/).tr("–","_").tr("*","_").tr("|",("_")} ({y})/{s00e00}.{t.ascii().replaceAll(/[?]+$/).tr(":","_").tr("*","_").tr("|","_")}'

#Naming format for movies
#Standard is "title (year)/title.file_extension"
#e.g. "Rogue One A Star Wars Story (2016)/Rogue One A Star Wars Story.mkv"
#Including capital letters and spaces, file will be stored in a separate movie directory
nameFormatMovie='/sharedfolders/Raid/Aufnahmen/Movies/{n.ascii().replaceAll(/[?]+$/).tr(":","_").tr("*","_").tr("|","_")} ({y})/{n.ascii().replaceAll(/[?]+$/).tr(":","_").tr("*","_").tr("|","_")}'


#General settings
#–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

#Log file
autoeditlog="${outfolder}"autoedit.log

#Queue file
queuefile="${outfolder}"autoeditQueue.txt

#–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

syslog:

syslog

Thanks in advance.


#45

Hi No3light,

in the meantime you may have already figured out by yourself, but your problem’s cause lies with the target directory permissions.

In settings.ini you define /sharedfolders/Raid/Aufnahmen/ as working directory. You did not include the permissions for this dir, but from the file list I conclude you use Linux ACL there, too. This means, while your user has access to this directory, the user executing the script may not.

I personally had a similar problem once caused by a Windows machine over Samba.

You can get the permissions straight with the getfacl and setfacl commands, but I can offer little help there as I’m no expert on these advanced settings.

I personally prefer to simply removing ACL all together with setfacl -bn <directory> as I have no need for this in my private and closed home network.

Cheers
Fretzke