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

fix(server): h264 videos failing to transcode in two-pass mode #3053

Merged
merged 2 commits into from Jul 1, 2023

Conversation

mertalev
Copy link
Contributor

@mertalev mertalev commented Jul 1, 2023

Description

Fixes a bug where the default fps_mode, which can choose between constant and variable framerate, elects to duplicate frames to a constant frame rate. This causes the number of frames to differ between the two passes, leading to the fatal error 2nd pass has more frames than 1st pass.

Setting -fps_mode passthrough makes ffmpeg accept frames as they are without duplicating or dropping any, fixing the error. Notably, this error only occurs with h264; hevc and vp9 are unaffected.

Fixes #3049

How Has This Been Tested?

The sample video is tested to convert successfully with this option set. The setting is also compatible with other codecs and transcode settings from my testing.

@vercel
Copy link

vercel bot commented Jul 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Jul 1, 2023 0:42am

@mertalev mertalev requested a review from jrasm91 July 1, 2023 00:11
Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes to the tests?

@mertalev
Copy link
Contributor Author

mertalev commented Jul 1, 2023

No changes to the tests?

Whoops!

@jrasm91
Copy link
Contributor

jrasm91 commented Jul 1, 2023

LGTM

@alextran1502 alextran1502 merged commit f9671df into main Jul 1, 2023
19 checks passed
@alextran1502 alextran1502 deleted the fix-h264-two-pass branch July 1, 2023 01:48
@nsg nsg mentioned this pull request Jul 9, 2023
11 tasks
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

Successfully merging this pull request may close these issues.

[BUG] 2-Pass encoding fails for some videos
3 participants