ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

How do I concat without re-encoding?

Open dstampher opened this issue 3 years ago • 1 comments

I went through the process of converting all of my clips to a similar format already. I tried to add the c='copy' arg to ffmpeg.output and it re-encodes. It is using the concat filter under the hood so this makes sense, but stream copy can make this soooo much faster for me.

clip_streams = get_streams_from_dir(f'{clips_out_dir}/{width}x{height}')
joined = ffmpeg.concat(*clip_streams)
ffmpeg.output(joined, 'out.mp4', c='copy')

I looked into ffmpeg.run, but I am not quite sure how to use it to accomplish what I am looking for. So, back to the original question in the title...

How do I concat without re-encoding with this module?

Thank you so much! I am stuck.

dstampher avatar Mar 18 '22 17:03 dstampher

Ya, I too am facing the same issue. Does anyone know how to concatenate using python library, without re-encoding?

TejaswiniiB avatar Mar 21 '22 05:03 TejaswiniiB

This is the script that I used for remux

v = ffmpeg.input(video_path)
a = ffmpeg.input(audio_path)
ffmpeg.output(v, a, f'{parent}/merged.mp4', codec='copy').run(cmd="./ffmpeg")

aldo-o avatar Dec 10 '22 05:12 aldo-o