View Full Version : MPEG2DEC3 lack of YUV and RGB output -- serious?


Guest
1st May 2004, 06:26
MPEG2DEC3 lacks integrated YUV and RGB output (it's available from extra filters). The problem with non-integrated conversions is that the frame pf (progressive/interlaced) bit cannot be used to select the correct upsampling.

In practice, how serious is this deficiency? Do streams mix interlaced/progressive sampling in practice? Is it bad enough to motivate bringing the conversions into MPEG2DEC3?

A hack would be to pass a hint to the conversion filters as in Decomb. :)

zettai
1st May 2004, 08:22
You may remember my experiences from this thread:

http://forum.doom9.org/showthread.php?s=&postid=474888#post474888


Personally I don't mind which way it's performed - either by hints for conditionalreader or having the ability to do the colourspace conversion in mpeg2dec. Something tells me that having both would be, of course, ideal.

I have already written a ConvertHybridToYUY2() function that uses IsCombed so it would be trivial to change that to a different conditional setting :P

Cyberia
1st May 2004, 21:03
Does his mean that MPEG2DEC3 would be able to output RGB or YUV?

It seems to me that it would be better to allow AviSynth to perform the colorspace conversion. This would prevent having to maintain two sets of similar code.

On the other hand, wouldn't Avisynth would have to be modified to read any hint passed on from MPEG2DEC3? Is this practicle?

zettai
1st May 2004, 21:46
If hints are produced then you can just create custom functions to do the correct upsampling. It's infinitely better than the way it works now.

So you'd make a function something like this:

function ConvertHybridtoYUY2(clip a){

b=converttoYUY2(a,interlaced=false)
c=converttoYUY2(a,interlaced=true)
conditionalfilter(a,b,c,"IsInterlaced()","equals","false")
}

So it doesn't require any modification in Avisynth

However, if the avisynth devs decide it would be useful having as a named parameter in the conversion scripts then they made add this so you could have ConvertToYUY2(mpeg2dec=true) which would pay attention to the YV12 frame type. It's not necessary for the the devs to do this work though and it's pretty obvious that not many people do colourspace conversions of hybrid material as this hasn't been complained about as a deficiency very often - most people move straight onto deinterlacing/IVTC.

vispgraedde
2nd May 2004, 07:34
Conversion directly in MPEG2dec3 or hinting or both, as long as at least one of the options exist :)

I have some (anime) dvd's that is hybrid encoded where it would be nice to have proper upsampling throughout the whole thing.

For some, I have some (weird?) behaviour where in dvd2avi, the progressive/interlace marker flashes throughout the whole thing (not tested with dg version yet) so it is hard to make a script that treats sections properly without any hinting at all.

scharfis_brain
2nd May 2004, 10:26
Is it possible to create such hybrid MPEG myself?
All encoder I know, do only support manually setting the encode-mode before encoding. No automated solution here.
This would significantly gain up compressibility on hybrid Videos (PAL & NTSC)

Mug Funky
2nd May 2004, 10:37
@ scharfi:

i think TMPGenc has a special mode that detects hard-telecines and uses repeat flags. it's pretty accurate, too. kinda works like telecide.

i've only used this once, and didn't really check how it was working, but it's a good place to start. my vids certainly compressed better this way.

[edit]

aah, here it is:

## TMPGenc "Encode mode" tooltip:
<> Inverse 3:2 pulldown

encodes 29.97fps or 30fps interlace movie at the same time doing inverse 3:2 pulldown if possible

scharfis_brain
2nd May 2004, 14:10
is it able to work on PAL, too?

this is called 2:2 Pulldown, then.

Kika
2nd May 2004, 23:14
No, all 3:2-Pulldown-Functions in TMPGEnc are for dealing with NTSC-Source only. But used in combination, you can do a 23.976 -> 25 fps PALSpeedUp from 29.97 telecined Video by using only TMPGEnc. That's the methode i worked with before i changed to AVISynth.

RB
3rd May 2004, 11:26
I'd vote for both, hint and internal conversion to YUY2. Neuron2, I don't think you'll have to implement the color conversion yourself. You can just call AVISynth's internal ConvertToYUY2() and just set the interlaced flag on a frame-by-frame basis, right?

Si
3rd May 2004, 16:09
I'd like MPEG2DEC3 to do it as I still like to work in 4:2:2 and it would save me having to think (which you know hurts my brain a lot :p )

regards
Si