Log in

View Full Version : ffdshow tryouts project: Discussion & Development


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 [206] 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308

XhmikosR
12th January 2010, 14:22
ffdshow_rev3200_20100112 (http://www.mediafire.com/?sharekey=3f33c77c2cf9ce25ab1eab3e9fa335ca95e79d7d0540e1e1)

NiFa
12th January 2010, 16:35
I tried newest revision (3200), and everything works! I have no problems with AC3 or DTS passthrough or AC3 encoder.
Thanks to everyone who works with ffdshow and got these problems solved.

clsid
12th January 2010, 17:04
MingW32 works fine for me in Vista x64, so I am not sure why you needed that weird workaround.

NiFa
12th January 2010, 18:12
Is there any possibilities to update to subtitles part in ffdshow, so that it loads ass/ssa settings correctly? Now when I use ffdshow with ass/ssa subtitles, thehere is problems with colors, shadows and outline settings, they aren't right. You can test this with any softsubbed anime using MPC-HC's internal renderer and ffdshow's subtitles.

deets
12th January 2010, 18:15
do we know if there are any plans to support bbc HD and live streams via DXVA?

consultant
12th January 2010, 18:15
WhenI download and install that 3200 build above, x64 version, I get source file is corrupt when it tries to install. I assume that is the 64-bit version?

I even uninstalled previous version and rebooted then tried it.

tal.aloni
12th January 2010, 18:18
WhenI download and install that 3200 build above, x64 version, I get source file is corrupt when it tries to install. I assume that is the 64-bit version?

I even uninstalled previous version and rebooted then tried it.

it happened for me too, probably some corruption in the upload process.

XhmikosR
12th January 2010, 18:28
MediaFire is becoming less reliable every day... Try now, I re-uploaded the x64 build so it should be fine (I compared also the MD5 checksums).

NiFa
12th January 2010, 20:44
Below are pictures with differences between ffdshow and MPC-HC internal subtitle renderer.

MPC-HC internal subtitle renderer
http://img684.imageshack.us/img684/6035/mpchcinternalsubtitlere.th.png (http://img684.imageshack.us/i/mpchcinternalsubtitlere.png/)
ffdshow
http://img689.imageshack.us/img689/5564/ffdshowsubtitles.th.png (http://img689.imageshack.us/i/ffdshowsubtitles.png/)

CiNcH
12th January 2010, 20:52
Seems both, H.264 and VC-1 DXVA decoders, have no NALU/Access Unit parser, so they expect the source/splitter/demuxer filter to deliver exactly one NALU/Access Unit per MediaSample.

Elbart_
12th January 2010, 21:14
it will again with 3195+

Yes, with 3200, ffmpeg-mt works again. Thanks to devs and helpers!

deets
12th January 2010, 21:23
Seems both, H.264 and VC-1 DXVA decoders, have no NALU/Access Unit parser, so they expect the source/splitter/demuxer filter to deliver exactly one NALU/Access Unit per MediaSample.

this being the same reason we cant use MPC DXVA for live streams either?

clsid
12th January 2010, 23:04
The normal ffdshow decoder is also lacking a full parser for access units.

Ger
12th January 2010, 23:28
Perhaps, but whatever haruhiko added in 2008 when he worked with CiNcH & co was enough to make the ffdshow software decoder work well with live DVB streams.

We (DVB users) have been hoping that Casimir would add this to the MPC-HC DXVA decoder for a while, like haruhiko did for the ffdshow software part. But if albain could add this to ffdshow's DXVA decoder (would be very much appreciated) then I think it would be possible to use ffdshow for most/all DVB channels/streams. At least for video.

For audio (separate issue) I don't think LATM encapsulated HE-AAC is suported in ffdshow. Not the most common format in DVB streams, but it's used in some countries like Norway and New Zealand. ffdshow doesn't show up as an option for AAC decoder in DVBViewer, and neither the Haali nor the Gabest/MPC-HC TS splitter seems to ID the audio track correctly. Monogram AAC decoder + DVBViewer works fine, as does VLC. I can provide a sample TS recording AVC + LATM/HE-AAC from Norwegian DVB-T if anyone wants to look into it, but I think the TS splitters must be worked on first.

crlorentzen
13th January 2010, 00:08
I tried newest revision (3200), and everything works! I have no problems with AC3 or DTS passthrough or AC3 encoder.
Thanks to everyone who works with ffdshow and got these problems solved.

agreed, 3200 works perfectly. I don't even need to use the Connect as PCM first check box and all acs/dts pass-through works perfectly. Thanks to all especially you albain.

iron2000
13th January 2010, 05:26
3200 works ok here too but with DXVA the picture slows down and explodes to artifacts on seek.
Happens on both 32-bit and 64-bit versions.

Jeremy Duncan
13th January 2010, 06:09
3200 works ok here too but with DXVA the picture slows down and explodes to artifacts on seek.
Happens on both 32-bit and 64-bit versions.

If you open ffdshow video decoder, decoder options.
Then uncheck these two boxes: Detect soft telecine, Drop frame on delay.
Then try out your test clip where the picture goes funny, is the picture still garbled?

http://thumbnails23.imagebam.com/6353/9635f563520739.gif (http://www.imagebam.com/image/9635f563520739)

CiNcH
13th January 2010, 09:33
The normal ffdshow decoder is also lacking a full parser for access units.
True for VC-1, not for H.264.

iron2000
13th January 2010, 12:26
If you open ffdshow video decoder, decoder options.
Then uncheck these two boxes: Detect soft telecine, Drop frame on delay.
Then try out your test clip where the picture goes funny, is the picture still garbled?



Thanks but the problem only happens with the DXVA decoder.
Will changing the settings in the non-DXVA decoder affect it?
Even if I wanted to change the settings, the profile that calls the DXVA decoder doesn't have the decoder options.

I've set ffdshow such that it plays video with resolution equals of larger than my desktop resolution with the DXVA decoder.
Playback is very nice as always with the non-DXVA decoder.

albain
13th January 2010, 12:53
That's right, the decoder options are not available in DXVA decoder but I don't know if they are used or usable : the options are not accessible but the settings are present (they are set to default).

Elbart_
13th January 2010, 14:44
Hm, weird.
After rebooting because of the Windows-update, I tried to play an AVC-video, and ffmpeg-mt again wasn't working (libavcodec did), although it did before the reboot. After reinstalling 3200, it worked again. I wonder, why it's only ffmpeg-mt which has these problems?

albain
13th January 2010, 15:08
Can we remove the following option in FFDShow audio output section ?

"Don't use WAVEFORMATEXTENSIBLE header when not needed"

I don't see the interest of keeping it, this doesn't mean anything by the way

tal.aloni
13th January 2010, 15:39
Intel has recently posted an article about copying DXVA decoded frame from the portion of the memory that belongs to the GPU back to the system RAM.

this could mean we will be able to apply all post processing filters after utilizing DXVA decoding. (except maybe the resize filter)
we're still not sure if this could be applied for DXVA 1.0 as well, we do have some interesting ideas.

albain has volunteered (again) to try and implement it.

link:
http://software.intel.com/en-us/articles/copying-accelerated-video-decode-frame-buffers/

p.s.
the memory bandwidth required to process 1080p24 that way seems easily obtainable.

STaRGaZeR
13th January 2010, 16:07
Yay! :)

iron2000
13th January 2010, 16:25
If you open ffdshow video decoder, decoder options.
Then uncheck these two boxes: Detect soft telecine, Drop frame on delay.
Then try out your test clip where the picture goes funny, is the picture still garbled?



I disabled both options from the DXVA profile through the registry but the artifects on seek is still there.

tal.aloni
13th January 2010, 17:08
H.264 DXVA seeking artifacts happens for me too, probably the decoder does not wait for an I frame. I'll have a look.

STaRGaZeR
13th January 2010, 17:13
How's seeking speed compared to software decoding and MPC's DXVA, specially if you seek to B frames? My PC has been on repairs for quite some time and I haven't tested ffdshow's DXVA yet.

tetsuo55
13th January 2010, 17:23
Intel has recently posted an article about copying DXVA decoded frame from the portion of the memory that belongs to the GPU back to the system RAM.

this could mean we will be able to apply all post processing filters after utilizing DXVA decoding. (except maybe the resize filter)
we're still not sure if this could be applied for DXVA 1.0 as well, we do have some interesting ideas.

albain has volunteered (again) to try and implement it.

link:
http://software.intel.com/en-us/articles/copying-accelerated-video-decode-frame-buffers/

p.s.
the memory bandwidth required to process 1080p24 that way seems easily obtainable.keep in mind this only works for DXVA2 and thus vista and higher, so DXVA1 will not work.(although some things could be done in shaders)

tal.aloni
13th January 2010, 17:37
I have no reason to think it would not work on DXVA1,
according to MSDN, we can use DXVA 1.0's GetBuffer() with 0xFFFFFFFF to get the pointer to the decoded buffer, copy to RAM (using the above method), apply post processing (except resize of course) and the question remains if we can copy it back to the GPU memory.
(as alternative to the last stage, we can also use VMR9's AllocatorPresenter to override the original image completely)

Jeremy Duncan
13th January 2010, 18:32
That's right, the decoder options are not available in DXVA decoder but I don't know if they are used or usable : the options are not accessible but the settings are present (they are set to default).

It would be intersting if you made a build with both video decoders: dxva and regular video decoder, use the settings I recommended where you uncheck those options.

That way there would be no mistake that this would help or not.

I have updated the ffdshow wiki in the sw section. I showed how visual studio basic, the free version, can make ffdshow.ax. I showed how to fix the error "'atlbase.h': No such file or directory" when using the free visual studio, and I built a ffdshow installer to verify that you can.

So if somebody wants to learn how it won't cost them anything. :)

link (http://ffdshow-tryout.sourceforge.net/wiki/devel:building#using_visual_studio_to_create_the_files_listed_in_the_compilers_section)

tal.aloni
13th January 2010, 19:00
I disabled both options from the DXVA profile through the registry but the artifacts on seek is still there.

I do not have those artifacts now, but I remember them from one of the previous buids. so either it's been solved, or the conditions do not occur right now.

anyway, those options have nothing to do with DXVA and should not have any effect.

Sebastiii
13th January 2010, 19:07
:thanks: Jeremy Duncan for Wiki :)

I'll try to try :)
Seb.

tal.aloni
13th January 2010, 21:37
I was able to modify DXVA 1.0 decoded image using the code below (under Windows XP):
however, there's still a lot to figure, for instance, I still need to understand how exacly the raw image is stored, but the fact is that I can read it, modify it, and have the renderer show it...


HRESULT hr = E_INVALIDARG;
BYTE* pDXVABuffer;
DWORD dwTypeIndex = 0xffffffff;
switch (m_nEngine)
{
case ENGINE_DXVA1 :

LONG lStride;
hr = m_pAMVideoAccelerator->GetBuffer(dwTypeIndex, bufferIndex, FALSE, (void**)&pDXVABuffer, &lStride);
ASSERT (SUCCEEDED (hr));
// modify buffer here
hr = m_pAMVideoAccelerator->ReleaseBuffer(dwTypeIndex, bufferIndex);
ASSERT (SUCCEEDED (hr));

Edit:
according to specs, this should run after Execute and before EndFrame, however, according to practive, this should run immediately after EndFrame()

dstln
14th January 2010, 05:18
Loving the dxva/force dxva settings :)

JarrettH
14th January 2010, 05:38
Are there no more official releases?

Keiyakusha
14th January 2010, 06:07
Does anyone tried to compare speed of ffdshow's DXVA to the original one in MPC-HC? So far I saw only one benchmark and it shows that for some reason FFDShow is twice slower. I don't want to believe in that... Its not like I know a good way of testing DXVA decoding speed, but still I'm curious.

tal.aloni
14th January 2010, 07:04
Does anyone tried to compare speed of ffdshow's DXVA to the original one in MPC-HC? So far I saw only one benchmark and it shows that for some reason FFDShow is twice slower.

It's almost exactly the same implementation, so it can't be very different in speed.

CruNcher
14th January 2010, 07:51
yes it doesn't work @ all :P
whatever i do i land @ MPC-HC Video Decoder decoding H.264 streams via the VP2 and ffdshow doesn't trigger any DXVA @ all even if forced like disable H.264 enable H.264 DXVA :(

hoborg
14th January 2010, 08:11
Hi.
I tested DXVA decoder (rev.3200) - h.264 seems to be OK, but i have problems with VC-1 - looks like bad frame order.
Tested on ATI 4770 (cat. 9.12 + Win7 x64). No problem with MPC decoder.

tal.aloni
14th January 2010, 08:23
Hi.
I tested DXVA decoder (rev.3200) - h.264 seems to be OK, but i have problems with VC-1 - looks like bad frame order.
Tested on ATI 4770 (cat. 9.12 + Win7 x64). No problem with MPC decoder.
post / PM a sample please!
also, please try 3198 and tell me if the order is correct.

tetsuo55
14th January 2010, 09:12
post / PM a sample please!
also, please try 3198 and tell me if the order is correct.keep in mind that both haali and mpc-hc splitter do wierd things with the timestamps.
Contact casimir for more information, so this can be fixed once and for all.

hoborg
14th January 2010, 09:17
post / PM a sample please!
also, please try 3198 and tell me if the order is correct.

Sended.
Can you compile 3198 for me? On http://xvidvideo.ru there are only 3195 then 3200...

BTW, i tested it with Haali (1.9.355.21) as splitter -
So combination of:
Haali + MPC decoder - OK
Haali + FFDshow DXVA - not OK.

albain
14th January 2010, 09:40
I was able to modify DXVA 1.0 decoded image using the code below (under Windows XP):
however, there's still a lot to figure, for instance, I still need to understand how exacly the raw image is stored, but the fact is that I can read it, modify it, and have the renderer show it...


HRESULT hr = E_INVALIDARG;
BYTE* pDXVABuffer;
DWORD dwTypeIndex = 0xffffffff;
switch (m_nEngine)
{
case ENGINE_DXVA1 :

LONG lStride;
for (int bufferIndex=0; bufferIndex<m_nPicEntryNumber; bufferIndex++)
{
hr = m_pAMVideoAccelerator->GetBuffer(dwTypeIndex, bufferIndex, FALSE, (void**)&pDXVABuffer, &lStride);
ASSERT (SUCCEEDED (hr));
// modify buffer here
hr = m_pAMVideoAccelerator->ReleaseBuffer(dwTypeIndex, bufferIndex);
ASSERT (SUCCEEDED (hr));

(this should run after Execute)

Thanks Tal, this sounds pretty exiting


I have not done like you : I am in the TDXVADecoder::DisplayNextFrame method and instead of displaying it I come back to TvideoCodecLibavcodecDxva and call a new method to copy the frame back from the GPU into the system memory, then process it through FFDShow filters.
In that way we should be able to apply all the filters including resize, crop... (I hope)

The tough part is to reproduce the TvideoCodecLibavcodec::decompress method (just after decoding) to create a TPict and get back into the nominal code path.

tal.aloni
14th January 2010, 10:46
I have not done like you : I am in the TDXVADecoder :: DisplayNextFrame method


The value 0xFFFFFFFF is valid only between calls to IAMVideoAccelerator::BeginFrame and IAMVideoAccelerator::EndFrame


so according to the specs (which may be stricter than actuall driver / hardware)

// Decode bitstream
CHECK_HR (Execute());
if (any post processing is active)
{
//TDXVADecoder::ProcessDecodedFrame
CHECK_HR (ProcessDecodedFrame()); // copy, apply post processing and copy back
}
CHECK_HR (EndFrame(nSurfaceIndex));

anyway, I'm sure you'll figure out the best way, it is indeed exciting.

http://msdn.microsoft.com/en-us/library/dd376003(VS.85).aspx

Lam3rD
14th January 2010, 15:24
Hello. I don't know if anyone cares about this, but some of the internal AVISynth functions doesn't work the way they are supposed to do.

I'm trying to make something simple for ITU/NON-ITU detection on DVDs as a part of a bigger script, however it doesn't work as expected, so I guess there might be something wrong with ffdshow_setsar

Temp=stackhorizontal(crop(0,16,32,-16),crop(width-32,16,0,-16)).grayscale
(width==720)?FrameEvaluate("AverageLuma(Temp))<30?ffdshow_setsar(ffdshow_sar_x*45,ffdshow_sar_y*44):ffdshow_setsar(ffdshow_sar_x,ffdshow_sar_y)"):ffdshow_setsar(ffdshow_sar_x,ffdshow_sar_y)
This isn't the exact script, it's boosted so it could easily go bananas. I'm watching the Output SAR/DAR in the OSD - it does change and it shifts it's location, but the image remains with exactly the same shape.

Also I would love to know if there are any other variables/functions, that I could use to interact between ffdshow and it's AVISynth filter. I have never found those listed anywhere (besides being used in the script on the wiki). It'd be cool if there are a few showing the results from the auto detections ffdshow performs - PC/TV Levels; Interlaced/Progressive flags etc.

albain
14th January 2010, 16:13
I have a problem and I kinda lack of knowledge on that part

Maybe Tal or someone else can help me out on this

The frames that are in the GPU are in a flat buffer

Whereas FFDShow works with color planes : for example with a YCbCr colorspace you have 3 planes so 3 buffers.

I know the colorspace, I have a flat buffer.

How can I convert it into n buffers ?

This is an example but it applies to all colorspaces.

Are there built functions inside FFDShow to do that ?

This is a necessary step to build the TPict and to feed the processing filters

Thanks

EDIT : okay, I think that this is like in TvideoCodecUncompressed.
Another problem : the CopyBack method used to copy from the DXVA buffer to system memory uses SSE4 instructions which are not templatized : I mean that you don't call SSE 1,2,... instructions dirrectly but call methods that would call the instructions if the CPU support them or call a coded method that can do it instead.

hoborg
14th January 2010, 17:28
post / PM a sample please!
also, please try 3198 and tell me if the order is correct.

OK, i finished test right now.
The sample i posted to you works just fine in 3198 like others VC-1 samples i have.
In 3200 sample i sended to you are broken, but rest of VC-1 videos i have seems to be OK.

Sebastiii
14th January 2010, 19:16
I am in admiration of you guys :)
And exciting too :)

Good luck :)
Seb.

therealjoeblow
14th January 2010, 19:50
Two things:

1) Could someone please tell me if the "profiles and presets" function works with the DXVA settings - IE, can I set a profile to enable DXVA for H264 when W=1920, and be off when W<1920 (that way I can still use the Lanczos resizer for my 720p encodes)?

and...

2) DXVA is also the terminology used by most filters for hardware decoding of DVD/MPEG2 - can we add that as an additional option to the DXVA options screen (beside the tickboxes for H246 and VC1) , and remove the less intuitive "set interlace flag in output media type" from the regular decoder's "output" tab (the latter setting is what triggers DXVA to be initiated for DVD/MPEG2 decoding).

clsid
14th January 2010, 19:56
1) yes, you can make presets
2) ffdshow does not have DXVA capabilities for MPEG-2, I think you are confusing DXVA with hardware deinterlacing