Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request - add HW accelleration #26

Open
imzenreally opened this issue Feb 13, 2022 · 5 comments
Open

feature request - add HW accelleration #26

imzenreally opened this issue Feb 13, 2022 · 5 comments

Comments

@imzenreally
Copy link

i'm tinkering and trying to see if i can get it working - but currently am unable to test because my nvidia quadro is sitting on the shelf and won't be delivered until my buddy travels across contry - figured it would make life much easier when using h265 as your encoding choice

thought i might reach out to see if you are already looking at using hwaccel - but im a wicked ffmpeg novice and since i don't have a test bed yet ....

@nebhead
Copy link
Owner

nebhead commented Feb 14, 2022

Yeah, I haven't tested this because I don't have the hardware, but it's conceivably possible. If running inside the docker, then you'd have to expose the hardware device (probably), and the right version of FFMPEG installed. But otherwise, looks like it should work with the hwaccel argument: https://trac.ffmpeg.org/wiki/HWAccelIntro

@nhickster
Copy link

FYI, I assume this is about HW accelleration for ffmpeg, but using the hardware acceleration via the Plex Transcoder w/NVENC works for me with my nvidia quardro. However, I am not using a docker install, and am running Plex directly on my Ubuntu 20.04 machine. Because of that, I did have to change lines 46-48 to:

     export FFMPEG_EXTERNAL_LIBS="$(find /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/ -name "libmpeg2video_decoder.so" -printf "%h\n")/"
     check_errs $? "Failed to convert using smart Plex Transcoder (NVENC). libmpeg2video_decoder.so not found."
     export LD_LIBRARY_PATH="/usr/lib/plexmediaserver:/usr/lib/plexmediaserver/lib/:/usr/lib/x86_64-linux-gnu"

note the full path to Library/Application Support since $PLEX_HOME doesn't exist in my install, and also adding 'usr/lib/x86_64-linux-gnu' to the LD_LIBRARY_PATH since that is where my libcuda.so.1 was located.

@Frono
Copy link

Frono commented Apr 16, 2022

Not sure but I think you can add a version that applies to your HW accelerator

For mine I just use Intel's QuickSync settings. So to transcode in this script I add '-hwaccel qsv' to the FFMPEG command line. I think you could add config options to the script for HW accel type and video format (264 or 265) .

@imzenreally
Copy link
Author

imzenreally commented Jun 1, 2022

finally got around to installing my quadro - and i'm unable to get the script to work using hwaccel on ffmpeg or the nvtrans tool :(

totally possible its user error - was doing this while on a boring conf call - so will try some mor stuff this weekend

Decoder (codec mpeg2video) not found for input stream #0:0 ERROR # 1 : Failed to convert using smart Plex Transcoder (NVENC).

I get this loveliness when trying to use hwaccel cude for my quadro

find: ‘/home/nobody/Library/Application Support/Plex Media Server/Codecs/’: No such file or directory

it looks like it looking for a codecs directory ... i'm running this in docker
Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 704x480 [SAR 40:33 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn Side data: cpb: bitrate max/min/avg: 2917200/0/0 buffer size: 1835008 vbv_delay: N/A Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (libx265)) Stream #0:1 -> #0:1 (ac3 (native) -> aac (native)) Press [q] to stop, [?] for help -async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0. Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0: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 [aac @ 0x5616c5925100] Qavg: 236.929 [aac @ 0x5616c5925100] 2 frames left in the queue on closing

@apassiou
Copy link
Contributor

Added support for NVENC to my fork. Requires ffmpeg compiled with appropriate filters/libraries. Tested on Quadro P1000. Speed difference is ~17minute transcode on CPU for 60min video went down to ~3minute transcode for the same 1 hour video on the Quadrop P1000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants