Trying to fix blocking process

This commit is contained in:
2023-03-07 11:46:53 +00:00
parent fd52dee435
commit 03d0602b0c

View File

@@ -1,3 +1,4 @@
import asyncio
import base64
import datetime
import io
@@ -66,7 +67,8 @@ async def sign_video(
f.write(video.file.read())
command = ['ffmpeg', '-y', '-i', settings.DATA_PATH + "/" + video.filename + ".test", '-c:v', 'libx264', '-c:a', 'aac', '-strict', '-2', '-b:a', '192k', '-c:a', 'aac', '-strict', '-2', '-b:a', '192k', settings.DATA_PATH + "/" + video.filename]
subprocess.run(command, check=True)
process = await asyncio.create_subprocess_exec(*command)
await process.wait()
# delete the temporary file
os.remove(settings.DATA_PATH + "/" + video.filename + ".test")