[mythtv] HVEC frame counting broken
John P Poet
jppoet at gmail.com
Sun Sep 25 04:10:04 UTC 2022
On Sat, Sep 24, 2022 at 7:01 PM John P Poet <jppoet at gmail.com> wrote:
> On Sat, Sep 24, 2022 at 3:35 PM John P Poet <jppoet at gmail.com> wrote:
>
>> On Sat, Sep 24, 2022 at 3:38 AM John Pilkington <johnpilk222 at gmail.com>
>> wrote:
>>
>>> On 24/09/2022 02:18, John P Poet wrote:
>>> > On Fri, Sep 23, 2022 at 7:02 PM John P Poet <jppoet at gmail.com
>>> > <mailto:jppoet at gmail.com>> wrote:
>>> >
>>> > On Fri, Sep 23, 2022 at 6:31 PM Scott Theisen
>>> > <scott.the.elm at gmail.com <mailto:scott.the.elm at gmail.com>> wrote:
>>> >
>>> > On 9/23/22 18:59, David Engel wrote:
>>> > > On Fri, Sep 23, 2022 at 04:38:19PM -0600, John P Poet wrote:
>>> > >> On Fri, Sep 23, 2022 at 4:32 PM John P Poet
>>> > <jppoet at gmail.com <mailto:jppoet at gmail.com>> wrote:
>>> > >>
>>> > >>> I just upgraded from 39b850f1a9 to 06da3119d5 and
>>> > discovered that frame
>>> > >>> counting is now broken for ffmpeg/nvenc encoded HVEC. The
>>> > OSD indicates
>>> > >>> that the shows are twice as long as they really are.
>>> > >>>
>>> > >>> This weekend I will do a bisec to figure out which commit
>>> > did the damage,
>>> > >>> unless someone else already knows?
>>> > >>>
>>> > >> Sorry. Make that 26b2e76ae to 06da3119d5.
>>> > > It's probably the very, recent, ffmpeg merge.
>>> > >
>>> > > While you're in there, though, would you mind looking into
>>> the
>>> > > long-standing issue with mythcommflag --rebuild not working
>>> > on HEVC
>>> > > encoded files, or at least those encoded by HandBarke? :)
>>> >
>>> > A note on bisecting the recent FFmpeg merge:
>>> >
>>> a1868defe9c48c5ca53e1c5d26010a19ebd7db13..753a94ccb7a39ef66c6f8591e5784bf08a1b002e
>>> >
>>> > wont compile (inclusive..exclusive) fully because of how I
>>> split
>>> > the
>>> > commits.
>>> >
>>> > My harmonization of libavcodec/mpegts-mythtv.c is also in the
>>> > range you
>>> > gave. While each commit compiles, I didn't test functionality
>>> > of each
>>> > commit. But, even if the container is an MPEG-TS, I would also
>>> > suspect
>>> > the new version of FFmpeg.
>>> >
>>> > Could be related to (HEVC):
>>> > Playback of DVB recordings shows displayed time doubled · Issue
>>> > #548 ·
>>> > MythTV/mythtv · GitHub
>>> > https://github.com/MythTV/mythtv/issues/548
>>> > <https://github.com/MythTV/mythtv/issues/548>
>>> > ?
>>> >
>>> > Regards,
>>> >
>>> > Scott
>>> >
>>> >
>>> > Thank you Scott.
>>> >
>>> > What is bizaar is that I went back to 39b850f1a9 and it was still
>>> > doubling. I could have sworn that was the commit I was running
>>> > before! I ended up jumping back and back and back until I randomly
>>> > found 31ee7f9e64 to work correctly. So, now I have to say the
>>> > problem occured somewhere between 31ee7f9e64 and 3e802f9075. I will
>>> > try and narrow it down tomorrow.
>>> >
>>> >
>>> > Okay, so I was running 39b850f1a9 on my production machine and
>>> > 26b2e76ae on my development machine. I had not noticed the issue on my
>>> > dev machine.
>>> >
>>> > The problem does seem to be between 31ee7f9e64 and 3e802f9075. Looking
>>> > at the commits in that range, 40fb3cd09d and db93047399 seem like
>>> > possibilities. My production machine is now recording stuff for the
>>> > evening so I will test more tomorrow.
>>> >
>>> > John
>>>
>>> Issue #548 was reported as being years-old for some HEVC recordings. I
>>> had similar issues with just one of six DVB-T (mpeg2ts) multiplexes, now
>>> fixed by PR#610.
>>>
>>> mythcommflag --rebuild gave good frame counts for me, but gigem says it
>>> doesn't work with handbrake's HEVC encoding.
>>>
>>> It looks to me as if ffmpeg doesn't understand 'with field pictures'
>>> encoding.
>>>
>>
>> Doing a git bisect on my 10 year old production mythbackend machine is a
>> bit painful, but the result is that 7b2ac1eeb5 is the culprit. I see that
>> a6e1128e0f2 fixes a problem caused by 7b2ac1eeb5 but not this one. I will
>> work on narrowing down the problem.
>>
>
> HEVCParser::parseSPS is seriously broken with 7b2ac1eeb5. It does not
> even get the sps_id correct, let alone width, height or timescale. I have
> spent the last several hours trying to figure out exactly where the parsing
> goes wrong but have not tracked it down yet.
>
I really think that 7b2ac1eeb5 should be reverted. At least until a new
version can be written which doesn't break so much logic. I tried just
doing that against master, but myth's ffmpeg api has changed enough that it
is not straight forward...
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20220924/1974a18b/attachment.htm>
More information about the mythtv-dev
mailing list