Skip to content

Commit

Permalink
Attempt at fixing #13, using afade filter instead of volume on/off fi…
Browse files Browse the repository at this point in the history
…lter
  • Loading branch information
mmguero committed Aug 17, 2023
1 parent 9f17f8e commit 76159b3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = cleanvid
version = 1.4.0
version = 1.5.0
author = Seth Grover
author_email = [email protected]
description = cleanvid is a little script to mute profanity in video files.
Expand Down
2 changes: 1 addition & 1 deletion src/cleanvid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""cleanvid is a little script to mute profanity in video files."""

__version__ = "1.4.0"
__version__ = "1.5.0"
__author__ = "Seth Grover <[email protected]>"
__all__ = []

Expand Down
26 changes: 25 additions & 1 deletion src/cleanvid/cleanvid.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def CreateCleanSubAndMuteList(self):
plexDict["markers"][self.plexAutoSkipId] = []
plexDict["mode"][self.plexAutoSkipId] = "volume"

for timePair in newTimestampPairs:
for timePair, timePairPeek in pairwise(newTimestampPairs):
lineStart = (
(timePair[0].hour * 60.0 * 60.0)
+ (timePair[0].minute * 60.0)
Expand All @@ -441,6 +441,30 @@ def CreateCleanSubAndMuteList(self):
+ timePair[1].second
+ (timePair[1].microsecond / 1000000.0)
)
lineStartPeek = (
(timePairPeek[0].hour * 60.0 * 60.0)
+ (timePairPeek[0].minute * 60.0)
+ timePairPeek[0].second
+ (timePairPeek[0].microsecond / 1000000.0)
)
self.muteTimeList.append(
"afade=enable='between(t,"
+ format(lineStart, '.3f')
+ ","
+ format(lineEnd, '.3f')
+ ")':t=out:st="
+ format(lineStart, '.3f')
+ ":d=30ms"
)
self.muteTimeList.append(
"afade=enable='between(t,"
+ format(lineEnd, '.3f')
+ ","
+ format(lineStartPeek, '.3f')
+ ")':t=in:st="
+ format(lineEnd, '.3f')
+ ":d=10ms"
)
self.muteTimeList.append(
"volume=enable='between(t," + format(lineStart, '.3f') + "," + format(lineEnd, '.3f') + ")':volume=0"
)
Expand Down

0 comments on commit 76159b3

Please sign in to comment.