Mailing List Archive

Import Recorder and Peter's Script on the Wiki
Hello Everyone,

I have been messing around with my set up since moving from an HDPVR to a TBS 2603 HDMI IPTV Encoder. First I set up the system following this guide…
https://www.mythtv.org/wiki/IPTV_Encoders_as_a_Capture_Device <https://www.mythtv.org/wiki/IPTV_Encoders_as_a_Capture_Device>

While that was OK the system had weird quirks especially with Live TV. So then I moved on to an External recorder set up:
https://www.mythtv.org/wiki/ExternalRecorder <https://www.mythtv.org/wiki/ExternalRecorder>

I built my own script that acted like an External Recorder and sent FFMPEG’s output to STDOUT and this would work pretty well.. The Only thing weird was that occasionally the script would get stuck and consume 100% cpu and recordings would fail. I then upgraded my system to 29.1 from 28.1 and the script would not work at all anymore with ver 29.

So this led me to setting up my system as an Import recorder following Peter’s Wiki here:
https://www.mythtv.org/wiki/Import_recorder <https://www.mythtv.org/wiki/Import_recorder>

Per the Wiki I manually compiled and installed .30 and I can say this is by FAR the most reliable way for my system to work with the TBS IPTV encoder. I have had 0 recording failures with this method… However there are 3 small issues that if fixed would make this system 100%.

1. The import recorder names files as .mpg instead of .ts (I found the code and manually edited this and recompiled and now have the files named .ts instead of mpg)
And I know that this is mostly cosmetic, but the reason I started looking into this was because of #2.

2. Mythpreviewgen creates Previews at the wrong aspect ratios. I thought this was caused by the .mpg extension, but a little more detective work has shown what I believe to be the issue. I think this is caused by the import recorder not putting values in the Database for the recordings width x height and aspect ratios. When I looked at the code that kicked off the Previewgen, it looks like that these values are retrieved from the DB and sent to mythpreviewgen to create the previews. Again this is mostly a cosmetic issue.

3. Mythweb does not show the files as 720p in the recordings page. I also believe this is caused by #2 above.

Are there any devs willing to work on this last small issue? Or can point me int the direction of where to look to get started in making a patch for the import recorder to analyze the file and set the correct fields in the database? If this was done, this would be by far the most reliable recorder to use with these devices and make Myth work 100%.

Thoughts?

Greg
Re: Import Recorder and Peter's Script on the Wiki [ In reply to ]
On 04/13/2018 08:25 AM, Greg Thompson wrote:
> Hello Everyone,
>
> I have been messing around with my set up since moving from an HDPVR
> to a TBS 2603 HDMI IPTV Encoder. First I set up the system following
> this guide…
> https://www.mythtv.org/wiki/IPTV_Encoders_as_a_Capture_Device
>
> While that was OK the system had weird quirks especially with Live TV.
> So then I moved on to an External recorder set up:
> https://www.mythtv.org/wiki/ExternalRecorder
>
> I built my own script that acted like an External Recorder and sent
> FFMPEG’s output to STDOUT and this would work pretty well.. The Only
> thing weird was that occasionally the script would get stuck and
> consume 100% cpu and recordings would fail. I then upgraded my system
> to 29.1 from 28.1 and the script would not work at all anymore with
> ver 29.
>
> So this led me to setting up my system as an Import recorder following
> Peter’s Wiki here:
> https://www.mythtv.org/wiki/Import_recorder
>
> Per the Wiki I manually compiled and installed .30 and I can say this
> is by FAR the most reliable way for my system to work with the TBS
> IPTV encoder. I have had 0 recording failures with this method…
> However there are 3 small issues that if fixed would make this system
> 100%.
>
> 1. The import recorder names files as .mpg instead of .ts (I found the
> code and manually edited this and recompiled and now have the files
> named .ts instead of mpg)
> And I know that this is mostly cosmetic, but the reason I started
> looking into this was because of #2.
>
> 2. Mythpreviewgen creates Previews at the wrong aspect ratios. I
> thought this was caused by the .mpg extension, but a little more
> detective work has shown what I believe to be the issue. I think this
> is caused by the import recorder not putting values in the Database
> for the recordings width x height and aspect ratios. When I looked at
> the code that kicked off the Previewgen, it looks like that these
> values are retrieved from the DB and sent to mythpreviewgen to create
> the previews. Again this is mostly a cosmetic issue.
>
> 3. Mythweb does not show the files as 720p in the recordings page. I
> also believe this is caused by #2 above.
>
> Are there any devs willing to work on this last small issue? Or can
> point me int the direction of where to look to get started in making a
> patch for the import recorder to analyze the file and set the correct
> fields in the database? If this was done, this would be by far the
> most reliable recorder to use with these devices and make Myth work 100%.
>
> Thoughts?
>
> Greg
>
>
I am glad this works for you. It is based on a contribution from a user,
commit c1c127c 2017/11/15 : Import Recorder: Fix multiple problems.

I developed that script as a test of the contribution and to see if the
import recorder could work as a primary recorder, but I do not use it
myself.

If you look at that commit (git show c1c127c) you will get an idea of
where the import recorder code is found.

I use egrep to find things in the source. You just need to use a string
that will uniquely identify the piece of code you are looking for, like
the text  of an error message. I have my egrep in a script

egrep -a -r -n "--include=*.c" "--include=*.cpp" "--include=*.h"
"--exclude=moc_*" "$@" 2>&1 | less

Useful flags are -i for case-insensitive and -w for whole word search.

I suggest you open a ticket. You can add your patch for the file
extension and put together a change for the recording info issue you
found. Also if you have any improvements for the sample script please
update it or let me know. The sample glossed over some details such as
how to find the file name, and if you have something definitive we could
add that.

I will look at your contribution and commit if it looks OK.

Peter
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org