jellyfin-archive / jellyfin-docs

Documentation for Jellyfin
https://jellyfin.org
Creative Commons Attribution Share Alike 4.0 International
143 stars 220 forks source link

VAAPI vs. QSV #210

Open cromefire opened 4 years ago

cromefire commented 4 years ago

@Artiume jellyfin-qsv.log jellyfin-vaapi.log

Have a look at the QSV log does it even use QSV? It's fast enough, but it does not have it in the commandline

EraYaN commented 4 years ago

Your qsv log is a plain software encode. Please provide the actual run with qsv h264_qsv. It'll look like this: https://trac.ffmpeg.org/wiki/Hardware/QuickSync

Artiume commented 4 years ago

@EraYaN i believe he did try QSV, we were discussing it in the chat. Do you know any reason why it wouldn't use libmfx? I can't test vaapi/qsv so I can't verify the functionality of the stream builder. Have you ever used qsv?

cromefire commented 4 years ago

I definitely configured QSV so either there are drivers missing or JF has a problem with it

Artiume commented 4 years ago

Notes: Enabling QSV with ffmpeg https://software.intel.com/en-us/articles/quick-start-on-integrating-ffmpeg-libraries

Dockerfile for compiling ffmpeg, https://github.com/jellyfin/jellyfin-ffmpeg/blob/39f183cc303e9c8542c9905e31e733490f999b2f/docker/Dockerfile#L348-L379

Person troubleshooting their QSV. https://software.intel.com/en-us/forums/media/topic/803933

General Info https://software.intel.com/sites/default/files/media_server_studio_getting_started_guide.pdf

From the looks of it --enable-nonfree isn't there. Based on licensing, can we add that or would that cause trouble for us?

cromefire commented 4 years ago

No that makes it unredistributable (It also shows a big warning telling you that then)

cromefire commented 4 years ago

The only thing you could theoretically do is build it on that device automatically

cromefire commented 4 years ago

I don't what to build my own ffmpeg right now so I think I guess we can close this pretty much

Artiume commented 4 years ago

https://www.ffmpeg.org/legal.html

I can add more notes I want to parse if you want

Artiume commented 4 years ago

NDI added nonfree to their FFmpeg build and all hell broke lose. Looks like it was because their overall license was the issue, not the nonfree itself. https://trac.ffmpeg.org/ticket/7589?cversion=0&cnum_hist=11

Emby thread with compiling FFmpeg locally. https://emby.media/community/index.php?/topic/10723-gpu-transcoding-intel-quicksync-and-nvidia-nvenc/page-30

Unofficial FFMPEG 'How not to get into Hall of Shame' FAQ for legalities https://forum.doom9.org/showthread.php?t=154477

More instructions on QSV and Linux https://www.intel.de/content/dam/www/public/emea/xe/en/documents/white-papers/quicksync-video-ffmpeg-install-valid.pdf 3.Configure FFmpeg with “--enable –libmfx –enable-nonfree”, build, and install.This requires copying include files to /opt/intel/mediasdk/include/mfx andadding a libmfx.pc file. More details below. We also don't enable libmfx by default. I need to dig into what the nonfree enables. As long as it doesn't allow for libs we can't use, we should be good to go, but licensing isn't my forte. I'm finding mostly results about people violating GPL, not for violating with -nonfree in a GPL license.

anthonylavado commented 4 years ago

For reference (because this has been long lost in the main repo), here are Emby's flags: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/emby-server#n75

Artiume commented 4 years ago

Thanks. So for HWA we're missing --enable-nvdec --enable-nvenc --enable-libmfx. Not sure if there's any other flags we should be including.

I've seen reports of people using NVENC so I want to check their reddit post and see if they did anything special.

Edit: https://www.reddit.com/r/jellyfin/comments/amuyba/nvenc_nvdec_working_in_jellyfin_on_ubuntu_server/ I'm happy to report that hardware transcoding with NVIDIA GPUs under Ubuntu Server 18.04 works in an out-of-the-box config on Jellyfin! hmmm....

cromefire commented 4 years ago

Just be sure to not make it unredistributable by accident

Artiume commented 4 years ago

Don't worry, we won't make changes without thorough research and approvals. It appears that nonfree isn't needed based on other builds, but needs testing to be verified.

Good breakdown. http://www.ffmpeg-archive.org/What-does-enable-gpl-and-enable-nonfree-do-td2239371.html

Another project tackling the nonfree issue. https://github.com/SynoCommunity/spksrc/issues/3564

nonfree build example https://gist.github.com/silverkorn/db5451f836e2bf9dea2a8358475eb5f4

JustAMan commented 4 years ago

Shameless plug of ffmpeg build: https://github.com/JustAMan/ffmpeg-standalone-build

cromefire commented 4 years ago

The nonfree warning is commented out on your repo, which is not good

Artiume commented 4 years ago

So you can provide build instructions, you can't provide built binaries. The licenses are weird about that

cromefire commented 4 years ago

Oh sorry it's just it's another place

cromefire commented 4 years ago

Well if there's docker on that system you could automatically build it 😂

Artiume commented 4 years ago

https://github.com/jellyfin/jellyfin/issues/2261#issuecomment-579728052

Can you make sure these are installed?

cromefire commented 4 years ago
E: Unable to locate package intel-media-va-driver-non-free

Ubuntu 18.04

cromefire commented 4 years ago

Won't work for me anyway my processor is older than Broadwell