I provide a video as an input to my system, it processes the video and then it writes some information into a .txt file. How do I name the .txt file exactly the same as the video file name?
# getting input video
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--input", required=True,
help="path to input video")
ap.add_argument("-o", "--output", required=True,
help="path to output video")
args = vars(ap.parse_args())
# capturing the video frames from input video
vs = cv2.VideoCapture(args["input"])
# writing the output folder and txt file
outputfile_dir = os.path.join(os.getcwd(),'output')
if not os.path.exists(outputfile_dir):
os.makedirs(outputfile_dir)
os.chmod(outputfile_dir , 0o777)
outputFilename=os.path.join(outputfile_dir,"demofile.txt")