Anyone else having problems with commercial removal in 0.28?

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

ricks03
Junior
Posts: 61
Joined: Thu Oct 01, 2015 8:59 pm
United States of America

Anyone else having problems with commercial removal in 0.28?

Post by ricks03 » Sat Nov 19, 2016 4:56 pm

I upgrade my myth environment from myth *mumble old* to 0.28, and commercial removal is no longer working.

I updated my script to this: https://www.mythtv.org/wiki/Script_-_RemoveCommercials and updated the command line parameters.

Running removecommercials from the command line also (figuring out all of the variables for the command line) doesn't work.

Just wanted to know if there's a simple quick solution. There's a bug open for mythtranscode deleting the original file.

Just wanted to know if there's a known "yeah do this", or if anyone has 0.28 successfully performing commercial removals. Thanks!

daraden
Senior
Posts: 169
Joined: Tue Feb 23, 2016 7:33 am
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by daraden » Sun Nov 20, 2016 8:44 am

I had issues with mythtranscode on .27 so i ended up writing my own scripts for removing commercials and transcoding that bypass it all together.
the following python script is only for removing commercials.
features:
no additional components to install, uses ffmpeg or mythffmpeg
can be configured to use commercial flagging results as a cut-list
can be configured to save a copy of the original file (when not using output file)
automatically rebuilds seek table
-o option for specifying an output file(original file and database will not be changed)
Note: Output file will be an mpeg-ts file regardless of file extension used

Code: Select all

#!/usr/bin/env python2
#MythTV commercial removal -- by Daraden
#usage userjob = /path to script/script.py --jobid %JOBID%
#/path to script/script.py --chanid --starttime can be used for cli
from MythTV import Job, Program, Recorded, System, MythDB, findfile, MythError, MythLog, datetime
import argparse
import subprocess
import os
import sys
import shutil
from glob import glob
import time
from datetime import timedelta
import logging
db=MythDB()

#set this to True to use commflag results as cut list
use_commflag = False
#save copy of original file as .old if not using output file
save_old = False
#user needs write access to this directory to save logfile
logdir ='/var/log/mythtv/'

#logging setup for file and console
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
lf= logging.Formatter('%(asctime)s:%(levelname)s:%(message)s')
if os.access(logdir,os.W_OK):
    fh = logging.FileHandler(filename='%scut.log'%(logdir),mode='w')
    fh.setLevel(logging.DEBUG)
    fh.setFormatter(lf)
    logger.addHandler(fh)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
ch.setFormatter(lf)
logger.addHandler(ch)

def run_cut(jobid=None,chanid=None,starttime=None,outfile=None):
    logging.info('Started')
    #check for ffmpeg or mythffmpeg
    ffmpeg = prog_check()[0]
    
    logging.debug('ffmpeg=%s',ffmpeg)

    if jobid:
        job = Job(jobid, db=db)
        chanid = job.chanid
        starttime = job.starttime
        logging.debug('chanid=%s starttime=%s',chanid,starttime)
    if not jobid:
        chanid = chanid
        starttime = starttime
        logging.debug('chanid=%s starttime=%s',chanid,starttime)

    rec = find_rec(chanid,starttime)
    logging.debug('DB recording entry=%s',rec)
    sg = findfile('/'+rec.basename, rec.storagegroup, db=db)
    infile = os.path.join(sg.dirname, rec.basename)
    tmpdir = sg.dirname +'crtmp/'
    tmp_chk(tmpdir)

    if save_old and not outfile:
        shutil.copyfile(infile,'%s.old' % infile)

    if outfile != None:
        Outfile = outfile
    elif outfile == None:
        Outfile = infile

    if rec.cutlist == 1 or use_commflag == True:
        if jobid:
            job.update({'status':job.RUNNING, 'comment':'Removing Cutlist'})
        logging.info('getting cutlist')
        if rec.cutlist == 1:
            cut_list =''.join(str(rec.markup.getcutlist())).replace('[','').replace(']','').replace('(','').replace(')','').replace(' ','')
        elif rec.cutlist == 0 and rec.commflagged == 1:
            cut_list =''.join(str(rec.markup.getskiplist())).replace('[','').replace(']','').replace('(','').replace(')','').replace(' ','')
        else:
            print 'No cut/skip list found'
            logging.debug('No cut/skip list found')
            sys.exit(1)            
        cutlist = cut_list
        if cutlist.startswith('0,'):
            cutlist = cutlist.replace("0,",'',1)
        if cutlist.endswith(',9999999'):
            cutlist = cutlist.replace(",9999999",'',-1)
        logging.debug('Myth cutlist:%s',cut_list)
        logging.debug('FFmpeg cutlist:%s',cutlist)
        logging.info('cutting started')
        cut =subprocess.Popen([ffmpeg,'-i',infile,'-c','copy','-map','0','-f','segment','-segment_list','%scut.ffcat'%(tmpdir),'-segment_frames',cutlist,'%scut%%03d.ts'%(tmpdir)],stdout = subprocess.PIPE, stderr = subprocess.STDOUT,universal_newlines=True)
        output = cut.communicate()[0]
        if cut.wait() == 0:
            if jobid:
                job.update({'status':job.RUNNING, 'comment':'Cuting Finished'})
            logging.info('Cuting Finished')
        if cut.wait() != 0:
            if jobid:
                job.update({'status':job.ERRORED, 'comment':'FFMPEG ERROR: cutiing'})
            logging.error('FFMPEG ERROR: cutiing')
            logging.error('%s',output)
            sys.exit(1)

        if jobid:
            job.update({'status':job.RUNNING, 'comment':'Merging Cuts'})
        logging.info('Merging Cuts')
        j = []
        for root, dirs, files in os.walk(tmpdir):
            for files in files:
                if files.endswith('.ts') and files.startswith('cut'):
                    if os.path.isfile(os.path.join(root,files)):
                        j.append(os.path.join(root,files))
        if cut_list.startswith('0,'):
          ls = j[1::2]
        if not cut_list.startswith('0,'):
          ls = j[0::2]
        q =','.join(ls).replace(',','|')
        logging.debug('concat list:%s' % q)
        join =subprocess.Popen([ffmpeg,'-y','-i','concat:%s'%q,'-map','0','-c','copy','-f','mpegts',Outfile],stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
        output = join.communicate()[0]
        if join.wait() == 0:
            if jobid:
                job.update({'status':job.RUNNING, 'comment':'Merging Finished'})
            logging.info('Merging Finished')
        if join.wait() != 0:
            if jobid:
                job.update({'status':job.ERRORED, 'comment':'FFMPEG ERROR: merging'})
            logging.error('FFMPEG ERROR: merging')
            logging.error('%s',output)
            sys.exit(1)
    rem_tmp(tmpdir)
    if  outfile == None:
        clear_markup(rec,infile,outfile)
def clear_markup(rec,infile,outfile):
    logging.info('Started Clearing markup')
    
    logging.debug('rec=%s infile=%s outfile=%s',rec,infile,outfile)
    chanid = rec.chanid
    utcstarttime = rec.starttime
    starttime = str(utcstarttime.utcisoformat().replace(u':', '').replace(u' ', '').replace(u'T', '').replace('-', ''))
    logging.debug('chanid=%s starttime=%s',chanid,starttime)
    logging.info('start clearing markup')
    try:
        rcl = subprocess.Popen(['mythutil','--chanid',str(chanid),'--starttime',str(starttime),'--clearcutlist'], stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
        output1 = rcl.communicate()
        if rcl.wait() == 0:
            logging.info('Cutlist removed for:%s_%s',chanid,starttime)
            logging.debug('%s',output1)
        if rcl.wait() != 0:
            logging.error('MYTHUTIL ERROR: clearing cutlist for:%s_%s',chanid,starttime)
            logging.error('%s',output1)
    except Exception as e:
        logging.error('Mythutil exception clearing cutlist%s',e)
    try:
        rsl = subprocess.Popen(['mythutil','--chanid',str(chanid),'--starttime',str(starttime),'--clearskiplist'], stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
        output2 = rsl.communicate()[0]
        if rsl.wait() == 0:
            logging.info('Skiplist removed for:%s_%s',chanid,starttime)
        if rsl.wait() != 0:
            logging.error('MYTHUTIL ERROR: clearing skiplist for:%s_%s',chanid,starttime)
            logging.error('%s',output2)
    except Exception as e:
        logging.error('Mythutil exception clearing skiplist:%s',e)

    for index,mark in reversed(list(enumerate(rec.markup))):
        if mark.type in (rec.markup.MARK_COMM_START, rec.markup.MARK_COMM_END):
            del rec.markup[index]
    rec.bookmark = 0
    rec.cutlist = 0
    rec.commflagged = 0
    rec.markup.commit()
    rec.basename = os.path.basename(infile)
    rec.filesize = os.path.getsize(infile)
    rec.transcoded = 1
    rec.seek.clean()
    rec.update()
    
    try:
        logging.info('Removing PNG files')
        for png in glob('%s*.png' % infile):
            os.remove(png)
    except Exception as e:
        logging.error('Error removing png files',e)
    try:
        logging.info('Removing JPG files')
        for jpg in glob('%s*.jpg' % infile):
            os.remove(jpg)
    except Exception as e:
        logging.error('Error removing jpg files',e)    
    try:
        logging.info('Rebuilding seektable')
        rst = subprocess.Popen(['mythcommflag','--chanid',str(chanid),'--starttime',str(starttime),'--rebuild'], stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
        output2 = rst.communicate()[0]
        if rst.wait() == 0:
            logging.info('Seektable Rebuilt for:%s_%s',chanid,starttime)
            logging.info('%s',output2)
        if rst.wait() != 0:
            logging.error('MYTHcommflag ERROR: Rebuilding Seektable for:%s_%s',chanid,starttime)
            logging.error('%s',output2)
    except Exception as e:
        logging.error('Mythcommflag ERROR clearing skiplist:%s',e)

def tmp_chk(tmpdir):
        try:
            if os.path.isdir(tmpdir):
                logging.info('temp Folder found:')
                if os.listdir(tmpdir) != 0:
                    logging.warning('Temp folder not empty!:Removing Files:')
                    shutil.rmtree(tmpdir)
                    os.makedirs(tmpdir)
            if not os.path.isdir(tmpdir):
                logging.info('no temp folder found:')
                os.makedirs(tmpdir)
                logging.info('Temp folder created:')
        except Exception as e:
            logging.error('%s',e)
def rem_tmp(tmpdir):
            try:
                if os.path.isdir(tmpdir):
                    logging.info('temp Folder found')
                    shutil.rmtree(tmpdir)
                    logging.info('Temp Folder Removed')
                if not os.path.isdir(tmpdir):
                    logging.info('no temp folder found')
            except Exception as e:
                logging.error('%s',e)
def find_rec(chanid,starttime):
    def local_time_offset(t=None):
        if t is None:
            t = time.time()

        if time.localtime(t).tm_isdst and time.daylight:
            return -time.altzone
        else:
            return -time.timezone

    def RecordedFromBasename(chanid,starttime):
        bnts = '%s_%s.ts' % (chanid,starttime)
        bnmpg = '%s_%s.mpg' % (chanid,starttime)

        x = list(db.searchRecorded(basename=bnmpg))
        if len(x) == 1:
            for recorded in x:
                return recorded
                
        if len(x) != 1:
            x = list(db.searchRecorded(basename=bnts))
            if len(x) == 1:
                for recorded in x:
                    return recorded
            if len(x) != 1:    
                raise LookupError\
        ('unable to find Recorded entry for ChanID %s StartTime %s'\
         % (chanid,starttime))
    try:
        rec = Recorded((chanid,starttime), db=db)
    except:        
        try:
            tzoffset = local_time_offset() / (60*60)
            utcstarttime = datetime.strptime(starttime,"%Y%m%d%H%M%S")
            utcstarttime = utcstarttime + timedelta(hours=tzoffset)
            rec = Recorded((chanid,utcstarttime), db=db)
        except:
            rec = RecordedFromBasename(chanid,starttime)
    return rec
def prog_check():
    instdir = os.confstr(0).split(':')[1]
    if os.access(instdir + '/ffmpeg', os.X_OK):
        ffmpeg = instdir + '/ffmpeg'
    elif os.access(instdir + '/mythffmpeg', os.X_OK):
        ffmpeg = instdir + '/mythffmpeg'    
    elif os.access('/usr/bin/ffmpeg', os.X_OK):
        ffmpeg = '/usr/bin/ffmpeg'
    elif os.access('/usr/bin/mythffmpeg', os.X_OK):
        ffmpeg = '/usr/bin/mythffmpeg'
    else:
        ffmpeg = None
    if os.access(instdir + '/ffprobe', os.X_OK):
        ffprobe = instdir + '/ffprobe'
    elif os.access(instdir + '/mythffprobe', os.X_OK):
        ffprobe = instdir + '/mythffprobe'    
    elif os.access('/usr/bin/ffprobe', os.X_OK):
        ffprobe ='/usr/bin/ffprobe'
    elif os.access('/usr/bin/mythffprobe', os.X_OK):
        ffprobe = '/usr/bin/mythffprobe'
    else:
        ffprobe = None
    if ffmpeg == None or ffprobe == None:
        raise LookupError ('Unable to find ffmpeg/ffprobe')
    return ffmpeg,ffprobe
def main():
    parser = argparse.ArgumentParser(description='MythTV Commercial removal ')
    parser.add_argument('--chanid',action='store',type=str,dest='chanid',help='Channel-Id of Recording')
    parser.add_argument('--starttime',action='store',type=str,dest='starttime',help='Starttime of recording in utc')
    parser.add_argument('--jobid',action='store',type=int,dest='jobid',help='JOBID')
    parser.add_argument('-o',action='store',type=str,dest='outfile',help='Output file to be created')
    args = parser.parse_args()
    if args.jobid:
        run_cut(jobid=args.jobid,outfile=args.outfile)
        sys.exit(0)        
    if args.chanid and args.starttime:
        run_cut(chanid=args.chanid,starttime=args.starttime,outfile=args.outfile)
        sys.exit(0)
    else:
        print 'chanid and starttime or jobid'
main()

ricks03
Junior
Posts: 61
Joined: Thu Oct 01, 2015 8:59 pm
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by ricks03 » Sun Nov 20, 2016 5:07 pm

Can you clarify for me why I would there's a flag for whether to use the commflag results as a cutlist. If it's to remove commercials, why would I not be using the commflag results as a cutlist?

daraden
Senior
Posts: 169
Joined: Tue Feb 23, 2016 7:33 am
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by daraden » Sun Nov 20, 2016 6:52 pm

Its so that you have the option of using the commflag results or a custom cut-list. Since commercial detection is not 100%, some people may prefer to use a manually created cut-list.

ricks03
Junior
Posts: 61
Joined: Thu Oct 01, 2015 8:59 pm
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by ricks03 » Sun Nov 20, 2016 7:19 pm

I get the following error:
Remove Comms.py (Errored: Sun Nov 20, 2016, 02:11 PM)
ERROR: User Job returned non-zero, check logs.

I changed to this:
#set this to True to use commflag results as cut list
use_commflag = True
#save copy of original file as .old if not using output file
save_old = True
#user needs write access to this directory to save logfile
logdir ='/var/log/mythtv/'

I have the following job:
/usr/local/bin/removecommercials.py --jobid %JOBID%

Permissions on /var/log/mythtv
drwxr-xr-x 3 mythtv mythtv 8.0K Nov 20 14:16 mythtv

I see the following in my log:
2016-11-20 14:11:19.256182 I [2341/21013] UserJob_9777 jobqueue.cpp:2410 (DoUserJobThread) - JobQueue: Started Remove Comms.py for "The Andy Griffith Show":"Floyd, the Gay Deceiver" recorded from channel 2502 at 2016-10-18T00:00:00Z
2016-11-20 14:11:24.871506 E [2341/21013] UserJob_9777 jobqueue.cpp:2445 (DoUserJobThread) - JobQueue: User Job 'removecommercials.py --jobid 9777' failed.

~

?

daraden
Senior
Posts: 169
Joined: Tue Feb 23, 2016 7:33 am
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by daraden » Sun Nov 20, 2016 8:03 pm

check /var/log/mythtv/cut.log. also open the srcipt and check that it is not indented,for some reason using select all is adding a tab to every line for me)
Edit: it seems to be an issue with firefox select all works correctly in chrome

ricks03
Junior
Posts: 61
Joined: Thu Oct 01, 2015 8:59 pm
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by ricks03 » Sun Nov 20, 2016 10:56 pm

I downloaded it from Chrome.

no /var/log/mythtv/cut.log.

For a moment I thought I didn't have python in stalled (*d'oh*), but run from the command line I get:
[root@glutton bin]# ./removecommercials.py
chanid and starttime or jobid

Attempting from the command line, for a show on Oct. 17 at 8:00 pm EST,
-rw-r--r-- 1 mythtv mythtv 564M Oct 16 14:30 2502_20161016180000.ts
-rw-r--r-- 1 mythtv mythtv 570M Oct 16 15:00 2502_20161016183000.ts
-rw-r--r-- 1 mythtv mythtv 594M Oct 17 20:30 2502_20161018000000.ts < which should be this one
-rw-r--r-- 1 mythtv mythtv 595M Oct 17 22:00 2502_20161018013000.ts
-rw-r--r-- 1 mythtv mythtv 600M Oct 26 22:00 2502_20161027013000.ts
-rw-r--r-- 1 mythtv mythtv 599M Oct 27 22:00 2502_20161028013000.ts


[root@glutton bin]# ./removecommercials.py --chanid 2502 --starttime 20161018000000
2016-11-20 17:51:06,708:INFO:Started
Traceback (most recent call last):
File "./removecommercials.py", line 307, in <module>
main()
File "./removecommercials.py", line 303, in main
run_cut(chanid=args.chanid,starttime=args.starttime,outfile=args.outfile)
File "./removecommercials.py", line 43, in run_cut
ffmpeg = prog_check()[0]
File "./removecommercials.py", line 268, in prog_check
instdir = os.confstr(0).split(':')[1]
IndexError: list index out of range

I picked --starttime based on the file name? On the off-chance I have that wrong:
[root@glutton bin]# ./removecommercials.py --chanid 2502 --starttime 20161017200000

errors the same way.



and creates /var/log/mythtv/cut.log:
2016-11-20 17:51:06,708:INFO:Started

and nothing else?

daraden
Senior
Posts: 169
Joined: Tue Feb 23, 2016 7:33 am
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by daraden » Sun Nov 20, 2016 11:03 pm

change line 41 from ffmpeg = prog_check()[0] to ffmpeg = '/usr/bin/mythffmpeg'

ricks03
Junior
Posts: 61
Joined: Thu Oct 01, 2015 8:59 pm
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by ricks03 » Mon Nov 21, 2016 12:06 am

Well, that at least is better!

[root@glutton bin]# ./removecommercials.py --chanid 2502 --starttime 20161018000000
2016-11-20 19:01:31,111:INFO:Started
2016-11-20 19:01:31,111:DEBUG:ffmpeg=/usr/bin/mythffmpeg
2016-11-20 19:01:31,112:DEBUG:chanid=2502 starttime=20161018000000
2016-11-20 19:01:31,148:DEBUG:DB recording entry=<Recorded 'The Andy Griffith Show','2016-10-17 20:00:00-04:00' at 0x2b16780>
2016-11-20 19:01:31,152:INFO:no temp folder found:
2016-11-20 19:01:31,152:INFO:Temp folder created:
2016-11-20 19:01:37,422:INFO:getting cutlist
2016-11-20 19:01:37,426:DEBUG:Myth cutlist:19125,26638,46028,49942
2016-11-20 19:01:37,426:DEBUG:FFmpeg cutlist:19125,26638,46028,49942
2016-11-20 19:01:37,427:INFO:cutting started
2016-11-20 19:01:50,779:INFO:Cuting Finished
2016-11-20 19:01:50,779:INFO:Merging Cuts
2016-11-20 19:01:50,780:DEBUG:concat list:/data/mythtv/crtmp/cut000.ts|/data/mythtv/crtmp/cut002.ts|/data/mythtv/crtmp/cut004.ts
2016-11-20 19:01:57,256:INFO:Merging Finished
2016-11-20 19:01:57,256:INFO:temp Folder found
2016-11-20 19:01:57,520:INFO:Temp Folder Removed
2016-11-20 19:01:57,520:INFO:no temp folder found
2016-11-20 19:01:57,520:INFO:Started Clearing markup
2016-11-20 19:01:57,521:DEBUG:rec=<Recorded 'The Andy Griffith Show','2016-10-17 20:00:00-04:00' at 0x2b16780> infile=/data/mythtv/2502_20161018000000.ts outfile=None
2016-11-20 19:01:57,522:DEBUG:chanid=2502 starttime=20161018000000
2016-11-20 19:01:57,522:INFO:start clearing markup
2016-11-20 19:01:58,538:INFO:Cutlist removed for:2502_20161018000000
2016-11-20 19:01:58,539:DEBUG:('2016-11-20 19:01:58.213628 C mythutil version: fixes/0.28 [v28.0-35-g812ec08] www.mythtv.org\n2016-11-20 19:01:58.213712 C Qt version: compile: 5.6.1, runtime: 5.6.1\n2016-11-20 19:01:58.213719 N Enabled verbose msgs: general\n2016-11-20 19:01:58.213764 N Setting Log Level to LOG_INFO\n2016-11-20 19:01:58.225174 I Added logging to the console\n2016-11-20 19:01:58.227009 I Setup Interrupt handler\n2016-11-20 19:01:58.227028 I Setup Terminated handler\n2016-11-20 19:01:58.227043 I Setup Segmentation fault handler\n2016-11-20 19:01:58.227053 I Setup Aborted handler\n2016-11-20 19:01:58.227067 I Setup Bus error handler\n2016-11-20 19:01:58.227076 I Setup Floating point exception handler\n2016-11-20 19:01:58.227089 I Setup Illegal instruction handler\n2016-11-20 19:01:58.227104 I Setup Real-time signal 0 handler\n2016-11-20 19:01:58.227121 I Setup Hangup handler\n2016-11-20 19:01:58.227264 N Using runtime prefix = /usr\n2016-11-20 19:01:58.227276 N Using configuration directory = /root/.mythtv\n2016-11-20 19:01:58.227410 I Assumed character encoding: en_US.UTF-8\n2016-11-20 19:01:58.228290 N Empty LocalHostName.\n2016-11-20 19:01:58.228314 I Using localhost value of glutton.home.sinister.net\n2016-11-20 19:01:58.266731 N Setting QT default locale to EN_US\n2016-11-20 19:01:58.266765 I Current locale EN_US\n2016-11-20 19:01:58.266925 N Reading locale defaults from /usr/share/mythtv//locales/en_us.xml\n2016-11-20 19:01:58.281718 N Cutlist set to: (EMPTY)\nCutlist set to: (EMPTY)\n', None)
2016-11-20 19:01:59,319:INFO:Skiplist removed for:2502_20161018000000


2016-11-20 19:02:36,465:INFO:Removing PNG files
2016-11-20 19:02:36,481:INFO:Removing JPG files
2016-11-20 19:02:36,497:INFO:Rebuilding seektable
2016-11-20 19:02:51,272:INFO:Seektable Rebuilt for:2502_20161018000000
2016-11-20 19:02:51,273:INFO:MythTV Commercial Flagger, building seek table for:
The Andy Griffith Show - Floyd, the Gay Deceiver
2016-11-20 19:02:36.992281 C mythcommflag version: fixes/0.28 [v28.0-35-g812ec08] www.mythtv.org
2016-11-20 19:02:36.992367 C Qt version: compile: 5.6.1, runtime: 5.6.1
Rebuild started at Sun Nov 20 19:02:37 2016
Rebuild completed at Sun Nov 20 19:02:49 2016
2016-11-20 19:02:49.676618 E decoding error
eno: Unknown error 541478725 (541478725)



[root@glutton mythtv]# ls -lah 2502_2016101800*
-rw-r--r-- 1 mythtv mythtv 487M Nov 20 19:01 2502_20161018000000.ts
-rw-r--r-- 1 root root 594M Nov 20 19:01 2502_20161018000000.ts.old

Does create a file (off to go check how it looks) but still aborts with an error.

daraden
Senior
Posts: 169
Joined: Tue Feb 23, 2016 7:33 am
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by daraden » Mon Nov 21, 2016 12:37 am

The section after 2016-11-20 19:02:51,273:INFO is the output of mythcomflag. haven't checked into why it errors out at the end, since it seems to be working.

ricks03
Junior
Posts: 61
Joined: Thu Oct 01, 2015 8:59 pm
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by ricks03 » Mon Nov 21, 2016 12:43 am

By "seems to be working" do you mean it works for you?

daraden
Senior
Posts: 169
Joined: Tue Feb 23, 2016 7:33 am
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by daraden » Mon Nov 21, 2016 12:51 am

The error is from rebuilding the seek-table. but i can still seek and edit fine in the frontend.

ricks03
Junior
Posts: 61
Joined: Thu Oct 01, 2015 8:59 pm
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by ricks03 » Mon Nov 21, 2016 1:50 am

Looks like it still fails when it runs as a task. doesn't create a cut.log file.

the mythbackend log file reports:
2016-11-20 20:39:54.887115 I [2341/26624] UserJob_9784 jobqueue.cpp:2410 (DoUserJobThread) - JobQueue: Started Remove Comms.py for "The Big Bang Theory":"The Valentino Submergence" recorded from channel 2221 at 2016-11-18T00:00:00Z
2016-11-20 20:40:00.528999 E [2341/26624] UserJob_9784 jobqueue.cpp:2445 (DoUserJobThread) - JobQueue: User Job '/usr/local/bin/removecommercials.py --jobid 9784' failed.

daraden
Senior
Posts: 169
Joined: Tue Feb 23, 2016 7:33 am
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by daraden » Mon Nov 21, 2016 2:05 am

try changing the logdir to another folder the mythtv user has access
are you using jobid or chanid and starttime? if using starttime for a user job you need to use %STARTTIMEUTC%

ricks03
Junior
Posts: 61
Joined: Thu Oct 01, 2015 8:59 pm
United States of America

Re: Anyone else having problems with commercial removal in 0

Post by ricks03 » Mon Nov 21, 2016 2:22 am

well, /var/log/mythtv is:
drwxr-xr-x 3 mythtv mythtv 8.0K Nov 20 21:03 mythtv
and the data folder is:
drwxrwxrwx 10 mythtv mythtv 132K Nov 20 20:47 mythtv

I changed the script to :
#logdir ='/var/log/mythtv/'
logdir = '/tmp/'

I still get in mythweb:
Remove Comms.py (Errored: Sun Nov 20, 2016, 09:19 PM)
ERROR: User Job returned non-zero, check logs.

I have no log file in /tmp, and still see in the mythbackend log:
2016-11-20 21:19:05.538921 E [2341/27290] UserJob_9785 jobqueue.cpp:2445 (DoUserJobThread) - JobQueue: User Job '/usr/local/bin/removecommercials.py --jobid 9785' failed.

Post Reply