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

[BUG] 2-Pass encoding fails for some videos #3049

Closed
1 of 3 tasks
akoyaxd opened this issue Jun 30, 2023 · 1 comment · Fixed by #3053
Closed
1 of 3 tasks

[BUG] 2-Pass encoding fails for some videos #3049

akoyaxd opened this issue Jun 30, 2023 · 1 comment · Fixed by #3053
Labels
bug Something isn't working needs triage Bug that needs triage from maintainer

Comments

@akoyaxd
Copy link

akoyaxd commented Jun 30, 2023

The bug

If I enable 2-pass encoding with h264, the encoding crashes for some of my assets.

I get this error in the microservice:

[Nest] 8  - 06/30/2023, 1:23:21 PM     LOG [MediaService] Start encoding video c72b957b-9fe4-4bad-8326-f905e57ee5a0 -vcodec h264,-acodec opus,-movflags faststart,-vf scale=720:-2,-preset fast,-threads 3,-x264-params "pools=none",-x264-params "frame-threads=3",-b:v 2483k,-minrate 1241.5k,-maxrate 3600k

[Nest] 8  - 06/30/2023, 1:23:22 PM   ERROR [JobService] Unable to run job handler: Error: ffmpeg was killed with signal SIGSEGV

[Nest] 8  - 06/30/2023, 1:23:22 PM   ERROR [JobService] Error: ffmpeg was killed with signal SIGSEGV

    at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/processor.js:180:22)

    at ChildProcess.emit (node:events:513:28)

    at ChildProcess._handle.onexit (node:internal/child_process:291:12)

[Nest] 8  - 06/30/2023, 1:23:22 PM   ERROR [JobService] Object

The OS that Immich Server is running on

Debian 11 with Docker

Version of Immich Server

v1.65.0

Version of Immich Mobile App

v1.65.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

on demand

Your .env content

on demand

Reproduction steps

1. Set encoding settings similar to the settings in the screenshot below
2. Upload the test video from below
3. See the encoding failing in the microservice

Additional information

Screenshot of ffmpeg settings

grafik

Sample File, that failed:

https://cloud.koyax.org/s/7KJp6FAmWDs4pgA

@akoyaxd akoyaxd added bug Something isn't working needs triage Bug that needs triage from maintainer labels Jun 30, 2023
@mertalev
Copy link
Contributor

mertalev commented Jun 30, 2023

This is caused by an error in the 2nd pass: 2nd pass has more frames than 1st pass. This error is in turn caused by the default fps_mode setting a constant frame rate and duplicating some frames in the second 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Bug that needs triage from maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants