[mythtv] HVEC frame counting broken

Scott Theisen scott.the.elm at gmail.com
Mon Sep 26 01:16:27 UTC 2022


On 9/25/22 18:48, John P Poet wrote:
> On Sun, Sep 25, 2022 at 3:16 PM Scott Theisen 
> <scott.the.elm at gmail.com> wrote:
>
>
>
>     On 9/25/22 12:42, John P Poet wrote:
>>     On Sun, Sep 25, 2022 at 10:40 AM John P Poet <jppoet at gmail.com>
>>     wrote:
>>
>>         On Sun, Sep 25, 2022 at 10:33 AM Scott Theisen
>>         <scott.the.elm at gmail.com> wrote:
>>
>>             On 9/25/22 11:43, John P Poet wrote:
>>>
>>>
>>>             Thank you Scott. I just uploaded a HEVC sample to
>>>             dropbox. It should be shared with you.
>>
>>             I have the sample.
>>
>>>
>>>             Without 7b2ac1eeb5, HEVCParser::parseSPS detects the
>>>             sps_id: 0
>>>             width, height: 1920x1088
>>>             unitsInTick / timeScale: 166817 / 10000000
>>>
>>>             With 7b2ac1eeb5, HEVCParser::parseSPS the spd_id, width
>>>             and height are garbage and the unitsinTick / timeScale
>>>             are never decoded -- vps_extension_flag is zero.
>>>
>>>             My best guess is that there is an alignment issue and
>>>             the BitReader that is being passed into
>>>             HEVCParser::parseSPS is not pointing at the correct
>>>             position.
>>>
>>
>>             OK, but how are you getting the code to execute on the
>>             sample?  mythcommflag --rebuild something?  Adding to
>>             Videos and scanning for changes?
>>
>>             Thanks,
>>
>>             Scott
>>
>>
>>         I am using an ExternalRecorder
>>         (https://github.com/jpoet/Magewell2TS). Using the
>>         mythfilerecorder ExternalRecorder that is packaged with Myth
>>         should provide the same result. I am pretty sure that
>>         `mythcommflag --rebuild` results in a different code path and
>>         I have not tried it.
>>
>>         If you have trouble setting up mythfilerecorder I will do
>>         that this afternoon and then send you instructions.
>>
>>
>>     Actually, I won't. I keep forgetting that I don't currently have
>>     access to my development machine and my production machine will
>>     be recording football today. So, that would have to wait until
>>     tomorrow sometime.
>>
>>     John
>
>     I couldn't figure out how to get mythfilerecorder to work, so
>     instructions from you, or anyone, would be appreciated.
>
>     Scott
>
>
> I cannot test this until tomorrow, but this should work...
>
> Put the attached config files in /home/mythtv/etc/ . Modify 
> externfile.conf so it can find the sample hevc file.
>
> Create a new "capture card" of type "External (blackbox) Recorder". 
> For the command path use "/usr/local/bin/mythexternrecorder --conf 
> /home/mythtv/etc/externfile.conf". Modify that if your 
> mythexternrecorder is not in /usr/local/bin.
>
> You may want/need to create a new source for this capture card.
>
> You can do a "channel scan" for the new input and it will pick up the 
> test channel defined in channels.conf. You can then create a manual 
> record for that channel and it will effectively "record" the hevc 
> sample file.
>
>

Thanks, that worked, adjusting the paths to the real values. However, it 
loops the input file and creates recordings far longer than the 
specified manual recording duration.

I can confirm that parsing is broken. :(

Let me know if you want me to open a pull request reverting the change 
to BitReader, while I investigate.

Thanks,

Scott

PS--Unrelated, but apparently "HEVC" is not a valid registration 
descriptor according to MythTV:
```
2022-09-25 20:57:29.612931 D [17701/17792] ExternSH 
mpegstreamdata.cpp:463 (CreatePMTSingleProgram) - 
MPEGStream[8](0x7f2f840261b0): Program Map Section
   PSIP tableID(0x2) length(35) extension(0x1)
        version(0) current(1) section(0) last_section(0)
        pnum(1) pid(0x1000) pcrpid(0x100)
   Stream #0 pid(0x100) type(0x24 video-h265)
     Registration Descriptor: 'HEVC' Unknown, see 
http://www.smpte-ra.org/mpegreg/mpegreg.html
   Stream #1 pid(0x101) type(0x81 audio-ac3)
     Registration Descriptor: 'AC-3' ATSC audio stream A/52
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20220925/abef4b43/attachment.htm>


More information about the mythtv-dev mailing list