PDA

View Full Version : Vertical Smear on flv Playback in MPC


eseses
1st July 2009, 00:53
Hi,

is it normal for Media Player Classic to smear the bottom 5 pc (or so) when playing FLV-Video? (screenshot attached)
I experience it here with mpc 6.4.9.1 and ffdshow, but a virtual machine shows the same behaviour even without ffdshow.

Is there anything i can do about that?

Inspector.Gadget
1st July 2009, 01:32
The DXVA-enabled H.264 decoder has trouble with certain streams that aren't mod16 vertically, in my experience.

Edit: This is not the problem. Sorry.

Keiyakusha
1st July 2009, 02:08
Old MPC has DXVA decoder too? :scared:

eseses
1st July 2009, 18:33
Is there any build of MPC which doesnt have this problem?

Keiyakusha
1st July 2009, 19:20
You can try latest old MPC (http://www.xvidvideo.ru/content/view/806/4/) or latest new MPC-HC (http://www.xvidvideo.ru/content/view/808/2/)

clsid
1st July 2009, 19:32
That 'smear' is actually part of the video. It is there to make pad it to a mod-16 resolution. It should normally get cropped away automatically during playback. But in DirectShow that is a bit complicated because the splitter and the decoder are two separate entities. The splitter reads the intended resolution, but the decoder is the one that must do the cropping. The FLV splitter and ffdshow don't work together to do that, so the padded lines are not cropped.

Blight
1st July 2009, 20:01
clsid:
But doesn't the decoder know there's nothing to decode there? If not cropped, how about blacked out instead of replicating the last line?

her34
1st July 2009, 21:06
for alternative, vlc is able to handle/remove the blur

although i wish mpc would correct for the blur

MatMaul
1st July 2009, 21:08
clsid:
But doesn't the decoder know there's nothing to decode there? If not cropped, how about blacked out instead of replicating the last line?
that's the encoder which add this padding lines. There are present in the stream and need to be cropped at playback by the decoder.
ATM there is a little problem of communication between the FLV splitter and ffdshow :p
if I remember correctly the cropping infos are in the FLV container so it needs to be "send" to ffdshow via the mediatype but this seems to be ignored by ffdshow. Last time I checked the problem didn't exist with the internal mpc decoder.

clsid
1st July 2009, 21:48
MPC-HC internal decoder is able to do the cropping when used in combination with the internal FLV splitter. ffdshow is lacking this workaround. This issue is already present on the bugtracker.

Blight
1st July 2009, 22:54
clsid:
Since the splitter is open-source, isn't it possible to just add the interaction code?

clsid
2nd July 2009, 00:21
Well, go ahead and submit a patch ;)

Blight
2nd July 2009, 14:03
clsid:
I would, but I don't have an understanding of either code base, so it would be very difficult (even if it was a small fix).

MatMaul
2nd July 2009, 18:45
here is a working fix but I can't assure that it doesn't break an other format, it needs to be reviewed by haruhiko_yamagata for example :p
Index: src/TffDecoder.cpp
===================================================================
--- src/TffDecoder.cpp (revision 3022)
+++ src/TffDecoder.cpp (working copy)
@@ -345,7 +345,7 @@
if (!vih) return E_OUTOFMEMORY;
ZeroMemory(vih,sizeof(VIDEOINFOHEADER));

- vih->rcSource.left=0;vih->rcSource.right=bih.biWidth;vih->rcSource.top=0;vih->rcSource.bottom=bih.biHeight;
+ inpin->getInputRcSource(&vih->rcSource);
vih->rcTarget=vih->rcSource;
vih->AvgTimePerFrame=inpin->avgTimePerFrame;
vih->bmiHeader=bih;
@@ -364,7 +364,7 @@

//DPRINTF(_l("AR getMediaType: %i:%i"),vih2->dwPictAspectRatioX,vih2->dwPictAspectRatioY);

- vih2->rcSource.left=0;vih2->rcSource.right=bih.biWidth;vih2->rcSource.top=0;vih2->rcSource.bottom=bih.biHeight;
+ inpin->getInputRcSource(&vih2->rcSource);
vih2->rcTarget=vih2->rcSource;
vih2->AvgTimePerFrame=inpin->avgTimePerFrame;
vih2->bmiHeader=bih;
Index: src/TffdshowVideoInputPin.cpp
===================================================================
--- src/TffdshowVideoInputPin.cpp (revision 3022)
+++ src/TffdshowVideoInputPin.cpp (working copy)
@@ -301,28 +301,33 @@

bool TffdshowVideoInputPin::init(const CMediaType &mt)
{
+ rcSourceIn.top = 0; rcSourceIn.left = 0;
bool dont_use_rtStop_from_upper_stream = false, truncated = false;
isInterlacedRawVideo=false;
if (mt.formattype==FORMAT_VideoInfo) {
VIDEOINFOHEADER *vih=(VIDEOINFOHEADER*)mt.pbFormat;
biIn.bmiHeader=vih->bmiHeader;
+ rcSourceIn = vih->rcSource;
pictIn.setSize(vih->bmiHeader.biWidth,abs(vih->bmiHeader.biHeight));
fixMPEGinAVI(biIn.bmiHeader.biCompression);
} else if (mt.formattype==FORMAT_VideoInfo2) {
VIDEOINFOHEADER2 *vih2=(VIDEOINFOHEADER2*)mt.pbFormat;
isInterlacedRawVideo=vih2->dwInterlaceFlags & AMINTERLACE_IsInterlaced;
biIn.bmiHeader=vih2->bmiHeader;
+ rcSourceIn = vih2->rcSource;
pictIn.setSize(vih2->bmiHeader.biWidth,abs(vih2->bmiHeader.biHeight));
pictIn.setDar(Rational(vih2->dwPictAspectRatioX,vih2->dwPictAspectRatioY));
DPRINTF(_l("TffdshowVideoInputPin::initVideo: darX:%i, darY:%i"),vih2->dwPictAspectRatioX,vih2->dwPictAspectRatioY);
fixMPEGinAVI(biIn.bmiHeader.biCompression);
} else if (mt.formattype==FORMAT_MPEGVideo) {
MPEG1VIDEOINFO *mpeg1info=(MPEG1VIDEOINFO*)mt.pbFormat;
+ rcSourceIn = mpeg1info->hdr.rcSource;
biIn.bmiHeader=mpeg1info->hdr.bmiHeader;biIn.bmiHeader.biCompression=FOURCC_MPG1;
pictIn.setSize(std::max(mpeg1info->hdr.rcSource.right,mpeg1info->hdr.bmiHeader.biWidth),std::max(mpeg1info->hdr.rcSource.bottom,mpeg1info->hdr.bmiHeader.biHeight));
} else if (mt.formattype==FORMAT_MPEG2Video) {
MPEG2VIDEOINFO *mpeg2info=(MPEG2VIDEOINFO*)mt.pbFormat;
biIn.bmiHeader=mpeg2info->hdr.bmiHeader;
+ rcSourceIn = mpeg2info->hdr.rcSource;
pictIn.setSize(std::max(mpeg2info->hdr.rcSource.right,mpeg2info->hdr.bmiHeader.biWidth),std::max(mpeg2info->hdr.rcSource.bottom,mpeg2info->hdr.bmiHeader.biHeight));
pictIn.setDar(Rational(mpeg2info->hdr.dwPictAspectRatioX,mpeg2info->hdr.dwPictAspectRatioY));
if (biIn.bmiHeader.biCompression==0 || biIn.bmiHeader.biCompression == 0x0038002d) {
@@ -342,6 +347,7 @@
memset(&biIn,0,sizeof(biIn));
sTheoraFormatBlock *oggFormat=(sTheoraFormatBlock*)mt.pbFormat;
biIn.bmiHeader.biCompression=FOURCC_THEO;
+ rcSourceIn.right = oggFormat->width; rcSourceIn.bottom = oggFormat->height;
pictIn.setSize(biIn.bmiHeader.biWidth=oggFormat->width,biIn.bmiHeader.biHeight=oggFormat->height);
pictIn.setDar(Rational(oggFormat->aspectNumerator,oggFormat->aspectDenominator));
biIn.bmiHeader.biBitCount=12;
@@ -371,6 +377,7 @@
biIn.bmiHeader.biWidth = get_bits(&gb, 16) << 4;
biIn.bmiHeader.biHeight = get_bits(&gb, 16) << 4;
pictIn.setSize(biIn.bmiHeader.biWidth,biIn.bmiHeader.biHeight);
+ rcSourceIn.right = biIn.bmiHeader.biWidth; rcSourceIn.bottom = biIn.bmiHeader.biHeight;

skip_bits(&gb, 24); /* frame width */
skip_bits(&gb, 24); /* frame height */
@@ -635,6 +642,13 @@
return *a1 && *a2?S_OK:S_FALSE;
}

+HRESULT TffdshowVideoInputPin::getInputRcSource(RECT *r)
+{
+ if (!r) return E_POINTER;
+ *r=rcSourceIn;
+ return S_OK;
+}
+
HRESULT TffdshowVideoInputPin::getInputDAR(unsigned int *a1,unsigned int *a2)
{
if (!a1 || !a2) return E_POINTER;
Index: src/TffdshowVideoInputPin.h
===================================================================
--- src/TffdshowVideoInputPin.h (revision 3022)
+++ src/TffdshowVideoInputPin.h (working copy)
@@ -75,6 +75,7 @@
HRESULT getAVIdimensions(unsigned int *x,unsigned int *y);
HRESULT getInputSAR(unsigned int *a1,unsigned int *a2);
HRESULT getInputDAR(unsigned int *a1,unsigned int *a2);
+ HRESULT getInputRcSource(RECT *r);
FOURCC getMovieFOURCC(void);
HRESULT getMovieSource(const TvideoCodecDec* *moviePtr);
HRESULT getFrameTime(unsigned int framenum,unsigned int *sec);
@@ -91,6 +92,7 @@

TffdshowDecVideoAllocator allocator;
BITMAPINFO biIn;TffPictBase pictIn;
+ RECT rcSourceIn;
REFERENCE_TIME avgTimePerFrame;
int sourceFlags;
bool waitForKeyframes();

haruhiko_yamagata
3rd July 2009, 12:20
Thank you for the patch.
I need to concentrate on my private life for the time being, please wait.

BillyWilly
5th July 2009, 22:16
I've been having a problem with this as well. If you have the latest build of Media Player Classic Cinema Edition, you can just go to View--options--playback--output. Change the video renderer to VMR9. That fixed it for me.

It worked for a little bit at least, but then it started up again. I would reccomend getting VLC player if you really want the problem fixed until we get a patch for it.

her34
26th July 2009, 07:59
here is a working fix but I can't assure that it doesn't break an other format, it needs to be reviewed by haruhiko_yamagata for example :p
Index: src/TffDecoder.cpp
===================================================================
--- src/TffDecoder.cpp (revision 3022)
+++ src/TffDecoder.cpp (working copy)
@@ -345,7 +345,7 @@
if (!vih) return E_OUTOFMEMORY;
ZeroMemory(vih,sizeof(VIDEOINFOHEADER));

- vih->rcSource.left=0;vih->rcSource.right=bih.biWidth;vih->rcSource.top=0;vih->rcSource.bottom=bih.biHeight;
+ inpin->getInputRcSource(&vih->rcSource);
vih->rcTarget=vih->rcSource;
vih->AvgTimePerFrame=inpin->avgTimePerFrame;
vih->bmiHeader=bih;
@@ -364,7 +364,7 @@

//DPRINTF(_l("AR getMediaType: %i:%i"),vih2->dwPictAspectRatioX,vih2->dwPictAspectRatioY);

- vih2->rcSource.left=0;vih2->rcSource.right=bih.biWidth;vih2->rcSource.top=0;vih2->rcSource.bottom=bih.biHeight;
+ inpin->getInputRcSource(&vih2->rcSource);
vih2->rcTarget=vih2->rcSource;
vih2->AvgTimePerFrame=inpin->avgTimePerFrame;
vih2->bmiHeader=bih;
Index: src/TffdshowVideoInputPin.cpp
===================================================================
--- src/TffdshowVideoInputPin.cpp (revision 3022)
+++ src/TffdshowVideoInputPin.cpp (working copy)
@@ -301,28 +301,33 @@

bool TffdshowVideoInputPin::init(const CMediaType &mt)
{
+ rcSourceIn.top = 0; rcSourceIn.left = 0;
bool dont_use_rtStop_from_upper_stream = false, truncated = false;
isInterlacedRawVideo=false;
if (mt.formattype==FORMAT_VideoInfo) {
VIDEOINFOHEADER *vih=(VIDEOINFOHEADER*)mt.pbFormat;
biIn.bmiHeader=vih->bmiHeader;
+ rcSourceIn = vih->rcSource;
pictIn.setSize(vih->bmiHeader.biWidth,abs(vih->bmiHeader.biHeight));
fixMPEGinAVI(biIn.bmiHeader.biCompression);
} else if (mt.formattype==FORMAT_VideoInfo2) {
VIDEOINFOHEADER2 *vih2=(VIDEOINFOHEADER2*)mt.pbFormat;
isInterlacedRawVideo=vih2->dwInterlaceFlags & AMINTERLACE_IsInterlaced;
biIn.bmiHeader=vih2->bmiHeader;
+ rcSourceIn = vih2->rcSource;
pictIn.setSize(vih2->bmiHeader.biWidth,abs(vih2->bmiHeader.biHeight));
pictIn.setDar(Rational(vih2->dwPictAspectRatioX,vih2->dwPictAspectRatioY));
DPRINTF(_l("TffdshowVideoInputPin::initVideo: darX:%i, darY:%i"),vih2->dwPictAspectRatioX,vih2->dwPictAspectRatioY);
fixMPEGinAVI(biIn.bmiHeader.biCompression);
} else if (mt.formattype==FORMAT_MPEGVideo) {
MPEG1VIDEOINFO *mpeg1info=(MPEG1VIDEOINFO*)mt.pbFormat;
+ rcSourceIn = mpeg1info->hdr.rcSource;
biIn.bmiHeader=mpeg1info->hdr.bmiHeader;biIn.bmiHeader.biCompression=FOURCC_MPG1;
pictIn.setSize(std::max(mpeg1info->hdr.rcSource.right,mpeg1info->hdr.bmiHeader.biWidth),std::max(mpeg1info->hdr.rcSource.bottom,mpeg1info->hdr.bmiHeader.biHeight));
} else if (mt.formattype==FORMAT_MPEG2Video) {
MPEG2VIDEOINFO *mpeg2info=(MPEG2VIDEOINFO*)mt.pbFormat;
biIn.bmiHeader=mpeg2info->hdr.bmiHeader;
+ rcSourceIn = mpeg2info->hdr.rcSource;
pictIn.setSize(std::max(mpeg2info->hdr.rcSource.right,mpeg2info->hdr.bmiHeader.biWidth),std::max(mpeg2info->hdr.rcSource.bottom,mpeg2info->hdr.bmiHeader.biHeight));
pictIn.setDar(Rational(mpeg2info->hdr.dwPictAspectRatioX,mpeg2info->hdr.dwPictAspectRatioY));
if (biIn.bmiHeader.biCompression==0 || biIn.bmiHeader.biCompression == 0x0038002d) {
@@ -342,6 +347,7 @@
memset(&biIn,0,sizeof(biIn));
sTheoraFormatBlock *oggFormat=(sTheoraFormatBlock*)mt.pbFormat;
biIn.bmiHeader.biCompression=FOURCC_THEO;
+ rcSourceIn.right = oggFormat->width; rcSourceIn.bottom = oggFormat->height;
pictIn.setSize(biIn.bmiHeader.biWidth=oggFormat->width,biIn.bmiHeader.biHeight=oggFormat->height);
pictIn.setDar(Rational(oggFormat->aspectNumerator,oggFormat->aspectDenominator));
biIn.bmiHeader.biBitCount=12;
@@ -371,6 +377,7 @@
biIn.bmiHeader.biWidth = get_bits(&gb, 16) << 4;
biIn.bmiHeader.biHeight = get_bits(&gb, 16) << 4;
pictIn.setSize(biIn.bmiHeader.biWidth,biIn.bmiHeader.biHeight);
+ rcSourceIn.right = biIn.bmiHeader.biWidth; rcSourceIn.bottom = biIn.bmiHeader.biHeight;

skip_bits(&gb, 24); /* frame width */
skip_bits(&gb, 24); /* frame height */
@@ -635,6 +642,13 @@
return *a1 && *a2?S_OK:S_FALSE;
}

+HRESULT TffdshowVideoInputPin::getInputRcSource(RECT *r)
+{
+ if (!r) return E_POINTER;
+ *r=rcSourceIn;
+ return S_OK;
+}
+
HRESULT TffdshowVideoInputPin::getInputDAR(unsigned int *a1,unsigned int *a2)
{
if (!a1 || !a2) return E_POINTER;
Index: src/TffdshowVideoInputPin.h
===================================================================
--- src/TffdshowVideoInputPin.h (revision 3022)
+++ src/TffdshowVideoInputPin.h (working copy)
@@ -75,6 +75,7 @@
HRESULT getAVIdimensions(unsigned int *x,unsigned int *y);
HRESULT getInputSAR(unsigned int *a1,unsigned int *a2);
HRESULT getInputDAR(unsigned int *a1,unsigned int *a2);
+ HRESULT getInputRcSource(RECT *r);
FOURCC getMovieFOURCC(void);
HRESULT getMovieSource(const TvideoCodecDec* *moviePtr);
HRESULT getFrameTime(unsigned int framenum,unsigned int *sec);
@@ -91,6 +92,7 @@

TffdshowDecVideoAllocator allocator;
BITMAPINFO biIn;TffPictBase pictIn;
+ RECT rcSourceIn;
REFERENCE_TIME avgTimePerFrame;
int sourceFlags;
bool waitForKeyframes();



will this patch be added to mpc-hc or does it have issues?

MatMaul
26th July 2009, 13:18
it's a patch for ffdshow and it has been commited 2 weeks ago (rev 3031).

clsid
26th July 2009, 13:59
The patch will only work if:
1) You are using the internal FLV splitter of MPC-HC. It does not work with the stand-alone splitter (even though its code is the same).
2) It only works with VMR-9, EVR, and Haali renderers.

MatMaul
26th July 2009, 14:13
1) You are using the internal FLV splitter of MPC-HC. It does not work with the stand-alone splitter (even though its code is the same).
that's weird, i'll have to inverstigate that.

Placio74
1st September 2009, 21:17
For me 'works' with external FLV Splitter and ffdshow, but ...

Media Player Classic - Homecinema: VMR9 or EVR

Media Player Classic 6.4.9.1 (rev 104): VMR9 + YUV mixing

BS.Player: EVR or VMR9 + Use YUV mixing mode with VMR renderer

Zoom Player: EVR or VMR9 + Enable YUV mixing on all VMR modes