(ffmpeg
.input(input_path + str(f))
.output(output_path + str(id) + '.mp4', acodec='aac', vcodec='libx264')
.run()
# .run(capture_stderr=True)
# .run(quiet=True)
)
import os
import pathlib
import logging
LOG_DIR = os.path.join(pathlib.Path(__file__).parent.absolute(), 'logs')
if not os.path.exists(LOG_DIR):
os.makedirs(LOG_DIR)
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',
filename=os.path.join(LOG_DIR, 'mylog.log'),
filemode='w'
)
logging.info(f'Input file: {input_pat}/{str(f)}')