Opened 18 years ago

Closed 16 years ago

#2498 closed defect (fixed)

MythTV doesn't play mpeg2 with repeated fields correctly

Reported by: Mark.Buechler@… Owned by: Janne Grunau
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

There are a handfull of channels I view which ever since I started using Myth haven't played correctly. Video and audio start out synced then video slows down and becomes unsynced for several seconds then caches up quickly.

I can provide a video sample if needed.

Attachments (1)

error.zip (47.4 KB) - added by Mark.Buechler@… 18 years ago.
From the frontend.. sync errors repeat continously.

Download all attachments as: .zip

Change History (12)

Changed 18 years ago by Mark.Buechler@…

Attachment: error.zip added

From the frontend.. sync errors repeat continously.

comment:1 Changed 17 years ago by Janne Grunau

Closed #2737 as duplicate

comment:2 Changed 17 years ago by DannyCan@…

Version: 0.20head

I believe this is a problem with support for frame repeats which is discussed here http://forum.doom9.org/showthread.php?t=119242&page=2[[BR]]

Here is a quote from the forum:

harissa is right. I think it is something else, something real simple.[[BR]]
I believe that the RFF flags are being used for frame repeats rather than field repeats.[[BR]]
That makes perfectly good sense given that the output is supposed to be progressive: 720P.[[BR]]
That causes a big problem for DGMPGDec, because it supports only field repeats.[[BR]]
I'll have to add support for frame repeats.

I will verify my theory in the debugger today but it's the only plausible theory that fits the known facts.[[BR]]
My successful encode working with that theory also tends to corroborate it.[[BR]]
But I want to see the MPEG syntax in the debugger.

As to why there are patches of frame repeats mixed with non-repeated sections, I do not know, but at least I know how to fix the D2V process for streams like these.

EDIT: Theory confirmed in the debugger (RFF plus progressive_sequence = 1)!

I think it's some sort of new thing broadcasters are using for some reason so support seems to be limited at this point.
However, after reading the topic I have been able to use VirtualDub?-MPEG2 to convert those recordings to Xvid without any sync issues.

comment:3 Changed 17 years ago by danielk

Resolution: invalid
Status: newclosed

This is something that has to be fixed in ffmpeg.

Have you checked that this isn't fixed there yet?

When this is fixed in ffmpeg please reopen this ticket; we'll sync it into MythTV's copy of ffmpeg.

comment:4 Changed 17 years ago by DannyCan@…

Resolution: invalid
Status: closedreopened

I just compiled/installed the latest mplayer snapshot 2007-01-16 "dev-SVN-r21937-3.4.4" on my MythTV box and the recordings in question seem to playback perfectly.
Since both mplayer and mythtv use ffmpeg's mpeg2 codec,
I would assume updating the mpeg2 codec would fix this issue.
So I guess that would mean that it's time to sync up to the latest ffmpeg?
If this isn't enough I'm not sure what to look for because I don't really understand what happened to the video.
The ffmpeg change log is located here in case you know what to look for: http://ffmpeg.mplayerhq.hu/changelog.html

comment:5 in reply to:  4 Changed 17 years ago by Janne Grunau

Replying to DannyCan@gmail.com:

I just compiled/installed the latest mplayer snapshot 2007-01-16 "dev-SVN-r21937-3.4.4" on my MythTV box and the recordings in question seem to playback perfectly.

Have you used -demuxer lavf with mplayer?

Since both mplayer and mythtv use ffmpeg's mpeg2 codec,

That not true. mplayer has its own demuxer and uses by default libmpeg2.

I would assume updating the mpeg2 codec would fix this issue.

No, it's not an issue in the mpeg codec but a demuxer bug. My ffplay from 2006-10-16 plays the sample from ticket #2737 fine but my player snapshot from the same date plays the video too fast with -demuxer lavf. So I'm not sure if a ffmpeg resync will help.

comment:6 Changed 17 years ago by Janne Grunau

Not a ffmpeg issue. ffplay from 6051 (our last resync) works fine.

comment:7 Changed 17 years ago by DannyCan@…

Well janne, I'm at a loss because I compiled the latest ffmpeg on my desktop and ffplay played the movie fine too. So it must be something else.
Or maybe the ffmpeg demuxer DOES have a problem with this and the effect isn't being noticed outside of mythtv somehow.
I hope someone finds the problem before the next release.

comment:8 Changed 17 years ago by Janne Grunau

Milestone: unknown0.21
Owner: changed from Isaac Richards to Janne Grunau
Status: reopenednew

after ffmpeg resync to r7591 the problem remains but the video is only 3-4 frames ahead.

comment:9 Changed 17 years ago by DannyCan@…

So you tested the latest ffmpeg using ffplay?
mru from the #ffmpeg irc channel said this:

frame repeats are for the decoder to handle, not the demuxer
iirc it sets a flag in the returned AVFrame
the calling app can deal with it as it wishes

So the problem is with another part of mythtv.

comment:10 Changed 17 years ago by Janne Grunau

Summary: DVB: 720p mpeg2 doesn't play correctlyMythTV doesn't play mpeg2 with repeated fields correctly

comment:11 Changed 16 years ago by Janne Grunau

Resolution: fixed
Status: newclosed

remaining issue seems to be the same as in #4621, closing this ticket as fixed

Note: See TracTickets for help on using tickets.