Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio/Video desync when framerate is not an integer #486

Open
Max6mm opened this issue Feb 9, 2025 · 1 comment
Open

Audio/Video desync when framerate is not an integer #486

Max6mm opened this issue Feb 9, 2025 · 1 comment

Comments

@Max6mm
Copy link

Max6mm commented Feb 9, 2025

When using a driving video with non integer framerate , 29.97 FPS in my case, LivePortrait round it to 29 FPS.
It create an audio/video desync which become more important the longer the video is.

@cleardusk
Copy link
Member

A temporary solution is use change_video_fps to change the FPS of the original video to an interger, e.g., 30

def change_video_fps(input_file, output_file, fps=20, codec='libx264', crf=12):
cmd = f'ffmpeg -i "{input_file}" -c:v {codec} -crf {crf} -r {fps} "{output_file}" -y'
exec_cmd(cmd)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants