Open Goodwu opened 1 week ago
Hmm, I agree this seems like a bug in FFmpeg. Have you tried restarting the container?
Hmm, I agree this seems like a bug in FFmpeg. Have you tried restarting the container?
No, I killed the ffmpeg with -9 and it retried with software transcoding. And it continue transcoding with HW accel normally.
Same bug here. Had to restart container. But after restart it again starts to transcode and stuck. Had to terminate job. I was using HW transcode
Same bug here. Had to restart container. But after restart it again starts to transcode and stuck.
Had to terminate job.
I was using HW transcode
Which acceleration API were you using?
Which acceleration API were you using?
vaapi. Disabled it for now.
Started encoding video 0885652b-e0c9-45ee-b837-32d0ea69c623 {"inputOptions":["-init_hw_device vaapi=accel:/dev/dri/card0","-filter_hw_device accel"],"outputOptions":["-c:v h264_vaapi","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:1","-map 0:0","-g 256","-v verbose","-vf format=nv12,hwupload,scale_vaapi=1080:-2","-compression_level 7","-qp:v 23","-global_quality:v 23","-rc_mode 1"],"twoPass":false}
Interesting, I wonder if it's specific to VAAPI then. I'll take a look at their issue tracker to see if this is a known issue.
Can both of you clarify the following:
The only relevant info I've seen online is this issue along with the kernel bug it links to. But since the issue is quite old, I'm not sure if this is really it.
Can both of you clarify the following:
- Was transcoding concurrency set above 1?
- What kernel version does the server have?
- What model is the processor (or GPU if it's a discrete GPU)?
The only relevant info I've seen online is this issue along with the kernel bug it links to. But since the issue is quite old, I'm not sure if this is really it.
Linux b35022ea1bc4 6.8.4-3-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-3 (2024-05-02T11:55Z) x86_64 GNU/Linux
Can both of you clarify the following:
Was transcoding concurrency set above 1? What kernel version does the server have? What model is the processor (or GPU if it's a discrete GPU)?
- transcoding concurrency is 1
- Linux 6.1.0-22-amd64 (omv 7)
- AMD Ryzen 5 5600G
It makes sense that it only fails for HDR videos since the command will only have the tonemap_opencl
filter for HDR videos. Seems like that filter is where the issue lies, but I'm not sure what the root cause is.
Does disabling hardware decoding (and keeping hardware encoding enabled) avoid the issue?
Also worth noting that we use bleeding edge versions for the relevant dependencies following this PR. It may be interesting to try different versions of these to see if it affects the behavior.
Does disabling hardware decoding (and keeping hardware encoding enabled) avoid the issue?
Can you advice how to set such config?
In the transcoding settings, there is a setting for the hardware acceleration API, and a setting for hardware decoding below it. If hardware decoding is disabled but you set it to use an acceleration API, it will accelerate encoding only and handle decoding and tone-mapping on CPU.
It's said Applies only to NVENC and RKMPP.
But i have VAAPI on my AMD
Hmm, that's a good point: the common thread here isn't OpenCL.
We know that:
That leaves QSV/VAAPI encoding as the most likely culprit. But that depends on whether the issue persists when hardware decoding for QSV is disabled. If it doesn't, it would poke a hole in this hypothesis.
It's also possible that these are just two different issues that happen to both cause FFmpeg to hang.
The bug
It seems like ffmpeg running into deadloop. Ffmpeg running at 100% CPU usage for hours, and the output file size is only 48 bytes. HW decoding and encoding switch are all ON. Have accured two times, both have the same behavior.![image](https://github.com/immich-app/immich/assets/348005/91b7ba58-6749-418b-8603-62bc45c46b63)
The OS that Immich Server is running on
OMV7
Version of Immich Server
v1.106.4
Version of Immich Mobile App
v1.106.4
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Relevant log output
No response
Additional information
No response