Moviepy: Huge quality drop on first/last seconds from single clips when concatenating

Created on 16 Jun 2020  路  5Comments  路  Source: Zulko/moviepy

Hello,

when I'm concatenating lets say 15-20 clips together, i noticed that on each clip, there is a really low quality at the start (first 1-2 seconds) and end (last 1 second) of the clips.

the only arguments im using on write_videofile are:

codec='mpeg4', 
bitrate="5000k", 
threads=8, 
temp_audiofile=final_video_file_name.replace("mp4", "mp3")

is this an known thing? I would love to know what i have to do in order to keep the quality always similar.

Many thanks

question

Most helpful comment

yeah, you were right again and tbh i remember now having better quality before i started using mpeg4 codec. I just switched back to xlib264 (default) and the quality is much higher. Pretty strange since the documentation explicitly says mpeg4 has produces better quality for mp4.

All 5 comments

Sorry, I've never seen that problem before. Would it be possible to post the code, and the input and output media files?

here is an example https://www.youtube.com/watch?v=m63_8e2Cgfc
as you can see, every time the transition video at the end gets blurry and the new clip needs 1-2 seconds untill its really sharp. Im using the settings above for each clip.

I see what you mean. I imagine that the problem is to do with the compression used by FFmpeg. Perhaps try experimenting with a different codecs and file extensions. There's a few examples here: https://github.com/Zulko/moviepy/blob/a1df46d96b34bbdd7869854705ee9c18788c2838/moviepy/video/VideoClip.py#L186.

Other than that, I'm not really sure what to suggest...

yeah, you were right again and tbh i remember now having better quality before i started using mpeg4 codec. I just switched back to xlib264 (default) and the quality is much higher. Pretty strange since the documentation explicitly says mpeg4 has produces better quality for mp4.

Yeah, it is strange that the documentation says that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cquintini picture cquintini  路  4Comments

arianaa30 picture arianaa30  路  4Comments

Gicehajunior picture Gicehajunior  路  3Comments

bilel picture bilel  路  4Comments

tburrows13 picture tburrows13  路  3Comments