halucigenia,
I have good news and bad news.
First, I successfully installed on my test environment
the 'Commercial detection with silences' according the wiki page
and patched the 'silence.py' according our discussion.
See patch file below.
A test run shows that it is doing well:
Code: Select all
$ python3 silence.py --chanid 10102 --starttime 20200202191300
2020-05-01 13:08:16.514245 I [2161] mythcommflag:
2020-05-01 13:08:16.516066 I [2161] mythcommflag: Seeking chanid 10102, starttime 2020-02-02 19:13:00+01:00
2020-05-01 13:08:16.523382 I [2161] mythcommflag: Processing: XXXX Channel , 2020-02-02 19:13:00+01:00, "XXXXX Title"
2020-05-01 13:08:16.550042 I [2161] mythcommflag: Start - End Start - End Duration Interval Level/Count
2020-05-01 13:08:16.550185 I [2161] mythcommflag: frame - frame (mmm:ss-mmm:ss) frame (mm:ss.s) frame (mmm:ss)
2020-05-01 13:08:22.588485 I [2161] mythcommflag: < Cluster 1- 6898 ( 0:00- 4:36), 6898 ( 4:35.9), 0 ( 0:00), [ 9]
2020-05-01 13:08:22.589080 I [2161] mythcommflag: = Cut 1- 6886 ( 0:00- 4:35), 6886 ( 4:35.4), 0 ( 0:00), [ 0]
2020-05-01 13:08:25.481740 I [2161] mythcommflag: # Cluster 10603- 10619 ( 7:04- 7:05), 17 ( 0:00.7), 3706 ( 2:28), [ 1]
2020-05-01 13:08:57.768592 I [2161] mythcommflag: > Cluster 13724- 16536 ( 9:09- 11:01), 2813 ( 1:52.5), 3106 ( 2:04), [ 3]
2020-05-01 13:08:57.768797 I [2161] mythcommflag: = Cut 13736- 16536 ( 9:09- 11:01), 2801 ( 1:52.0), 0 ( 0:00), [ 0]
2020-05-01 13:08:57.775916 I [2161] mythcommflag: Detected 2 adverts.
I can import the markers in the Recording Editor of the frontened.
Albeit, as expected, the found cut marks are not meaningful for that channel.
Used patch file: (attached silence_py_patch_01.patch)
Code: Select all
--- silence_org.py 2020-05-01 12:46:46.918617358 +0200
+++ silence.py 2020-05-01 14:19:14.197684571 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# Build a skiplist from silence in the audio track.
# v1.0 Roger Siddons
# v2.0 Fix progid for job/player messages
@@ -89,7 +89,7 @@
self.argdict.update(v for v in validargs if v[1] is not None)
break
else:
- self.logger.log('No preset found for "' + title.encode('utf-8') + '" or "' + callsign.encode('utf-8') + '"')
+ self.logger.log('No preset found for "' + title + '" or "' + callsign + '"')
except IOError:
self.logger.log('Presets file "' + filename + '" not found', MYLOG.ERR)
return self.argdict
@@ -155,8 +155,8 @@
rec = MythTV.Recorded((chanid, starttime), db)
channel = MythTV.Channel(chanid, db)
- logger.log('Processing: ' + channel.callsign.encode('utf-8') + ', ' + str(rec.starttime)
- + ', "' + rec.title.encode('utf-8') + ' - ' + rec.subtitle.encode('utf-8')+ '"')
+ logger.log('Processing: ' + channel.callsign + ', ' + str(rec.starttime)
+ + ', "' + rec.title + ' - ' + rec.subtitle + '"')
sg = MythTV.findfile(rec.basename, rec.storagegroup, db)
if sg is None:
@@ -182,7 +182,7 @@
stdin=p1.stdout, stdout=subprocess.PIPE)
# Pipe audio stream to C++ silence which will spit out formatted log lines
p3 = subprocess.Popen([kExe_Silence, "%d" % p1.pid] + param.getValues(), stdin=p2.stdout,
- stdout=subprocess.PIPE)
+ stdout=subprocess.PIPE, text=True)
# Purge any existing skip list and flag as in-progress
rec.commflagged = 2
Since it is not working for you,it could be because of a mixed python setup.
I kindly ask you to show the output of
Code: Select all
$ mythpython
>>> import sys
>>> sys.version_info
I propose, you start from scratch with a new run:
- create a folder in your home
- pull the silence.py from wiki
- apply the patch by
- run the test from termial as you did before
- report back the output
If this does not work, please apply the patch below
Add the code marked with ' ### XXX' at line 240:
Code: Select all
except Exception as e:
raise ### XXX for debugging only !
# get exception before we generate another
Run the test in the terminal again and post the full traceback