Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: added output parameter #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ trainingset/*
training_data/*
tmp/*
.ipynb_checkpoints/*
*.mp4
*.mkv
*.wav
8 changes: 7 additions & 1 deletion simple_ehm-runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
parser.add_argument("--generate-training-data", default=False, action='store_true', help="export extracted ehm(s) and silences as well to a separate folder. Useful for training on false positives")
parser.add_argument("--srt", default=False, action='store_true', help="generate subtitle track for easier accuracy evaluation")
parser.add_argument("--keep", nargs="+", default=["speech"], help="space separated tags to to be kept in the final video. Eg: ehm silence. Default: speech")
parser.add_argument("--output", type=str, default="", help="Output video name")
parser.add_argument("--keep-junk", default=False,action="store_true", help="keeps tmp files")

args = parser.parse_args()
Expand Down Expand Up @@ -285,8 +286,13 @@ def cut_and_merge(out_filename):
minute = str(datetime.datetime.now().minute)
secs = str(datetime.datetime.now().second)

out_filename += "_" + hour + "-" + minute + "-" + secs + video_path[-4:]
if(args.output == ""):
out_filename += "_" + hour + "-" + minute + "-" + secs
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questo non genera un file senza estensione?


else:
path = os.path.dirname(os.path.abspath(video_path))
out_filename = os.path.abspath(path+"/"+args.output)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questo idem, a meno che l'utente non specifichi l'estensione nel nome del file (e non dovrebbe)


cmd = ["ffmpeg", "-hide_banner", "-loglevel", "error", "-f", "concat", "-i", mergelist_path, "-c", "copy", out_filename, "-y"]
subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()

Expand Down