question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Audio Frame Repeatition when combining videos clips

See original GitHub issue

Audio frames at very end of a clip get repeated when I concatenate two or more video clips. I tinkered with

  1. buffer size (writing with audio_buffsize = 1000 works fine for now)
  2. duration ( because I observed that for a clip with 43.15 sec of audio, final video get rounded to 44.0 which adds some glitch / last frame buffer repetition (I guess) = 44.0-43.15.)

writing with audio_buffsize = 1000 works fine for now. But I am not sure whether it will work for every case. I need to write one long clips with many small clips hence need some advice/pointers on how to get cohesive result/clip.

com_vid.write_videofile(FINAL_OUT_VID,
                        fps=1,
                        audio_bitrate='192k',
                        audio_fps=44100,
                        audio_nbytes=2,
                        audio_codec="aac",
                        audio_bufsize=1000)  # fix issue for audio glitches.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
omerasif57commented, Sep 25, 2022

you can try this workaround: https://github.com/Zulko/moviepy/issues/1167#issuecomment-626302213

also you can try experimenting with audio params: such as audio fps or bitrate or buffersize or nbytes. (as mentioned above in my question)

Honestly, I am unable to provide any expert advice here as I used it for a tiny project and never used after since. I would suggest you to create a new issue here or any related forums with steps to reproduce and sample data if any. It would help to debug more effectively.

1reaction
omerasif57commented, Sep 24, 2022

you can try this version moviepy==2.0.0.dev1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Audio Frame Repetition when combining audio clips in moviepy
Audio Frame Repetition when combining audio clips in moviepy ... very end of a clip get repeated when I concatenate two or more...
Read more >
Audio Keeps Repeating and Skipping in iMovie
Then select and reverse the detached audio clip. Next, reverse the video clip. See if reversing independently of each other cures the problem....
Read more >
How to merge video and audio clips in Premiere Pro [2022 ...
You can also use the nesting technique to combine audio clips in Adobe Premiere Pro. Just like nesting videos, this technique preserves your...
Read more >
How to Combine Videos into One (9 Quick and Easy Ways)
To use Filmora to combine clips, click the Import button and choose from these options: Import Media Files, Import a Media Folder, or...
Read more >
combine audio and video - iMyFone Filme
Step 3: Hold the Shift button and select the video clips that you have added to the timeline. Right-click on the selection and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found