[Issue]: ffmpeg needs custom arguments #6096

Closed
opened 2026-02-07 03:02:28 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @podhorsky-ksj on GitHub (Jul 7, 2024).

Please describe your bug

Hardware (vaapi) does not support videos with higher resolution. See the log bellow
I have found some arguments for ffmpeg, which could help - https://stackoverflow.com/questions/54063902/resize-videos-with-ffmpeg-keep-aspect-ratio?rq=1.
I can't put it to jellyfin encoding.xml configuration. Not even after ffmpeg path. It is always rewritten.
Also ffmpeg seems to have noautoscale argument (see log), which will be probably against this configuration I would add.

Reproduction Steps

  1. You need older hardware to reproduce it or video with higher resolution
  2. play it on hardware, which will perform the resize (mobile phone)

Jellyfin Version

10.9.0

if other:

No response

Environment

- OS:[fedora 40 server]
- Linux Kernel: 6.8.5-301
- Virtualization: podman
- Clients: Android
- Browser: no
- FFmpeg Version: 6.0.1-Jellyfin
- Playback Method: transcode
- Hardware Acceleration: vaapi
- GPU Model:  4x Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
description: VGA compatible controller
       product: 2nd Generation Core Processor Family Integrated Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:27 memory:e0000000-e03fffff memory:d0000000-dfffffff ioport:3000(size=64) memory:c0000-dffff
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking:
- Storage:

Jellyfin logs

Will provide, if needed.

FFmpeg logs

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -init_hw_device vaapi=va:/dev/dri/renderD128,driver=i965 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:"/mnt/RAID/ALBUM/Svycarsko 2022/IMG_20220731_123459.mp4" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -rc_mode CBR -b:v 20103273 -maxrate 20103273 -bufsize 40206546 -profile:v:0 high -level 41 -sei -a53_cc -force_key_frames:0 "expr:gte(t,n_forced*3)" -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24" -codec:a:0 copy -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "c81dcb232c3daba3c9804b00b51dec4f-1.mp4" -start_number 0 -hls_segment_filename "/cache/transcodes/c81dcb232c3daba3c9804b00b51dec4f%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/cache/transcodes/c81dcb232c3daba3c9804b00b51dec4f.m3u8"
...
[h264 @ 0x563c1ddb6840] Hardware does not support image size 2336x1088 (constraints: width 0-2048 height 0-2048).
[h264 @ 0x563c1ddb6840] Failed setup for format vaapi: hwaccel initialisation returned error.
Impossible to convert between the formats supported by the filter 'Parsed_setparams_0' and the filter 'auto_scale_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
[libfdk_aac @ 0x563c1ddb5540] 2 frames left in the queue on closing
Conversion failed!

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Originally created by @podhorsky-ksj on GitHub (Jul 7, 2024). ### Please describe your bug Hardware (vaapi) does not support videos with higher resolution. See the log bellow I have found some arguments for ffmpeg, which could help - https://stackoverflow.com/questions/54063902/resize-videos-with-ffmpeg-keep-aspect-ratio?rq=1. I can't put it to jellyfin encoding.xml configuration. Not even after ffmpeg path. It is always rewritten. Also ffmpeg seems to have noautoscale argument (see log), which will be probably against this configuration I would add. ### Reproduction Steps 1. You need older hardware to reproduce it or video with higher resolution 2. play it on hardware, which will perform the resize (mobile phone) ### Jellyfin Version 10.9.0 ### if other: _No response_ ### Environment ```markdown - OS:[fedora 40 server] - Linux Kernel: 6.8.5-301 - Virtualization: podman - Clients: Android - Browser: no - FFmpeg Version: 6.0.1-Jellyfin - Playback Method: transcode - Hardware Acceleration: vaapi - GPU Model: 4x Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz description: VGA compatible controller product: 2nd Generation Core Processor Family Integrated Graphics Controller vendor: Intel Corporation physical id: 2 bus info: pci@0000:00:02.0 version: 09 width: 64 bits clock: 33MHz capabilities: msi pm vga_controller bus_master cap_list rom configuration: driver=i915 latency=0 resources: irq:27 memory:e0000000-e03fffff memory:d0000000-dfffffff ioport:3000(size=64) memory:c0000-dffff - Plugins: - Reverse Proxy: - Base URL: - Networking: - Storage: ``` ### Jellyfin logs ```shell Will provide, if needed. ``` ### FFmpeg logs ```shell /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -init_hw_device vaapi=va:/dev/dri/renderD128,driver=i965 -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:"/mnt/RAID/ALBUM/Svycarsko 2022/IMG_20220731_123459.mp4" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -rc_mode CBR -b:v 20103273 -maxrate 20103273 -bufsize 40206546 -profile:v:0 high -level 41 -sei -a53_cc -force_key_frames:0 "expr:gte(t,n_forced*3)" -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24" -codec:a:0 copy -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "c81dcb232c3daba3c9804b00b51dec4f-1.mp4" -start_number 0 -hls_segment_filename "/cache/transcodes/c81dcb232c3daba3c9804b00b51dec4f%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/cache/transcodes/c81dcb232c3daba3c9804b00b51dec4f.m3u8" ... [h264 @ 0x563c1ddb6840] Hardware does not support image size 2336x1088 (constraints: width 0-2048 height 0-2048). [h264 @ 0x563c1ddb6840] Failed setup for format vaapi: hwaccel initialisation returned error. Impossible to convert between the formats supported by the filter 'Parsed_setparams_0' and the filter 'auto_scale_0' Error reinitializing filters! Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 [libfdk_aac @ 0x563c1ddb5540] 2 frames left in the queue on closing Conversion failed! ``` ### Please attach any browser or client logs here _No response_ ### Please attach any screenshots here _No response_ ### Code of Conduct - [X] I agree to follow this project's Code of Conduct
OVERLORD added the wontfixinvalid labels 2026-02-07 03:02:28 +03:00
Author
Owner

@jellyfin-bot commented on GitHub (Jul 7, 2024):

Hi, it seems like your issue report has the following item(s) that need to be addressed:

  • The format of the environment section has been altered from the template.
  • You have not provided the ffmpeg log unaltered from the server. Please provide a valid ffmpeg log.

This is an automated message, currently under testing. Please file an issue here if you encounter any problems.

@jellyfin-bot commented on GitHub (Jul 7, 2024): Hi, it seems like your issue report has the following item(s) that need to be addressed: - The format of the environment section has been altered from the template. - You have not provided the ffmpeg log unaltered from the server. Please provide a valid ffmpeg log. This is an automated message, currently under testing. Please file an issue [here](https://github.com/jellyfin/jellyfin-triage-scripts/issues) if you encounter any problems.
Author
Owner

@podhorsky-ksj commented on GitHub (Jul 7, 2024):

It was needed to do like that. If needed, I will provide more, but I don't think to. Issue is known.

@podhorsky-ksj commented on GitHub (Jul 7, 2024): It was needed to do like that. If needed, I will provide more, but I don't think to. Issue is known.
Author
Owner

@felix920506 commented on GitHub (Jul 7, 2024):

Sorry but your hardware is too old to be of any use to Jellyfin. Please refer to https://jellyfin.org/docs/general/administration/hardware-selection to select appropriate hardware.

@felix920506 commented on GitHub (Jul 7, 2024): Sorry but your hardware is too old to be of any use to Jellyfin. Please refer to https://jellyfin.org/docs/general/administration/hardware-selection to select appropriate hardware.
Author
Owner

@gnattu commented on GitHub (Jul 7, 2024):

Sorry but your hardware is too old to be of any use to Jellyfin

To clarify this: your hardware decoder cannot decode videos higher than 2K width/height and the "custom argument" you provided cannot workaround this. You have to disable hardware acceleration if you want to play the file beyond your hardware capability.

@gnattu commented on GitHub (Jul 7, 2024): > Sorry but your hardware is too old to be of any use to Jellyfin To clarify this: your hardware decoder cannot decode videos higher than 2K width/height and the "custom argument" you provided cannot workaround this. You have to disable hardware acceleration if you want to play the file beyond your hardware capability.
Author
Owner

@podhorsky-ksj commented on GitHub (Jul 7, 2024):

Yes I know. But I would like to somehow separate bigger videos (without hw acceleration) from smaller with hw acceleration. When I was looking on google for solution, I have found similar issues with e.g. resolution limit 4000. So this issue will be still here and sometimes it will block someone.

I'm thinking about workaround. Create script, which would wrapup ffmpeg and selected as default ffmpeg in jellyfin. And when there are send videos with attributes and location, it would parse it and check the video resolution and if it is bigger, remove vaapi acceleration. But it would be better to have something like this directly in jellyfin.

@podhorsky-ksj commented on GitHub (Jul 7, 2024): Yes I know. But I would like to somehow separate bigger videos (without hw acceleration) from smaller with hw acceleration. When I was looking on google for solution, I have found similar issues with e.g. resolution limit 4000. So this issue will be still here and sometimes it will block someone. I'm thinking about workaround. Create script, which would wrapup ffmpeg and selected as default ffmpeg in jellyfin. And when there are send videos with attributes and location, it would parse it and check the video resolution and if it is bigger, remove vaapi acceleration. But it would be better to have something like this directly in jellyfin.
Author
Owner

@podhorsky-ksj commented on GitHub (Jul 9, 2024):

Hmm, I just finished the script. It is working ok, but the speed without HW acceleration is really slow.

But what is interesting, encoded parts, which had played, were removed in player. I don't have remove encoded parts enabled in settings. It seems some parts are kept in buffer...

@podhorsky-ksj commented on GitHub (Jul 9, 2024): Hmm, I just finished the script. It is working ok, but the speed without HW acceleration is really slow. But what is interesting, encoded parts, which had played, were removed in player. I don't have remove encoded parts enabled in settings. It seems some parts are kept in buffer...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#6096