Git Product home page Git Product logo

Comments (13)

th0ma7 avatar th0ma7 commented on August 16, 2024 1

@WesSouza at first read it wasn't that obvious that you where referring to opencl missing requirements. Indeed, opencl is not integrated currently in SynoCommunity's ffmpeg. It's on my todo list but didn't got to it yet.

from spksrc.

WesSouza avatar WesSouza commented on August 16, 2024 1

@th0ma7 done!

from spksrc.

mreid-tt avatar mreid-tt commented on August 16, 2024

@WesSouza, out of curiosity, on the same hardware what was the conversion rate in Docker?

from spksrc.

WesSouza avatar WesSouza commented on August 16, 2024

I just reenabled the Docker project and realized the videos are being remuxed. I believe there's something wrong somewhere that prevents the SynoCommunity version of Jellyfin not to remux.

The conversion seems equally slow unfortunately.

Edit: I tested different videos. Transcoding is much slower on the Syno package than when using Docker for the same video.

from spksrc.

WesSouza avatar WesSouza commented on August 16, 2024

@mreid-tt Added two ffmpeg logs to the description (one from this package, one from the docker instance), showing the differences.

So far:

  • ffmpeg version is different (I tried with 5.1.3-2 from the SynoCommunity and got the same results)
  • The JSON on docker sets "IsAVC": true and "NalLengthSize": "4" versus false and "0"

I also reenabled the same hardware acceleration settings on both instances and the ffmpeg command has two differences:

# Present on Docker, missing from Syno
-hwaccel_output_format vaapi

# Docker
-vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,deinterlace_vaapi=rate=frame,scale_vaapi=format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv"

# Syno
-vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,yadif=0:-1:0,scale=trunc(min(max(iw\,ih*a)\,min(1920\,1080*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(1920/a\,1080))/2)*2,format=nv12"

Both playbacks were attempted on the same video on the same browser (Safari on macOS), and Jellyfin's display version is the same on both instances.

from spksrc.

WesSouza avatar WesSouza commented on August 16, 2024

The lack of -hwaccel_output_format vaapi seems to be caused by Syno's ffmpeg not providing the opencl hardware acceleration and filters.

From Jellyfin's code:

  1. The code that adds -hwaccel_output_format vaapi checks hwSurface (here)
  2. hwSurface requires isIntelVaapiOclSupported, which requires IsOpenclFullSupported()
  3. isIntelVaapiOclSupported requires both opencl hardware acceleration, scale_opencl filter and specific filters tonemap_opencl and overlay_opencl (here)

All of these are available on the Docker compose instance, but absent from Syno's ffmpeg.

from spksrc.

mreid-tt avatar mreid-tt commented on August 16, 2024

@WesSouza, thank you for providing additional detail.

@th0ma7, I remember you working with the ffmpeg package before. Could you share any insights that might help resolve this issue?

from spksrc.

th0ma7 avatar th0ma7 commented on August 16, 2024

@WesSouza there are a few caveats when using ffmpeg on you nas, your user must be part of the videodriver group.

vainfo will confirm what access you do have from your user account in use when accessing ffmpeg. See: https://github.com/SynoCommunity/spksrc/wiki/FAQ-FFmpeg

from spksrc.

WesSouza avatar WesSouza commented on August 16, 2024

I have no idea how to add myself to the videodriver group on Synology, but I can run those as root.

root@WexDrive:~# vainfo 
Trying display: drm
libva info: VA-API version 1.18.0
libva info: Trying to open /var/packages/ffmpeg/target/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.18 (libva 2.18.1)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.6 (3359d2df)
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD

root@WexDrive:~# /var/packages/ffmpeg/target/bin/ffmpeg -hide_banner -hwaccels
Hardware acceleration methods:
vaapi
qsv
drm


root@WexDrive:~# /var/packages/ffmpeg/target/bin/ffmpeg -hide_banner -filters | grep opencl
root@WexDrive:~#

Now if I run these commands on the Docker container:

root@WexDrive:~# docker exec -i -t jellyfin bash
root@50ca4db67f1c:/# /usr/lib/jellyfin-ffmpeg/vainfo
Trying display: drm
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.1.1 (f5f09c4)
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD

root@50ca4db67f1c:/# /usr/lib/jellyfin-ffmpeg/ffmpeg -hide_banner -hwaccels
Hardware acceleration methods:
cuda
vaapi
qsv
drm
opencl
vulkan

root@50ca4db67f1c:/# /usr/lib/jellyfin-ffmpeg/ffmpeg -hide_banner -filters | grep opencl
 ... avgblur_opencl    V->V       Apply average blur filter
 ... boxblur_opencl    V->V       Apply boxblur filter to input video
 ... colorkey_opencl   V->V       Turns a certain color into transparency. Operates on RGB colors.
 ... convolution_opencl V->V       Apply convolution mask to input video
 ... deshake_opencl    V->V       Feature-point based video stabilization filter
 ... dilation_opencl   V->V       Apply dilation effect
 ... erosion_opencl    V->V       Apply erosion effect
 ... nlmeans_opencl    V->V       Non-local means denoiser through OpenCL
 ... overlay_opencl    VV->V      Overlay one video on top of another
 ... pad_opencl        V->V       Pad the input video.
 ... prewitt_opencl    V->V       Apply prewitt operator
 ... program_opencl    N->V       Filter video using an OpenCL program
 ... remap_opencl      VVV->V     Remap pixels using OpenCL.
 ... roberts_opencl    V->V       Apply roberts operator
 ... scale_opencl      V->V       Scale the input video size through OpenCL.
 ... sobel_opencl      V->V       Apply sobel operator
 ... tonemap_opencl    V->V       Perform HDR to SDR conversion with tonemapping.
 ... transpose_opencl  V->V       Transpose input video
 ... unsharp_opencl    V->V       Apply unsharp mask to input video
 ... xfade_opencl      VV->V      Cross fade one video with another video.
 ... openclsrc         |->V       Generate video using an OpenCL program

What am I missing here? All signs point to ffmpeg missing opencl.

from spksrc.

WesSouza avatar WesSouza commented on August 16, 2024

@th0ma7 is there an open issue for it I should be watching? Or something I could do to help?

from spksrc.

th0ma7 avatar th0ma7 commented on August 16, 2024

Just rename this ticket to be more relevant to opencl and I'll look into that during my next upgrade cycle.

from spksrc.

reykjalin avatar reykjalin commented on August 16, 2024

Jellyfin recommends a modified version of FFMPEG: https://github.com/jellyfin/jellyfin-ffmpeg. Maybe that's what's missing here?

from spksrc.

th0ma7 avatar th0ma7 commented on August 16, 2024

Jellyfin recommends a modified version of FFMPEG: https://github.com/jellyfin/jellyfin-ffmpeg. Maybe that's what's missing here?

Yes and no. All jellyfin ffmpeg patches are included in our default build. What's missing are

  1. Including opengl intel drivers (currently missing from build)
  2. Updating both ffmpeg and use latest snapshot of the jellyfin patches.

It is on my todo list but cycles have been rather limited lately.

from spksrc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.