Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.1k stars 1.51k forks source link

Problem with moviepy.video.fx.all.time_mirror and moviepy.video.fx.all.time_symmetrize. #1999

Closed Devanaath closed 1 year ago

Devanaath commented 1 year ago

Expected Behavior

Hello!!, I am having a problem with moviepy.video.fx.all.time_mirror and moviepy.video.fx.all.time_symmetrize. I want to output a video that plays normally in the first half, then plays in reverse for the second half. I tried concatenating videoclips separately, but still got the problem.

Actual Behavior

Input Video

Actual output

The output video has skiped some frames in the beginning and plays the last frame for 1 to 2 seconds at the end. (Please refer input and output video mentioned above)

Steps to Reproduce the Problem

This is the snippet of the code I use. Try running the following code.

code:

  1. using moviepy.video.fx.all.time_mirror:
    
    from moviepy.editor import VideoFileClip, concatenate_videoclips
    import moviepy.video.fx.all as vfx

video = VideoFileClip('Bg.mp4') Rvideo = vfx.time_mirror(video) Fvideo = concatenate_videoclips([video, Rvideo], method="chain") Fvideo.write_videofile('output.mp4')

2. using moviepy.video.fx.all.time_symmetrize:

from moviepy.editor import VideoFileClip import moviepy.video.fx.all as vfx

video = VideoFileClip('Bg.mp4') video = vfx.time_symmetrize(video) video.write_videofile('output.mp4')



#### Specifications

  - Python Version:  Python 3.11.4
  - MoviePy Version: moviepy 2.0.0.dev2
  - Platform Name: Windows 11 Pro
  - Platform Version: 22H2
Devanaath commented 1 year ago

Hey, figured out and solved this issue. For someone with the same issue, check #1356. I am going to close this issue, as my problem is resolved.

Thank you.