Opened 14 years ago

Closed 12 years ago

#1087 closed defect (worksforme)

Deinterlace doesn't work (latest svn)

Reported by: james.muscat@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version:
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

Using svn revision 8675 - none of the deinterlacing options actually deinterlace the DVB picture. I still get interlacing "line" effects on moving elements in picture. Also tried changing MPEG2 decoder between "Standard" and "libmpeg2" but still no deinterlacing! Worked in 0.18.1 release but not in svn.

Change History (9)

comment:1 Changed 14 years ago by Isaac Richards

Resolution: worksforme
Status: newclosed

Works fine here.

comment:2 Changed 12 years ago by iva2k@…

Resolution: worksforme
Status: closedreopened

I have the same problem with DVB & deinterlace with latest code. My details:

AMD64, Ubuntu 7.04 desktop

Card: ATSC-115 by KWorld, saa7134 + nxt2004, 104c:8024 Multimedia controller: Philips Semiconductors SAA7133/SAA7135 Video Broadcast Decoder (rev d1)

Myth rev: SVN trunk (checked out 6/29/07, 0.20++?)

DVB standard: Comcast QAM-256.

Deinterlace is OK with all analog channels and all deinterlace algorithms. In DVB, all deinterlace algorithms make no difference - moving images are jagged. The card is hybrid, if it makes any difference.

I will perform any log capture attachments if someone emails me with suggestions of which ones are needed.

comment:3 Changed 12 years ago by marklmurray@…

I have the same problem. I have 3 PVR 150's, and de-interlacing works fine for them, but my Avermedia A180 dvb card won't respond to any de-interlacing either (especially noticable on panning shots).

Myth rev: 0.20.1+fixes13902-0 DVB standard: Comcast QAM-256 Card: Multimedia controller: Avermedia A180 ,Philips Semiconductors SAA7133/SAA7135 Video Broadcast Decoder (rev d1).

Just to add another datapoint...

comment:4 Changed 12 years ago by danielk

Resolution: worksforme
Status: reopenedclosed

I just checked and this still works here. Please ask for help setting up MythTV on the users' mailing list, after searching for and trying the common solutions such as setting your deinterlacing method to something that works for your hardware configuration.

comment:5 Changed 12 years ago by iva2k@…

Resolution: worksforme
Status: closedreopened

First, one clarification - deinterlacing is missing on most of standard definition DVB channels that I can receive from Comcast. HD channels show OK.

Second, to follow up, I've done some digging of the logs, and here is an interesting snippet (which goes on and on when watching DVB) from mythfrontend -v playback:

2007-07-18 00:55:38.226 Enabled deinterlacing 2007-07-18 00:55:38.254 Avg read interval was 198 msec. 256K block size 2007-07-18 00:55:38.507 NVP: progressive frame seen after 10 interlaced frames 2007-07-18 00:55:38.551 NVP: interlaced frame seen after 1 progressive frames 2007-07-18 00:55:39.040 NVP: progressive frame seen after 14 interlaced frames 2007-07-18 00:55:39.072 NVP: interlaced frame seen after 1 progressive frames 2007-07-18 00:55:39.588 NVP: progressive frame seen after 15 interlaced frames 2007-07-18 00:55:39.688 Set video sync frame interval to 33366 2007-07-18 00:55:39.688 Disabled deinterlacing 2007-07-18 00:55:39.765 NVP: interlaced frame seen after 7 progressive frames 2007-07-18 00:55:39.788 Set video sync frame interval to 33366 2007-07-18 00:55:39.788 Enabled deinterlacing 2007-07-18 00:55:40.121 NVP: progressive frame seen after 12 interlaced frames 'video_output' mean = '34089.33', std. dev. = '14141.37', fps = '29.33' 2007-07-18 00:55:40.187 Set video sync frame interval to 33366 2007-07-18 00:55:40.187 Disabled deinterlacing

It means that deinterlacing algorithm is there, its just being toggled back and forth all the time, which is observed as lack of deinterlacing. I can post recording file if you want to look into it.

Here's some code digging: void NuppelVideoPlayer::AutoDeint?(VideoFrame? *frame) { ...

if (frame->interlaced_frame) {

if (m_scan_tracker < 0) {

VERBOSE(VB_PLAYBACK, LOC + "interlaced frame seen after "

<< abs(m_scan_tracker) << " progressive frames");

m_scan_tracker = 0;

} m_scan_tracker++;

} else {

if (m_scan_tracker > 0) {

VERBOSE(VB_PLAYBACK, LOC + "progressive frame seen after "

<< m_scan_tracker << " interlaced frames");

m_scan_tracker = 0;

} m_scan_tracker--;

}

if ((m_scan_tracker % 400) == 0) {

QString type = (m_scan_tracker < 0) ? "progressive" : "interlaced"; VERBOSE(VB_PLAYBACK, LOC + QString("%1 %2 frames seen.")

.arg(abs(m_scan_tracker)).arg(type));

}

int min_count = (ringBuffer->isDVD()) ? 0 : 2; if (abs(m_scan_tracker) <= min_count)

return;

SetScanType?((m_scan_tracker > min_count) ? kScan_Interlaced : kScan_Progressive); m_scan_locked = false;

}

... according to the log, SetScanType?() is getting toggled every 40-50 frames.

So here's more quick code digging. frame->interlaced_frame can be set to 0 only in avformatdecoder.cpp, mpegvideo.cpp or png.c (without yet knowing which one is actually called). Apparently, they always decode the flag from the content frame-by-frame. It appears that Comcast sends "progressive" frames once in a while. I believe that there are no true progressive frames if the channel is reported as interlaced, since industry has decided to always broadcast interlaced streams in order to support all the millions of analog TVs out there (which do not have capability to interlace the picture) and make settop boxes as simple (and cheap) as possible. For some reason this decision carries into HD broadcasts as well. In light of this, periodic progressive flag can be a bug in Comcast (or their supplier's) codecs or intentional encoding misrepresentation, if it is not result of some bug in the decoders.

I looked at the picture with compiled "return;" before SetScanType?() in the above code, and it looks deinterlaced OK all the time and appears without any of artifacts attributable to deinterlacing progressive frames. I will keep it this way in my sandbox, untill someone from developers come up with a better solution that will hopefully work for everone.

In the presented case it seems reasonable to have something like "ignore periodic DVB progressive flag" next to "deinterlace" option in playback settings or better one for each DVB channel, which will turn off this insane toggling. I'm not trying to open a discussion here, but realities of life prompt for fixes of somebody else's screwups pretty often. This will be one such fix.

I still have gripes with other deinterlacing issues - (1) pause picture is interlaced / jagged, while it should not be, (2) deinterlacing option should be available for recording - it will allow much lighter hardware for MythTV clients to show HD content. But these are for other tickets.

comment:6 Changed 12 years ago by danielk

Resolution: worksforme
Status: reopenedclosed

Again, please ask for help on the mailing list, what you are asking for has already been implemented you just need to enable it.

comment:7 Changed 12 years ago by anonymous

Can you be more specific about what has been implemented to resolve this problem? Sending me to mailing list is not much help. I personally will be able to find an answer, but think of all other people that will have the same problem, read this ticket and have no resolution. On another hand, if rework is posted here, it will save tons of time for all and make their experience with MythTV better.

comment:8 Changed 12 years ago by iva2k@…

Resolution: worksforme
Status: closedreopened

I can post recording file if you want to look into it.

I offered in my post, which was probably too long for anyone to read ;-)

Again, it is a problem with NuppelVideoPlayer::AutoDeint?() being fooled by bad flags coming in the stream. However, there is no code in trunk that disables auto deinterlace and forces deinterlace. AutoDeint? functionality is integral part of the design.

Sorry, user mailing list won't help anyone if even devs don't know how it works (or not).

Or, perhaps it is better to open new ticket to deal with Comcast DVB?

comment:9 Changed 12 years ago by danielk

Resolution: worksforme
Status: reopenedclosed
Ticket locked: set

trac is not a discussion forum.

Note: See TracTickets for help on using tickets.