I'm trying to merge a video with its seperate audio file in Python. I have both the video and the audio as bytes in memory and I would like to know how to allow ffmpeg-python to merge them.
I have seen it done through ffmpeg.concat and by reading the files from disk using ffmpeg.input, but when my program downloads the files, it saves them in memory as bytes objects.
I tried passing the byte objects into ffmpeg.concat but it threw an error as it is expecting stream objects:
TypeError: Expected incoming stream(s) to be of one of the following types: ffmpeg.nodes.FilterableStream; got <class 'bytes'>
How should I approach the problem when my files are in bytes format?
source https://stackoverflow.com/questions/74256808/how-to-merge-audio-and-video-in-bytes-using-ffmpeg
Comments
Post a Comment