-
Notifications
You must be signed in to change notification settings - Fork 934
Open
Description
Thank you for this wonderful library! I am wondering how I can translate the code below to be able to concatenate multiple opus audio files using the BytesIO API.
In this contrived example I am reading files off disk, but in reality I am reading files from S3. I am trying to avoid any intermediate writes to disk and instead just stream directly to ffmpeg. Is this possible?
from pathlib import Path
import ffmpeg
input = Path.cwd().joinpath("input.txt")
with input.open("w") as f:
# in reality, this is more like:
# for i, obj in enumerate([
# s3.get_object(Bucket=bucket_name, Key=obj["Key"])["Body"].read()
# for obj in s3_bucket_list_objects_v2(bucket_name=bucket_name, key=key)["Contents"]
# ]):
for i, obj in enumerate(Path.cwd().glob("recording*.webm")):
f.write(f"file '{content}'\n")
output = Path.cwd().joinpath("combined.webm")
ffmpeg.input(str(input), format="concat", safe=0).output(str(output), c="copy").run()Metadata
Metadata
Assignees
Labels
No labels