Closed Knallli closed 2 weeks ago
Can you attach a sample file so we can reproduce the problem?
https://www.pexels.com/video/road-trip-4434242/
@aviv926 the above sample can reproduce the problem on my end.
Edit: I have also attached the ffmpeg log for the sample and my vainfo vainfo.txt ffmpeg_log.txt
It seems this is an issue with AMD devices in particular. Intel supports 4096x4096 and I can't see a limit on this for Nvidia. I also don't know if it affects discrete AMD GPUs or just APUs, and if there are different limits for different APUs.
All in all, it might be worth rotating for VAAPI only, but needs more investigation as to the surface area of the issue and how much of a performance hit it would be for devices that don't need this.
Could this issue be on VAAPI itself? According to the datasheet for my Phoenix iGPU there should be 8k encode, decode support for h265 8/10 bit
https://patchwork.freedesktop.org/patch/577299/ - I believe this is related.
That does look related. I think we can wait for that to make its way into an FFmpeg release.
Is this still an issue?
Yes. It should be fixed once we upgrade to FFmpeg 7.0. jellyfin-ffmpeg's relevant PR was merged recently, so that might be possible soon.
I still have the same issue on latest release with ffmpeg 7.0
[Nest] 7 - 10/19/2024, 4:56:00 PM LOG [Microservices:MediaService] Encoding video 97ea2c5f-cb3a-49d8-a18b-d5c7c8183623 with VAAPI acceleration
[Nest] 7 - 10/19/2024, 4:56:00 PM ERROR [Microservices:MediaRepository] vendor_id : [0][0][0][0]
encoder : HEVC
Side data:
DOVI configuration record: version: 1.0, profile: 8, level: 10, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 4
displaymatrix: rotation of -90.00 degrees
Ambient Viewing Environment, ambient_illuminance=314.000000, ambient_light_x=0.312700, ambient_light_y=0.329000
Stream #0:1[0x2](und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 102 kb/s (default)
Metadata:
creation_time : 2024-10-19T16:51:55.000000Z
handler_name : Core Media Audio
vendor_id : [0][0][0][0]
Stream #0:2[0x3](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
Metadata:
creation_time : 2024-10-19T16:51:55.000000Z
handler_name : Core Media Metadata
Stream #0:3[0x4](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
Metadata:
creation_time : 2024-10-19T16:51:55.000000Z
handler_name : Core Media Metadata
Stream #0:4[0x5](und): Data: none (mebx / 0x7862656D), 69 kb/s (default)
Metadata:
creation_time : 2024-10-19T16:51:55.000000Z
handler_name : Core Media Metadata
Stream #0:5[0x6](und): Data: none (mebx / 0x7862656D), 5 kb/s (default)
Metadata:
creation_time : 2024-10-19T16:51:55.000000Z
handler_name : Core Media Metadata
Stream #0:6[0x7](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
Metadata:
creation_time : 2024-10-19T16:51:55.000000Z
handler_name : Core Media Metadata
[out#0/mp4 @ 0x5d31a1f5f40] Adding streams from explicit maps...
[vost#0:0/h264_vaapi @ 0x5d31a2e5280] Created video stream from input stream 0:0
[aost#0:1/libopus @ 0x5d31a2e5580] Created audio stream from input stream 0:1
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
[vost#0:0/h264_vaapi @ 0x5d31a2e5280] Starting thread...
[aost#0:1/libopus @ 0x5d31a2e5580] Starting thread...
[vf#0:0 @ 0x5d31a14aa40] Starting thread...
[af#0:1 @ 0x5d31a147fc0] Starting thread...
[vist#0:0/hevc @ 0x5d31a17ba00] [dec:hevc @ 0x5d31a17c780] Starting thread...
[aist#0:1/aac @ 0x5d31a17bb80] [dec:aac @ 0x5d31a066580] Starting thread...
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x5d31a123f80] Starting thread...
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x5d332050480] w:3840 h:2160 pixfmt:yuv420p10le tb:1/600 fr:60000/1001 sar:0/1 csp:bt2020nc range:tv
[auto_scale_0 @ 0x5d332050900] w:iw h:ih flags:'' interl:0
[transpose @ 0x5d332050540] auto-inserting filter 'auto_scale_0' between the filter 'graph 0 input from stream 0:0' and the filter 'transpose'
[auto_scale_0 @ 0x5d332050900] w:3840 h:2160 fmt:yuv420p10le csp:bt2020nc range:tv sar:0/1 -> w:3840 h:2160 fmt:nv12 csp:bt2020nc range:tv sar:0/1 flags:0x00000004
[transpose @ 0x5d332050540] w:3840 h:2160 dir:1 -> w:2160 h:3840 rotation:clockwise vflip:0
[graph 0 input from stream 0:0 @ 0x5d332050480] video frame properties congruent with link at pts_time: 0
[h264_vaapi @ 0x5d31a26d980] Using input frames context (format vaapi) with h264_vaapi encoder.
[h264_vaapi @ 0x5d31a26d980] Input surface format is nv12.
[h264_vaapi @ 0x5d31a26d980] Using VAAPI profile VAProfileH264High (7).
[h264_vaapi @ 0x5d31a26d980] Using VAAPI entrypoint VAEntrypointEncSlice (6).
[h264_vaapi @ 0x5d31a26d980] Using VAAPI render target format YUV420 (0x1).
[h264_vaapi @ 0x5d31a26d980] RC mode: CQP.
[h264_vaapi @ 0x5d31a26d980] Block Level bitrate control: OFF.
[h264_vaapi @ 0x5d31a26d980] RC quality: 31.
[h264_vaapi @ 0x5d31a26d980] RC framerate: 60000/1001 (59.94 fps).
[h264_vaapi @ 0x5d31a26d980] Driver does not report any additional prediction constraints.
[h264_vaapi @ 0x5d31a26d980] Using intra and P-frames (supported references: 1 / 0).
[h264_vaapi @ 0x5d31a26d980] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
[h264_vaapi @ 0x5d31a26d980] Hardware does not support encoding at size 1440x2560 (constraints: width 256-4096 height 128-2304).
[vost#0:0/h264_vaapi @ 0x5d31a2e5280] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0x5d31a14aa40] Error sending frames to consumers: Invalid argument
[vf#0:0 @ 0x5d31a14aa40] Task finished with error code: -22 (Invalid argument)
[vf#0:0 @ 0x5d31a14aa40] Terminating thread with return code -22 (Invalid argument)
[vist#0:0/hevc @ 0x5d31a17ba00] [dec:hevc @ 0x5d31a17c780] Decoder returned EOF, finishing
[vist#0:0/hevc @ 0x5d31a17ba00] [dec:hevc @ 0x5d31a17c780] Terminating thread with return code 0 (success)
What processor do you have? 7.0 should only help if the true dimension range is enough and was only misreported in earlier versions.
It's a ryzen5 5600h
Edit:
Looks like it should support 8k encoding? I think it should have the Cezanna gpu https://en.wikipedia.org/wiki/Unified_Video_Decoder#Format_support
https://patchwork.freedesktop.org/patch/577299/ - I believe this is related.
I looked at this again and it's actually a driver patch rather than for FFmpeg. All in all, this doesn't seem like an immich issue to me.
The bug
Hardware transcoding fails on vertical videos since the vertical resolution goes too high on 4k content.
VAAPI reports following resolution constraints on HEVC:
[hevc_vaapi @ 0x5565e27c180] Hardware does not support encoding at size 1080x2344 (constraints: width 256-4096 height 128-2304).
Possible workaround could be to rotate the video for transcoding and then rotate it back on finish no?
The OS that Immich Server is running on
Unraid 6.12.6 w/ Linux 6.8rc3
Version of Immich Server
v1.94.1
Version of Immich Mobile App
-
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Additional information
Console output of the FFMPEG error.