Hardware Decoding (Assist)

Here you can ask your questions on how to use Comskip for the detection of commercials. Also questions on how to remove commercials are welcome
arrmo
Posts: 7
Joined: Sun Feb 24, 2019 1:36 am

Hardware Decoding (Assist)

Post 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!

erik
Site Admin
Posts: 3338
Joined: Sun Aug 21, 2005 3:49 pm

Re: Hardware Decoding (Assist)

Post 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.

arrmo
Posts: 7
Joined: Sun Feb 24, 2019 1:36 am

Re: Hardware Decoding (Assist)

Post 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!

erik
Site Admin
Posts: 3338
Joined: Sun Aug 21, 2005 3:49 pm

Re: Hardware Decoding (Assist)

Post 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

arrmo
Posts: 7
Joined: Sun Feb 24, 2019 1:36 am

Re: Hardware Decoding (Assist)

Post 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!

erik
Site Admin
Posts: 3338
Joined: Sun Aug 21, 2005 3:49 pm

Re: Hardware Decoding (Assist)

Post by erik »

That sounds promising!

arrmo
Posts: 7
Joined: Sun Feb 24, 2019 1:36 am

Re: Hardware Decoding (Assist)

Post by arrmo »

Agreed! I have to think detection could be faster than transcoding. Will take a look.

TobiasB
Posts: 1
Joined: Mon Apr 08, 2019 10:07 am

Re: Hardware Decoding (Assist)

Post by TobiasB »

I thought detection and transcoding take about the same time. What did you find, Arrmo?

erik
Site Admin
Posts: 3338
Joined: Sun Aug 21, 2005 3:49 pm

Re: Hardware Decoding (Assist)

Post by erik »

Decoding generally takes less time than encoding to detection can be faster than transcoding

arrmo
Posts: 7
Joined: Sun Feb 24, 2019 1:36 am

Re: Hardware Decoding (Assist)

Post 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.

wmarler
Posts: 5
Joined: Mon Apr 20, 2020 11:08 pm

Re: Hardware Decoding (Assist)

Post 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,

wmarler
Posts: 5
Joined: Mon Apr 20, 2020 11:08 pm

Re: Hardware Decoding (Assist)

Post 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?

wmarler
Posts: 5
Joined: Mon Apr 20, 2020 11:08 pm

Re: Hardware Decoding (Assist)

Post 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.

arrmo
Posts: 7
Joined: Sun Feb 24, 2019 1:36 am

Re: Hardware Decoding (Assist)

Post 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!

wmarler
Posts: 5
Joined: Mon Apr 20, 2020 11:08 pm

Re: Hardware Decoding (Assist)

Post 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.

Post Reply