0

I am trying to combine audio and video using ffmpeg-python. my video file is 40mb and my audio file is 5mb but when i combine them i am getting 90mb which is abnormal. i was expecting the output file to be the size of the video file + the size of the audio file. My question is, how can I maintain the size of the output file to be equal to the size of the input video and audio file?

import ffmpeg

input_video = ffmpeg.input('video.mp4) input_audio = ffmpeg.input('audio.mp4')

ffmpeg.concat(input_video, input_audio, v=1, a=1).output('finished_video.mp4').run()

prince david
  • 181
  • 1
  • 5
  • 1
    That's because you're reencoding video (likely) at much higher quality than the original, which is an overkill as the quality setting won't be reflected upon the output video. If you are just combining one video & one audio, there is no need for filtering. You just need to map and copy. In FFmpeg, you need to do `ffmpeg -i video.mp4 -i audio.mp4 -map 0:v -map 1:a -c copy finished_video.mp4`. I'm not familiar with `ffmpeg-python` but look in the `output()` method to set these options as arguments.\ – kesh Sep 06 '22 at 03:26

0 Answers0