Page 1 of 2

Hardware Decoding (Assist)

Posted: Sun Feb 24, 2019 1:40 am
by arrmo
Hi,

Really happy with comskip overall - it does clip well, quite reliable. I would just like to speed it up a bit, it's running about the same speed as transcoding for me (from MPEG2 TS to HEVC). I do have a relative quick GPU, trying to make use of that.

I did try setting hardware_decode=1 in the ini file, but it really didn't speed things up ... if anything, this is slightly slower. Or, do I also need to add --cuvid or --hwassist to the command line?

Thanks!

Re: Hardware Decoding (Assist)

Posted: Sun Feb 24, 2019 8:33 am
by erik
For some strange not understood reason I was not able to give comskip the right HW acceleration performance.
It is something I need to dive into when I have substantial more time.

Re: Hardware Decoding (Assist)

Posted: Sun Feb 24, 2019 1:37 pm
by arrmo
Completely understand. I'd be more than willing to help out, if I can. I do have some programming experience, but don't claim to be an expert.

Is there a particular place to hunt in the code?

Thanks!

Re: Hardware Decoding (Assist)

Posted: Sun Feb 24, 2019 3:29 pm
by erik
If you are familiar with how ffmpeg implements HW acceleration you are welcome to take the comskip source from github and find out why it is not delivering the expected improvement on Windows
On Linux it seems to work as exptected

Re: Hardware Decoding (Assist)

Posted: Sun Feb 24, 2019 5:51 pm
by arrmo
OK, will dig into it. FYI, I'm running on Linux - that's where I'm seeing the issues.

I did run comskip and ffmpeg on a file yesterday (~ 4 hours of video, golf) - comskip took ~ 1.5 hours to complete, ffmpeg (transcoding to HEVC) ~ 30 min.

Thanks!

Re: Hardware Decoding (Assist)

Posted: Sun Feb 24, 2019 6:13 pm
by erik
That sounds promising!

Re: Hardware Decoding (Assist)

Posted: Sun Feb 24, 2019 6:52 pm
by arrmo
Agreed! I have to think detection could be faster than transcoding. Will take a look.

Re: Hardware Decoding (Assist)

Posted: Tue Apr 09, 2019 2:24 pm
by TobiasB
I thought detection and transcoding take about the same time. What did you find, Arrmo?

Re: Hardware Decoding (Assist)

Posted: Tue Apr 09, 2019 2:42 pm
by erik
Decoding generally takes less time than encoding to detection can be faster than transcoding

Re: Hardware Decoding (Assist)

Posted: Tue Apr 09, 2019 3:15 pm
by arrmo
erik wrote:Decoding generally takes less time than encoding to detection can be faster than transcoding
Yes, agreed - same finding here. With HW accel, MPEG2TS ... is see decoding (comskip) ~ 2x faster than transcoding.

Re: Hardware Decoding (Assist)

Posted: Tue Apr 21, 2020 10:03 pm
by wmarler
I'm on Linux, and thinking of buying a video card or CPU with integrated video capability for the purpose of accelerating Comskip.

I cloned the Git repo and built without issues. Running from the CLI with --help params I see that there is HW support, but it doesn't look like the VAAPI is supported:

Code: Select all

% comskip --help
Usage:
  comskip  [-h|--help] [-w|--debugwindow] [-n|--playnice] [--zpcut] [--zpchapter] [--scf] [--videoredo] ... 
  ...
  --hwassist                Activate Hardware Assisted video decoding
  --cuvid                   Use NVIDIA Video Decoder (CUVID), if available
  --vdpau                   Use NVIDIA Video Decode and Presentation API (VDPAU), if available
  --dxva2                   Use DXVA2 Video Decode and Presentation API (DXVA2), if available
So that would suggest to me that getting a new CPU with an Intel GPU onboard wouldn't be of any assistance. Do I understand that right?

Erik, is implementing VAAPI support anywhere on your radar? My guess would be that that's not trivial, but my understanding is also that the VAAPI has good documentation and support for Linux.

Thanks,

Re: Hardware Decoding (Assist)

Posted: Tue Apr 21, 2020 10:07 pm
by wmarler
It looks like ffmpeg supports VAAPI out of the box pretty well: https://trac.ffmpeg.org/wiki/HWAccelIntro . So could it be enabled in Comskip just by building with the right ffmpeg?

Re: Hardware Decoding (Assist)

Posted: Wed Apr 22, 2020 5:47 pm
by wmarler
Oh nevermind :-D. Turns out it's pretty easy to find an old nVidia card with the full VDPAU feature set. There are a bunch for $25 on eBay.

Re: Hardware Decoding (Assist)

Posted: Wed Apr 22, 2020 6:51 pm
by arrmo
wmarler wrote: Wed Apr 22, 2020 5:47 pm Oh nevermind :-D. Turns out it's pretty easy to find an old nVidia card with the full VDPAU feature set. There are a bunch for $25 on eBay.
Interested! :D . Any pointers / cards that you are looking at?

Thanks!

Re: Hardware Decoding (Assist)

Posted: Thu Apr 23, 2020 6:55 pm
by wmarler
Yep, I'm looking at GeForce 520's with a PCI-e x16 interface: https://www.ebay.com/sch/i.html?_from=R40&_nkw=GeForce+GT+520&_sacat=0&LH_TitleDesc=0&_fsrp=1&_sop=15

I'm too new on these forums; can't use url tags yet. Also, I need to set my default setting to follow threads I post to ... #derp

Here's the list of nVidia cards that are supported under Linux and what feature set of the VDPAU API they implement: https://download.nvidia.com/XFree86/Linux-x86_64/304.137/README/supportedchips.html

To understand what's available/not available in the feature set, head to https://download.nvidia.com/XFree86/Linux-x86_64/304.137/README/vdpausupport.html#vdpau-implementation-limits-decoder

When the time comes I'm leaning towards the nouveau driver over nvidia's, based on https://wiki.archlinux.org/index.php/Hardware_video_acceleration which says says "Nouveau open-source driver supports both VA-API and VDPAU" and "NVIDIA proprietary driver supports via nvidia-utils". There's also info there to help verifying that the driver stack is loaded.