Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th February 2017, 17:06   #21521  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,901
In this recorded video, it seems that Cybelink's H.264 DXVA decoder works fine, without errors using Polaris cards.

For the same clip LAV filters DXVA H.264 decoding gives errors.

https://drive.google.com/file/d/0B2T...83bmRPYkU/view

There are only two cases for the video above:

1) Cyberlink has managed to use H.264 DXVA in a different way than LAV filters for Polaris cards, without errors.

2) Cyberlink has managed to identify the specific clips that cause trouble to Polaris cards and use CPU as a fallback to DXVA HW acceleration, without warning to the users.
So although it says that it uses DXVA HW acceleration in general, the truth is that for those specific clips it falls back to SW decoding.

I personally believe it's the second case, so in order to be sure, someone can show us CPU usage for the specific clip using Cyberlink H.264 DXVA and LAV filters H.264 DXVA.

UPDATE:

It seems that Cyberlink's H.264 DXVA decoder works with 2% CPU usage, so there is probably an incompatibility with LAV DXVA H.264 decoder and Polaris HW decoder/driver.
__________________
Win 10 x64 (19042.572) - Core i5-2400 - Radeon RX 470 (20.10.1)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all

Last edited by NikosD; 10th February 2017 at 17:21. Reason: Update
NikosD is offline   Reply With Quote
Old 10th February 2017, 19:11   #21522  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,647
That file does not contain H.264 video. It is H.263.
clsid is offline   Reply With Quote
Old 10th February 2017, 19:12   #21523  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,901
How do you know ?

And there is no HW acceleration for H.263 files.

In AMD's forum there are a lot of H.264 files including mine, that can play fine with Cyberlink's H.264 DXVA decoder.

The issue could be a proprietary non standard implementation of DXVA H.264 decoder by AMD for Polaris driver/HW that causes problems with free/ open source projects like LAV filters that Cyberlink has managed to resolve.
__________________
Win 10 x64 (19042.572) - Core i5-2400 - Radeon RX 470 (20.10.1)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all

Last edited by NikosD; 10th February 2017 at 19:17.
NikosD is offline   Reply With Quote
Old 10th February 2017, 20:04   #21524  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,927
it is not that clear that the video shows the problem but is not the problem it self.
and there is hardware acceleration for h263.
huhn is offline   Reply With Quote
Old 11th February 2017, 00:20   #21525  |  Link
nussman
Registered User
 
Join Date: Nov 2010
Posts: 238
"Cyberlink's DXVA Decoder" always works "different" with special workarounds for special circumstances.
Especially for LiveTV this is very well known.

Anyway ... LiveTV H.264 is working with LAV (and MS Decoder) for years now with every other hardware. I still think its AMD to blame ...

Last edited by nussman; 11th February 2017 at 00:35.
nussman is offline   Reply With Quote
Old 11th February 2017, 03:50   #21526  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,927
i guessing doesn't fix this issue and if AMD polaris needs special treatment why isn't AMD providing a patch for FFmpeg this is the really strange part!
huhn is offline   Reply With Quote
Old 11th February 2017, 07:32   #21527  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
There is so many things AMD could do to resolve such issues -

- Fix them in the drivers
- Send patches to open-source projects like FFmpeg to work-around their quirks
- Or at the very least, document their quirks somewhere so developers can work around them themselves.

Of course anything but the first option feels a bit silly, vendor-specific quirks for *new* hardware in 2017 is just crazy, but if they can't do 1, then any other option is better then doing nothing.

There is also the simple option of it being a subtle bug somewhere in FFmpeg or LAV and not an actual quirk, but then again AMD could follow option 2 or 3 and reach out to FFmpeg, which powers the large majority of all media players out there.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 11th February 2017 at 07:38.
nevcairiel is offline   Reply With Quote
Old 11th February 2017, 13:31   #21528  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,901
I tried today MS DS and MS MFT H.264 DXVA decoders and have both the same problems as LAV during playback and seeking.

It would be a crazy coincidence if the decoders of the developers of Microsoft and FFMPEG (LAV) had exactly the same bug.

Also, I think now that it's not proprietary DXVA implementation because you couldn't use it at all.

It's probably what you call quirks, but hopefully it's not hardware (since Cybelink seems to work OK)
__________________
Win 10 x64 (19042.572) - Core i5-2400 - Radeon RX 470 (20.10.1)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all
NikosD is offline   Reply With Quote
Old 11th February 2017, 17:54   #21529  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,647
Hi nev, which toolchain are you currently using? I tried MSYS2 since the MSYS pack from XhmikosR that I used has some old libs (like openssl, which gives issues, see mpc-hc tracker). FFmpeg builds fine. But VS gives "error LNK2026: module unsafe for SAFESEH image" for x86 build. Disabling SAFESEH is of course bad idea. Do you perhaps have any tips?
clsid is offline   Reply With Quote
Old 11th February 2017, 18:25   #21530  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
I use MSYS2 with my own compiler (https://files.1f0.de/mingw/ - which is the same compiler build XhmikosR packages in his MSYS1 zips)

I doubt that MPC-HC uses OpenSSL though, and LAV certainly doesn't (it uses the Windows TLS/SSL support, and no, I'm not interested in silly reports of XP not supporting websites which require new encryption schemes).
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 11th February 2017 at 18:32.
nevcairiel is offline   Reply With Quote
Old 11th February 2017, 19:09   #21531  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,647
It is working properly again with your GCC build. Thanks. Should have tried that earlier. I am curious why their vanilla mingw build didn't work.
clsid is offline   Reply With Quote
Old 14th February 2017, 16:35   #21532  |  Link
aufkrawall
Registered User
 
Join Date: Dec 2011
Posts: 1,812
Would "native" CUDA decoding require a backend in the video renderer?
I tried it with mpv and it seems to give me by far the lowest overhead on both GPU and CPU, compared to copyback modes (on Linux too, btw.).
aufkrawall is offline   Reply With Quote
Old 14th February 2017, 16:52   #21533  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
Yes, it would. If you want absolutely minimal overhead then DXVA Native is your only choice.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 15th February 2017, 00:19   #21534  |  Link
MisterXDTV
Registered User
 
Join Date: Oct 2016
Posts: 17
Does or will LAV Video support DXVA for VP9 Profile 2 (10 bit) videos from youtube? I can't hardware decode it with LAV decoder no matter what I select (native, copy-back, NVIDIA CUVID). With another decoder it works fine
MisterXDTV is offline   Reply With Quote
Old 15th February 2017, 09:26   #21535  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,901
OK...

So, with the release of the new non-WHQL AMD driver 17.2.1, the decoding problem of corrupted image during playback and seeking with DXVA ffmpeg based decoders, like LAV and the H.264 video files (MBAFF, progressive, interlaced) using Polaris cards, has gone.

The image is fine like all other HW decoders from AMD, Nvidia, Intel.

The only compromise is a black screen for about 2 secs in the beginning of the file, while you can hear the sound and when you seek you get a frozen image for about 1 sec before normal playback starts again (while you can hear the sound).
__________________
Win 10 x64 (19042.572) - Core i5-2400 - Radeon RX 470 (20.10.1)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all
NikosD is offline   Reply With Quote
Old 16th February 2017, 21:30   #21536  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,901
According to AMD and based on some Jellybean samples, there is a bug in FFMPEG DXVA H.264 decoder (and LAV of course)

Quote:
Based on the clip provided:

When the user performs a seek, the player is supposed to locate the key frame first. The first frame that the decoder received is indeed a key frame and the output is displayed without corruption.

However, the issue starts happens with the next frame player sends out – the reference frame. While the bitstream is correct, the picture parameter sent by the player is not correct and not following DXVA2 specs supported by Microsoft.

The picture parameter provided for the second frame shows 4 frames in reference list. However, there should only be 1 because this frame is right after the I-frame

This triggers the driver code that when it detects a frame is outside the reference list, it marks this frame as an error frame and trying to hide the error by copying from the latest frame in reference frame buffer. This propagates the error and results in image flipping and corruption.

In software decode, the reference frame in always kept in memory, so it is always able to find the reference frame even though it is outside the limit.
__________________
Win 10 x64 (19042.572) - Core i5-2400 - Radeon RX 470 (20.10.1)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all
NikosD is offline   Reply With Quote
Old 16th February 2017, 21:36   #21537  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
Thats the same silly explanation you posted weeks ago, and it still has holes. Software decoders don't have access to any extra reference frames, neither does any other hardware.
If references are missing, there will be corruption, there is no doubt about that, but for some reason AMD never manages to recover afterwards, which it should.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 16th February 2017, 21:38   #21538  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,901
Ok, but is the DXVA2 specification restricted the way it's described and ffmpeg DXVA2 respects that restriction?
__________________
Win 10 x64 (19042.572) - Core i5-2400 - Radeon RX 470 (20.10.1)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all
NikosD is offline   Reply With Quote
Old 16th February 2017, 21:47   #21539  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
The decoder works in accordance to the H264 specification. If a reference frame is missing, a dummy frame is generated (ie. a blank one) to take its place, so its very well possible that the second frame after a seek already lists 4 references - 3 of those may just be empty dummy frames that are not available due to the seek.

That entire explanation is not logical, it talks about having too many reference frames and then talks about a missing reference frame. Thats not even the same thing.
Not to forget that the Microsoft decoder showed the same behavior, you would think Microsoft would implement their own DXVA2 specification correctly, right?
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 16th February 2017 at 21:50.
nevcairiel is offline   Reply With Quote
Old 17th February 2017, 00:10   #21540  |  Link
ibius
Registered User
 
Join Date: Jan 2005
Location: Germany
Posts: 52
Quote:
Originally Posted by MisterXDTV View Post
Does or will LAV Video support DXVA for VP9 Profile 2 (10 bit) videos from youtube? I can't hardware decode it with LAV decoder no matter what I select (native, copy-back, NVIDIA CUVID). With another decoder it works fine
Same here, is it by design? The hint says VP9 decoding is experimental, on what hardware exactly?

Win 8.1 x64, GP107 on Nvidia 376.33 drivers.
ibius is offline   Reply With Quote
Reply

Tags
decoders, directshow, filters, splitter


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.