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

phunqe
12th September 2007, 00:43
Feels like I'm missing something fundamental here, but I can't get ffdshow's h264 decoding to work on both my CPU cores. I've even tried setting the number of threads to 2 in decoder options, but it only uses one.

Currently using ffdshow_rev1471_20070909_clsid, but I've tried with other revisions as well and also on a different machine. Tried on both XP SP2 and Vista Ultimate x86.

Please advice.

Thank you.

foxyshadis
12th September 2007, 02:28
It only decodes if it has multiple slices, like apple trailers, old x264 multithreaded encodes, Nero (I think?), maybe others. No idea whether HD discs use slices, if not then no threading currently.

cc979
12th September 2007, 05:29
@haruhiko_yamagata remember when i mentioned about 'no text' in video decoder configuration part, which shows ..

codecs, directshow control, ... (which does not show anymore for me)

is unicode required to compile ffdshow.ax, as ansi from gcc is not displayed ?

cheers

haruhiko_yamagata
12th September 2007, 11:24
@haruhiko_yamagata remember when i mentioned about 'no text' in video decoder configuration part, which shows ..

codecs, directshow control, ... (which does not show anymore for me)

is unicode required to compile ffdshow.ax, as ansi from gcc is not displayed ?

cheersI compiled ffdshow by GCC 4.0.4. It works fine for me. I cannot reproduce. Could you send me the ffdshow.ax?

cc979
12th September 2007, 16:08
did one working and a new one
http://www.speedyshare.com/778904670.html

cheers

phunqe
13th September 2007, 08:57
How's the roadmap looking regarding dual core / multi processor support? Even with a fast cpu I get choppy performance when playing high bitrate 1080p videos.

Using CoreAVC for now, but it would be nice to have everything in one place.

foxyshadis
13th September 2007, 09:00
You'll have to ask ffmpeg. ffdshow is only the public face (like mplayer and vlc), actual decoding algorithms aren't written by us. =p

phunqe
13th September 2007, 09:43
...and there is a good example on that I should get my morning coffee before even remotely trying to ask any questions whatsoever.

Sorry :p

Leak
13th September 2007, 16:31
I'm having a slightly different problem with the ffdshow audio decoder and "swap channels" (which I use to swap the left and right channels since I have my stereo speakers behind me when I'm using my projector):

I was watching the first season of Star Trek: Voyager on DVD when I noticed that the episodes on the second disc stayed silent *unless* I activated 32-bit output in the ffdshow audio decoder. Using 16 or 24 bit instead doesn't work, as the 5.1 AC3 audio will stay silent - but it does work in the menu at first, which only has stereo audio... :confused:

Could it be that channel swapping, for whatever reason, only works right with 32bit output?

The three filters I'm using are the mixer (to mix 5.1 down to stereo), "swap channels" to swap left and right and "volume" to amplify things a bit.

I've used VOB Blanker to produce a stripped down set of files that is still able to reproduce the problem and put it here (http://leak.no-ip.org/Stuff/Voyager1.1.2_Menus.7z) in case someone wants to try this out - just open the VIDEO_TS.IFO in MPC, click "English", "Phage" and "Launch" - as soon as the episode starts to play (without having "32 bit output" checked), there's no more sound from there on, as going back to the menu also lacks any sound after that.

np: Mike Shannon - Last One Terrified (Possible Conclusions To Stories That Never End)

yesgrey
13th September 2007, 23:35
It would be great to have an option in the output tab for converting to a custom RGB. This custom RGB would be obtained specifying the conversion 3x3 matrix to convert from YV12/YUY2 -> RGB.

This is needed because some displays have RGB primaries different from the BT.709, and with a custom matrix we can correct them to obtain the colors as they are supposed to be.

Ideally, we would have two RGB custom sets, because some videos are BT.601 and others are BT.709.

Would this be very hard to do? In case it's a simple thing is there anyone who can do it? I could try to do it, but I don't know where to start, and my c++ and asm skills are very low... I only know c.

Thanks.

haruhiko_yamagata
14th September 2007, 14:02
It would be great to have an option in the output tab for converting to a custom RGB...
Do you have any samples that use non BT.601? It's not too hard, but I need sample to work on.

yesgrey
14th September 2007, 19:50
Do you have any samples that use non BT.601? It's not too hard, but I need sample to work on.

I think that any blu-ray or hd-dvd are in BT.709. I could try to prepare you a little sample, but any sample should work, even a BT.601 one, because the idea is not correcting the source, the idea is changing the source in a way that when output in the display it shows the right colors. Some displays have a color gammut wider than the source, so, at the output, the colors are different than what's supposed to be. We can correct this with a transformation matrix to convert the source colors from the source color gammut to the display color gammut. I already wrote a matlab file to calculate this matrix, now I only need a way to use this matrix. ffdshow is the best place, since lots of people use it for viewing their content.

Or when you talk about a sample you are talking about a custom matrix sample?

Thanks for your help.

amt
14th September 2007, 20:38
Such a feature would be appreciated. My LCD TV has a nasty red push and it would be nice to be able to compensate for it in ffdshow.

@yesgrey3
How did you calculate a custom matrix for your display? Did you use a colorimeter to measure the displays real gammut?

Atak_Snajpera
14th September 2007, 23:23
I have one question. Why MJPEG in VFW decoder is disabled by default?

yesgrey
15th September 2007, 00:06
@amt

Yes, it's the only way. With the primaries coordinates, it's just doing the math. Let's see how all this works out and then I will put here my matlab file.

Nicholi
15th September 2007, 00:14
I'm having a slightly different problem with the ffdshow audio decoder and "swap channels" (which I use to swap the left and right channels since I have my stereo speakers behind me when I'm using my projector):

I was watching the first season of Star Trek: Voyager on DVD when I noticed that the episodes on the second disc stayed silent *unless* I activated 32-bit output in the ffdshow audio decoder. Using 16 or 24 bit instead doesn't work, as the 5.1 AC3 audio will stay silent - but it does work in the menu at first, which only has stereo audio... :confused:

Could it be that channel swapping, for whatever reason, only works right with 32bit output?
I'm surprised my eye caught this post. I can confirm Leak's initial finding. Awhile back I ran into a DVD much like his, it opened with trailers that were 2ch stereo audio but the menu and movie had 5.1. Everything was fine through the trailers but when the menu followed (and also into the movie) the sound was completely gone. Basically running on ffd defaults, no filters and 16bit output.

What I noticed was if I forced the channel mixing (set it to 5.1) and played from the beginning of the DVD everything was fine. But leaving the mixing off caused the change in channel numbers to freak out ffd. Never did check with 32bit output, didn't occur to me. But I checked again just now and attempting to force any of the other outputs makes no difference.

haruhiko_yamagata
15th September 2007, 06:14
did one working and a new one
http://www.speedyshare.com/778904670.html

cheers
OK, I'm begining to understand. Though I cannot reproduce using my own compilation, I hope next my commit will fix it.

yesgrey
15th September 2007, 14:57
haruhiko,

Here is a sample custom matrix:
C = [0.879244 0.101276 0.019480]
[0.044836 0.915219 0.039945]
[0.015503 0.097127 0.887370]

Considering the BT.601->RGB conversion matrix as B, the conversion from YUV->custom RGB should be:
[RGBcustom] = C x B x [YUV]

Leak
15th September 2007, 17:43
I was wondering one thing about auto-preset loading: it loads the first preset that matches *any* condition set for the preset - wouldn't it make much more sense to at least include the option to only load the first preset to match *all* conditions?

I.e. I have two presets that convert DVDs for my 800x600 projector, but one for NTSC and one for PAL - currently I can't make an autoload preset that only loads when there's both the "DVD Navigator" filter in the graph *and* the frame rate is 30Hz for NTSC and another similar one for 25Hz for PAL...

Mind if I add a per-preset option to choose whether any or all conditions must match? :)

np: Mike Shannon - Tears (Possible Conclusions To Stories That Never End)

clsid
15th September 2007, 21:25
Instead of adding yet another option, wouldn't it be better to just make it work the logical way. For me also that would mean using AND instead of OR on all the enabled conditions in a preset.

Leak
15th September 2007, 23:20
Instead of adding yet another option, wouldn't it be better to just make it work the logical way. For me also that would mean using AND instead of OR on all the enabled conditions in a preset.
Well, sure. I just was erring on the cautious side because someone might already be making use of the "OR" behaviour, which would of course break with a change to "AND"...

The code change itself should be rather minimal, but the implications might not be. What does the rest here think?

np: Luke Vibert - Comphex (Chicago, Detroit, Redruth)

Bathrone
16th September 2007, 04:02
Can a new build be done please theres some changes in the log I'm keen to test, thanks.

yesgrey
16th September 2007, 19:09
Haruhiko,
Here is a little help from me: I have made some changes to the ffdshow video output dialog tab. Let me know what you think (and others from here, also) about it. If you all agree about it, let me know how should I add it.

Looking at it you could have a better idea of what I am suggesting:
-a way to select the matrix coefficients for the YUV->RGB conversion (I have looked at ffdshow code and it appears that it already supports both matrices, I think it's just needed to add the code for the selection)
-allowing a conversion between RGB spaces with different primaries coordinates. For this, we should supply a matrix for the conversion. This matrix should be applied after the conversion from YUV->RGB. If we multiply the YUV->RGB matrix with the RGB->RGBdisplay matrix at the beggining, the YUV->RGBdisplay conversion could be done without any processing penalty.

Rash
16th September 2007, 22:50
I've noticed that ffdshow's systray icons always create the right-click menu on the ffdshow audio icon (the blue one on clsid build). But I usually play videos that require only the video decoder, so I don't get a menu. Is there a way I could make ffdshow create the menu on the video decoder tray icon?

Thank you.

foxyshadis
17th September 2007, 03:50
Haruhiko,
Here is a little help from me: I have made some changes to the ffdshow video output dialog tab. Let me know what you think (and others from here, also) about it. If you all agree about it, let me know how should I add it.

Looking at it you could have a better idea of what I am suggesting:
-a way to select the matrix coefficients for the YUV->RGB conversion (I have looked at ffdshow code and it appears that it already supports both matrices, I think it's just needed to add the code for the selection)
-allowing a conversion between RGB spaces with different primaries coordinates. For this, we should supply a matrix for the conversion. This matrix should be applied after the conversion from YUV->RGB. If we multiply the YUV->RGB matrix with the RGB->RGBdisplay matrix at the beggining, the YUV->RGBdisplay conversion could be done without any processing penalty.

That's a decent UI for it, although I'm of the opinion that a custom RGB conversion should be done as a separate filter, not as part of the normal conversion. Mainly because few would use it, but also because I'm concerned that applying the matrix before or after would cause banding and slowdown. (So does levels, and I already avoid its use whenever possible.) Fortunately, it'd probably actually be easier to avoid both by just precomputing the coefficients and combining them into one operation. (Obviously this won't work with ICM profiles, but so far no one's requested those.)

yesgrey
17th September 2007, 10:29
Fortunately, it'd probably actually be easier to avoid both by just precomputing the coefficients and combining them into one operation.

That's my idea. Maybe I was not clear enough, but that was my thinking. It's just multiplying the two matrices before starting the process to obtain the coefficients. That's also why I thought adding this matrix to the output tab. If it is a diagonal matrix with all coefficients 1.0, it does nothing. Another option (which I prefer) is putting a check box to enable/disable the use ot the custom RGB matrix, but the dialog is already so crowd!...

I have considered this instead of the ICM profiles because it would be easier and faster to do. It would be perfect if we just entered our display primaries coordinates and then ffdshow would do all the math, but that was a much more harder task, and very few people would actually use it, because not everyone could measure their display primaries.
To easier the task, I have written a little matlab file for calculating the conversion matrix for the display color primaries. With this file and the ffdshow presets/profiles capability, we could approach the ICM profiles capability.

I know this is not completelly accurate, because for a correct ICM we should correct the RGB colors at the linear domain, but according to Poynton's colorfaq n.20, if all the conversion coefficients are close to either zero or one, the resulting erros of performing the conversion at the non-linear domain will be insignificant.

haruhiko_yamagata
18th September 2007, 12:49
Haruhiko,
Here is a little help from me: I have made some changes to the ffdshow video output dialog tab. Let me know what you think (and others from here, also) about it. If you all agree about it, let me know how should I add it.
Thank you. It explains clearly what you need.
The dialog is cool, but bit too crowded for new users. I think new page should be added as an option to "Output".

yesgrey
18th September 2007, 13:11
The dialog is cool, but bit too crowded for new users.

Yes, i thought it too.

I forgot one thing. The conversion routines to RGB have four options: rec601, rec709, pc601, pc709. Currently, i believe the conversion to RGB uses the rec601 option, but it would be great to have all 4 available, especially the pc601 and pc709 options, because that are the most important for an accurate viewing.

I have considered another way of solving my request, maybe it's easier...
Since ffdshow has avisynth support, I could request to be added the possibility of a custom matrix to the ConvertToRGB routine and then use it with ffdshow. This routine already have all the other options I am requesting with a plus: we could use better sample algorithms for the chroma (in 2.6).

Since this is a correction needed only for the viewing, the right place to do it is in ffdshow, but let me know what you think about it...

obieobieobie
18th September 2007, 13:48
Is there a difference between the mpeg4 asp decoder in ffdshow and the one in vlc? I can see combing artifacts when ffdshow decodes but not when vlc decodes the same file. The file is ripped from cable tv and deinterlaced before encoding.

edit: no deinterlacing is enabled in either ffdshow or vlc

haruhiko_yamagata
18th September 2007, 15:26
The conversion routines to RGB have four options: rec601, rec709, pc601, pc709.
Is it possible to auto-detect rec and pc?
If you have samples that use pc601/709, please send us some.

LotharZ
18th September 2007, 16:17
Hi, I found 2 sub/idx (vobsub) files that seems ffdshow can't handle.

Track1 show the first line but then freezes and Track2 isnt showed. They were merged on a mkv file but no works in and out of the file.

They come from a Cromatine (anime) episode.
[a-s]_sakigaki!!_cromartie_high_school_-_23_-_stone_cold_crazy__ranmasaotome_[AC5956B4].mkv

Files: http://sharebee.com/ff3a1f10

At same time, I've a request, could you add a feature on the Subtitles section that discarts the SSA tangs on that kind of subs, It could be really useful to watch some subtitles that have annoying gothic fonts or extremely small sizes coded.

thx

yesgrey
18th September 2007, 22:24
Is it possible to auto-detect rec and pc?

I don't think so. The real question is that the conversion from YUV to RGB should translate the Y channel [0:255] to RGB [0:255]. The video black and white at YUV [16,16,16] and [235,235,235] should be converted to RGB [16,16,16] and [235,235,235], because it still exist video info bellow [16,16,16] and above [235,235,235]. If you use rec, the whites will be crushed, because all YUV values above [235,235,235] will be converted to RGB [255,255,255]. All dvd movies should be converted with pc values. This is the same thing between overlay mixer and VMR. Overlay mixer convert YUV to RGB using rec and VMR convert using pc, the way it should be. That's why we should prefer VMR for viewing instead of overlay mixer.

If you want to read more about this subject try this thread, which is very informative:
http://archive2.avsforum.com/avs-vb/showthread.php?t=416292&highlight=blacker+AND+than+AND+black

yesgrey
18th September 2007, 23:25
haruhiko,
you have a PM.

KoD
19th September 2007, 11:27
yesgrey3, what you are saying and what the Microsoft engineers speak of in that article (it's Microsoft that asked of Nvidia and ATi too implement the VMR this way) is not the proper way. Don't trust what others say so much, read about color transforms from the specs yourself.

haruhiko_yamagata
19th September 2007, 11:38
Hi, I found 2 sub/idx (vobsub) files that seems ffdshow can't handle.

Track1 show the first line but then freezes and Track2 isnt showed. They were merged on a mkv file but no works in and out of the file.

They come from a Cromatine (anime) episode.
[a-s]_sakigaki!!_cromartie_high_school_-_23_-_stone_cold_crazy__ranmasaotome_[AC5956B4].mkv

Files: http://sharebee.com/ff3a1f10

OK, confirmed. I can reproduce if I check "Obey positional settings from Subtitles page". If I uncheck it, I can watch the subtitles but its color is wrong.

At same time, I've a request, could you add a feature on the Subtitles section that discarts the SSA tangs on that kind of subs, It could be really useful to watch some subtitles that have annoying gothic fonts or extremely small sizes coded.

thxIt's not too hard to implement. The problem is that the dialog is too crowded.

haruhiko_yamagata
19th September 2007, 11:40
All dvd movies should be converted with pc values.Is this correct? The color spaces are really confusing.

Jeremy Duncan
19th September 2007, 15:48
Is this correct? The color spaces are really confusing.

If you want to be sure. Post the question in this forum:
Link (http://www.avsforum.com/avs-vb/forumdisplay.php?f=139)

haruhiko_yamagata
19th September 2007, 16:24
If we multiply the YUV->RGB matrix with the RGB->RGBdisplay matrix at the beggining, the YUV->RGBdisplay conversion could be done without any processing penalty.Unfortunately it costs more CPU.BT.709 color space conversion (please check if it is correct)

R=1.164(Y-16)+1.792(V-128)
G=1.164(Y-16)-0.2128(U-128)+0.5323(V-128)
B=1.164(Y-16)-2.111(U-128)Here, to get R, we don't have to calculate x*(U-128).
If we want to support custom matrix, we have to calculate x*(U-128) for R and x*(V-128) for G. So it means we have to modify the asm code a lot.

haruhiko_yamagata
19th September 2007, 16:29
If you want to be sure. Post the question in this forum:
Link (http://www.avsforum.com/avs-vb/forumdisplay.php?f=139)
I have converted some DVD using pc601, which have resulted poor image. I think most DVD should not be converted with pc601. And yes, there are few DVD that should be converted with pc601. MPC seems to detect automatically and does a good job.

yesgrey
19th September 2007, 18:37
yesgrey3, what you are saying and what the Microsoft engineers speak of in that article (it's Microsoft that asked of Nvidia and ATi too implement the VMR this way) is not the proper way. Don't trust what others say so much, read about color transforms from the specs yourself.

Where could I read about it?
I do not trusted them. What they said in that thread makes sense and is logical. I also have tryed to perform the conversion as they suggested and realized that it made sense to be that way. Maybe I am wrong and they are wrong, I don't know, but it's strange when the "wrong" way makes sense and the "correct" doesn't,
but maybe I am not seeing the whole picture...

Wilbert
19th September 2007, 20:09
@haruhiko_yamagata,

The correct formulas for YCbCr [16,235] <-> RGB [0,255] (Rec.709) are:

R=1.164*(Y-16)+1.792*(V-128)
G=1.164*(Y-16)-0.2129*(U-128)-0.5326*(V-128)
B=1.164*(Y-16)+2.113*(U-128)

as derived in http://avisynth.org/mediawiki/Color_conversions.

yesgrey
19th September 2007, 21:45
I have converted some DVD using pc601, which have resulted poor image.

Yes, I also agree that using pc601 the image is less appealling that using rec601, but it does not means that is the way it should be done. With rec601 the image has more contrast, which is more appealling, but you also get a crush in the whites. Very bright scenes became all white, instead of several shades of white. I have seen it in some movies.

yesgrey
19th September 2007, 21:52
Unfortunately it costs more CPU.Here, to get R, we don't have to calculate x*(U-128).
If we want to support custom matrix, we have to calculate x*(U-128) for R and x*(V-128) for G. So it means we have to modify the asm code a lot.

Yes, you are right. I forgot that without the custom matrix there are less two values to consider, which have to be considered when the matrices multiplication occur.

Maybe it's better the other option of using avisynth ConvertToRGB, since with it the code is already wrote to support the full matrix.

Thanks anyway!

Wilbert
19th September 2007, 22:06
Yes, I also agree that using pc601 the image is less appealling that using rec601, but it does not means that is the way it should be done. With rec601 the image has more contrast, which is more appealling, but you also get a crush in the whites.
Yes, but that's only a little crush. On DVDs black is centered around 16 and white is centered around 235. I say centered, because 16 is not the min and 235 not the max value, but those are averages. You can see this nicely with AviSynth and Limiter(show=true).

yesgrey
19th September 2007, 23:09
Yes, but that's only a little crush. On DVDs black is centered around 16 and white is centered around 235. I say centered, because 16 is not the min and 235 not the max value, but those are averages. You can see this nicely with AviSynth and Limiter(show=true).

Yes, that's exactly the conclusion of the thread I have put the link. The more relevant is the data above 235, because the data bellow 16 is not supposed to be viewed, that's the reason for some people using a compromise solution, like: [14,245]->[0:255], and for this they use the filter levels. But if the conversion to RGB uses the rec mode, this cannot be done. That's why I suggest the conversion could also be done with the pc mode, so we can customize the output for our likings. ffdshow as it is now, is not very usefull for converting to RGB.

The use of the [0,255]->[0,255] is justified because they say it's a more smooth conversion from YUV to RGB which could cause less banding. For me, I think the best should be the compromise solution.

Kado
19th September 2007, 23:21
It looks like VMR9 uses the "set pixel aspect ratio in output media type" but evr and haali renderer don't.
with vmr9 video play wide but with evr and haali plays more 4:3 style with option enabled/intermediate and 4:3 for all with option disabled.
video info: size:704x480, sar:853/704, dar:853/480.
file is "[Hauu~].Higurashi.no.Naku.Koro.ni.Nekogoroshi-hen.(H264.Vorbis)[F654D046].mkv"

thuan
20th September 2007, 01:45
@Kado: I can play that file perfectly fine over here with Haali with everything is default.

EDIT: Which splitter are you using? Haali or Gabest?

Kado
20th September 2007, 10:30
I'm using haali splitter. in your system you get wide screen video with haali renderer for that file? in mine wide is only with vmr9...

haruhiko_yamagata
20th September 2007, 10:52
I tried to playback a dts-wav file (*.wav) with MPC and ffdshow v1381 , but no success ...
Filters: Wave Parser , ffdshow

in ffdshow codecs: DTS in wav is checked (nothing happens)
AC3filter can playback it (if I check PCM at system tab)

Anyone confirm it ? Or do I need something to set?
If it's a bug, can someone tell a working version number?

ThanksI found the way.
* Enable "Uncompressed" and "Check for DTS in WAV" at the foot note of DTS.
* Raise the merit value.

thuan
20th September 2007, 11:41
Yeah, perfectly normal over here. Maybe you should try resetting your MPC settings for aspect ratio and related stuffs (settings under Video Frame and Pan&Scan).