Mailing List Archive

Filenames of recordings: access from the desktop
I have several postprocessing scripts which I run from the desktop.
Some include box-specific workarounds to use the chanid_starttime.ext
format and some need the full file name including the storage group. I
use multiple tabs, so can usually modify an earlier command line.

But I have tried, in setting up, to keep an obvious relationship between
the chanid and the Logical Channel Number used in the EPG. This has
been becoming more difficult, with a recording made today from LCN 26
having a chanid of 35238 (shown by an I from the Watch Recordings page
in the MythCenter-Wide theme). I think I'll just have to live with it,
although it does make it harder to pick a given recording from a
file-manager display.

Before I try some other kludge, is there an easy way of displaying and
'copying' the full filename from a windowed Myth display? Or some other
approach? I guess that adding it to the 'Watch Recordings' screen
itself isn't going to improve the family experience...

FWIW the 'M > Playback > Playback Data' popup shows the full filename.

TIA

John P
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On Sun, 9 Jan 2022 16:25:02 +0000, you wrote:

>I have several postprocessing scripts which I run from the desktop.
>Some include box-specific workarounds to use the chanid_starttime.ext
>format and some need the full file name including the storage group. I
>use multiple tabs, so can usually modify an earlier command line.
>
>But I have tried, in setting up, to keep an obvious relationship between
>the chanid and the Logical Channel Number used in the EPG. This has
>been becoming more difficult, with a recording made today from LCN 26
>having a chanid of 35238 (shown by an I from the Watch Recordings page
>in the MythCenter-Wide theme). I think I'll just have to live with it,
>although it does make it harder to pick a given recording from a
>file-manager display.
>
>Before I try some other kludge, is there an easy way of displaying and
>'copying' the full filename from a windowed Myth display? Or some other
>approach? I guess that adding it to the 'Watch Recordings' screen
>itself isn't going to improve the family experience...
>
>FWIW the 'M > Playback > Playback Data' popup shows the full filename.
>
>TIA
>
>John P

Displaying the file name (but not the file location) is easy. From a
recording, I twice gives you a lot of information about a recording,
including its file name (the "basename") It is not really possible to
copy the file name from there though - mythfrontend turns the mouse
cursor off. In scripts attached to MythTV events, you can pass the
basename to the script using one of the builtin parameters.

I normally just do a database query to find a recording file:

MariaDB [mythconverg]> select
chanid,nzt(starttime),title,subtitle,left(description,20),season,episode,seriesid,programid,filesize/1024/1024/1024
as filesize,basename from recorded where title like '%schindler%'
order by starttime;
+--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
| chanid | nzt(starttime) | title | subtitle | left(description,20) | season | episode | seriesid | programid | filesize | basename |
+--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
| 10073 | 2021-01-27 22:43:00 | Oskar Schindler: The Man Behind The List | | The amazing story of | 0 | 0 | 128075076 | | 1.577273443341 | 10073_20210127094300.ts |
+--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
1 row in set (0.071 sec)

Then to find the file location, I use locate:

root@mypvr:~# locate 10073_20210127094300.ts
/mnt/rec1/recordings/10073_20210127094300.ts
/mnt/rec1/recordings/10073_20210127094300.ts.png

That only works if the recording is a day or so old - the location
database only gets updated once a day. You can force it to be updated
manually:

sudo updatedb

but that takes a while as it scans all the partitions mounted on your
system.

I believe there is some Python on the wiki that has an example of how
to find a recording file using the storage directories in the
database. I have never used it, as in my MythTV Python programs I am
moving lots of recording files, so I pre-build a database table giving
all the locations of the recordings before I start moving files. See
my mythsgu program if you want to do something like that:

http://www.jsw.gen.nz/mythtv/mythsgu
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 10/01/2022 09:12, Stephen Worthington wrote:
> On Sun, 9 Jan 2022 16:25:02 +0000, you wrote:
>
>> I have several postprocessing scripts which I run from the desktop.
>> Some include box-specific workarounds to use the chanid_starttime.ext
>> format and some need the full file name including the storage group. I
>> use multiple tabs, so can usually modify an earlier command line.
>>
>> But I have tried, in setting up, to keep an obvious relationship between
>> the chanid and the Logical Channel Number used in the EPG. This has
>> been becoming more difficult, with a recording made today from LCN 26
>> having a chanid of 35238 (shown by an I from the Watch Recordings page
>> in the MythCenter-Wide theme). I think I'll just have to live with it,
>> although it does make it harder to pick a given recording from a
>> file-manager display.
>>
>> Before I try some other kludge, is there an easy way of displaying and
>> 'copying' the full filename from a windowed Myth display? Or some other
>> approach? I guess that adding it to the 'Watch Recordings' screen
>> itself isn't going to improve the family experience...
>>
>> FWIW the 'M > Playback > Playback Data' popup shows the full filename.
>>
>> TIA
>>
>> John P
>
> Displaying the file name (but not the file location) is easy. From a
> recording, I twice gives you a lot of information about a recording,
> including its file name (the "basename") It is not really possible to
> copy the file name from there though - mythfrontend turns the mouse
> cursor off. In scripts attached to MythTV events, you can pass the
> basename to the script using one of the builtin parameters.
>
> I normally just do a database query to find a recording file:
>
> MariaDB [mythconverg]> select
> chanid,nzt(starttime),title,subtitle,left(description,20),season,episode,seriesid,programid,filesize/1024/1024/1024
> as filesize,basename from recorded where title like '%schindler%'
> order by starttime;
> +--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
> | chanid | nzt(starttime) | title | subtitle | left(description,20) | season | episode | seriesid | programid | filesize | basename |
> +--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
> | 10073 | 2021-01-27 22:43:00 | Oskar Schindler: The Man Behind The List | | The amazing story of | 0 | 0 | 128075076 | | 1.577273443341 | 10073_20210127094300.ts |
> +--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
> 1 row in set (0.071 sec)
>
> Then to find the file location, I use locate:
>
> root@mypvr:~# locate 10073_20210127094300.ts
> /mnt/rec1/recordings/10073_20210127094300.ts
> /mnt/rec1/recordings/10073_20210127094300.ts.png
>
> That only works if the recording is a day or so old - the location
> database only gets updated once a day. You can force it to be updated
> manually:
>
> sudo updatedb
>
> but that takes a while as it scans all the partitions mounted on your
> system.
>
> I believe there is some Python on the wiki that has an example of how
> to find a recording file using the storage directories in the
> database. I have never used it, as in my MythTV Python programs I am
> moving lots of recording files, so I pre-build a database table giving
> all the locations of the recordings before I start moving files. See
> my mythsgu program if you want to do something like that:
>
> http://www.jsw.gen.nz/mythtv/mythsgu




Thank you Stephen. I had seen your use of 'locate' earlier but hadn't
tried it; I thought it looked like overkill, but maybe it learns over
time. One of my scripts uses parts of dvbradioexport.pl, from the
wiki, to unpick the Storage Groups; again, my integration lacks polish,
and would need a re-work for more general use. The second 'info' screen
only provides 'Default' for the SG, which seems unhelpful. I'll see if
I can make anything more of the API stuff.

{{{

[john@HP_Box ~]$ cat ~/showSGs.sh
#!/bin/bash

# list default SG directories. See
http://irc.mythtv.org/ircLog/channel/6/2021-10-20

# see also curl -H "Accept: application/json" --silent
http://127.0.0.1:6544/Myth/GetStorageGroupDirs | jq
.StorageGroupDirList.StorageGroupDirs

# but using grep seems more direct to get the required output

curl -H "Accept: application/json" --silent
http://127.0.0.1:6544/Myth/GetStorageGroupDirs | jq . | grep -A2 Default
| grep Dir

exit

[john@HP_Box ~]$ ~/showSGs.sh
"DirName": "/home/john/SGs/RcSG1",
"DirName": "/home/john/SGs/RcSG2",
"DirName": "/home/john/SGs/RcSG3",
[john@HP_Box ~]$

}}}
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 01/09/2022 11:25 AM, John Pilkington wrote:
> I have several postprocessing scripts which I run from the desktop.
> Some include box-specific workarounds to use the chanid_starttime.ext
> format and some need the full file name including the storage group.
> I use multiple tabs, so can usually modify an earlier command line.
>
> But I have tried, in setting up, to keep an obvious relationship
> between the chanid and the Logical Channel Number used in the EPG.
> This has been becoming more difficult, with a recording made today
> from LCN 26 having a chanid of 35238 (shown by an I from the Watch
> Recordings page in the MythCenter-Wide theme). I think I'll just have
> to live with it, although it does make it harder to pick a given
> recording from a file-manager display.
>
> Before I try some other kludge, is there an easy way of displaying and
> 'copying' the full filename from a windowed Myth display? Or some
> other approach? I guess that adding it to the 'Watch Recordings'
> screen itself isn't going to improve the family experience...
>
> FWIW the 'M > Playback > Playback Data' popup shows the full filename.

You can use mythlink.pl (https://www.mythtv.org/wiki/Mythlink.pl ) to
create links with useful/recognizable/customized-for-your-scripts names,
then use those useful names to get the full path to the actual recording
file with:

readlink <link_name>

Mike
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 1/11/22 11:16 AM, Michael T. Dean wrote:
> On 01/09/2022 11:25 AM, John Pilkington wrote:
>> I have several postprocessing scripts which I run from the desktop.
>> Some include box-specific workarounds to use the chanid_starttime.ext
>> format and some need the full file name including the storage group. 
>> I use multiple tabs, so can usually modify an earlier command line.
>>
>> But I have tried, in setting up, to keep an obvious relationship
>> between the chanid and the Logical Channel Number used in the EPG. 
>> This has been becoming more difficult, with a recording made today
>> from LCN 26 having a chanid of 35238 (shown by an I from the Watch
>> Recordings page in the MythCenter-Wide theme).  I think I'll just
>> have to live with it, although it does make it harder to pick a given
>> recording from a file-manager display.
>>
>> Before I try some other kludge, is there an easy way of displaying
>> and 'copying' the full filename from a windowed Myth display?  Or
>> some other approach?  I guess that adding it to the 'Watch
>> Recordings' screen itself isn't going to improve the family
>> experience...
>>
>> FWIW the 'M > Playback > Playback Data' popup shows the full filename.
>
> You can use mythlink.pl (https://www.mythtv.org/wiki/Mythlink.pl ) to
> create links with useful/recognizable/customized-for-your-scripts
> names, then use those useful names to get the full path to the actual
> recording file with:
>
> readlink <link_name>
>
> Mike
> _______________________________________________
> 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
Last time I tried to get Mythlink.pl working, I failed. If someone has
this working, I like to learn.

Regards
Ramesh

_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 11/01/2022 17:16, Michael T. Dean wrote:
> On 01/09/2022 11:25 AM, John Pilkington wrote:
<snip>
>>
>> Before I try some other kludge, is there an easy way of displaying and
>> 'copying' the full filename from a windowed Myth display?  Or some
>> other approach?  I guess that adding it to the 'Watch Recordings'
>> screen itself isn't going to improve the family experience...
>>
>> FWIW the 'M > Playback > Playback Data' popup shows the full filename.
>
> You can use mythlink.pl (https://www.mythtv.org/wiki/Mythlink.pl  ) to
> create links with useful/recognizable/customized-for-your-scripts names,
> then use those useful names to get the full path to the actual recording
> file with:
>
> readlink <link_name>
>
> Mike

Yes, thanks Mike. Having recently recommended mythlink and cp -L here
I should have made that connection. In GUI mode I would probably read
the link destination from the file manager screen, or copy from its
'Properties' popup, but mythlink + readlink looks as if it could be more
scriptable. I'll look at the mythlink wiki again. :-)

John
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 11/01/2022 21:57, John Pilkington wrote:
> On 11/01/2022 17:16, Michael T. Dean wrote:
>> On 01/09/2022 11:25 AM, John Pilkington wrote:
> <snip>
>>>
>>> Before I try some other kludge, is there an easy way of displaying
>>> and 'copying' the full filename from a windowed Myth display?  Or
>>> some other approach?  I guess that adding it to the 'Watch
>>> Recordings' screen itself isn't going to improve the family
>>> experience...
>>>
>>> FWIW the 'M > Playback > Playback Data' popup shows the full filename.
>>
>> You can use mythlink.pl (https://www.mythtv.org/wiki/Mythlink.pl  ) to
>> create links with useful/recognizable/customized-for-your-scripts
>> names, then use those useful names to get the full path to the actual
>> recording file with:
>>
>> readlink <link_name>
>>
>> Mike
>
> Yes, thanks Mike.  Having recently recommended mythlink  and cp -L here
> I should have made that connection. In GUI mode I would probably read
> the link destination from the file manager screen, or copy from its
> 'Properties' popup, but mythlink + readlink looks as if it could be more
> scriptable.  I'll look at the mythlink wiki again. :-)
>


There seems to be no need to do any new scripting. In a Plasma (KDE)
desktop, this works:

Run mythlink.pl to put links into a folder.

Open that folder with a file manager; I still use konqueror.
Right-click on the recording to be processed and select 'Properties'.
Right click on the contents of the 'Points To:' box, Select All, and Copy.

In a konsole (terminal) tab, recall (Ctrl/R or UpArrow) a command line
similar to the one you want. Erase the old file details and Paste in
the ones from the link.

Run the new command.

> John
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 01/11/2022 12:27 PM, Ram Ramesh wrote:
> Last time I tried to get Mythlink.pl working, I failed. If someone has
> this working, I like to learn.

Any details on what's not working (error messages, behavior, ...)?

Mike
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 01/11/2022 04:57 PM, John Pilkington wrote:
> Having recently recommended mythlink and cp -L here

In that thread, I was about to recommend mythlink and cp -L (which is
what I do to copy recordings to my laptop) until I saw you already had. :)

Mike
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 12/01/2022 11:09, John Pilkington wrote:
> On 11/01/2022 21:57, John Pilkington wrote:
>> On 11/01/2022 17:16, Michael T. Dean wrote:
>>> On 01/09/2022 11:25 AM, John Pilkington wrote:
>> <snip>
>>>>
>>>> Before I try some other kludge, is there an easy way of displaying
>>>> and 'copying' the full filename from a windowed Myth display?  Or
>>>> some other approach?  I guess that adding it to the 'Watch
>>>> Recordings' screen itself isn't going to improve the family
>>>> experience...
>>>>
>>>> FWIW the 'M > Playback > Playback Data' popup shows the full filename.
>>>
>>> You can use mythlink.pl (https://www.mythtv.org/wiki/Mythlink.pl  )
>>> to create links with useful/recognizable/customized-for-your-scripts
>>> names, then use those useful names to get the full path to the actual
>>> recording file with:
>>>
>>> readlink <link_name>
>>>
>>> Mike
>>
>> Yes, thanks Mike.  Having recently recommended mythlink  and cp -L
>> here I should have made that connection. In GUI mode I would probably
>> read the link destination from the file manager screen, or copy from
>> its 'Properties' popup, but mythlink + readlink looks as if it could
>> be more scriptable.  I'll look at the mythlink wiki again. :-)
>>
>
>
> There seems to be no need to do any new scripting.  In a Plasma (KDE)
> desktop, this works:
>
> Run mythlink.pl to put links into a folder.
>
> Open that folder with a file manager; I still use konqueror. Right-click
> on the recording to be processed and select 'Properties'. Right click on
> the contents of the 'Points To:' box, Select All, and Copy.
>
> In a konsole (terminal) tab, recall (Ctrl/R or UpArrow) a command line
> similar to the one you want.  Erase the old file details and Paste in
> the ones from the link.
>
> Run the new command.
>

That works, but needs mouse gymnastics. Here's an alternative.

For some time I have used a lightly customised MythCenter-wide theme,
not always kept fully compatible with the current version. Now master
has a bigger update and I had another look.

I think I can get what I want if I make a simple change in
recordings-ui.xml, replacing

{{{

<template>%startdate%%| startyear%, %starttime% </template>

by

<template>%recstartdate%%| startyear%, %recstarttime% - %recendtime%
%recordedid% </template>

}}}

although the date/year sequence has often given me slightly strange
results that probably depend on my specified short-date format.

It's easy to tweak this and I will experiment some more, but I wonder if
it, or at least the inclusion of the RecordedId, might be considered as
an official change?


> > John P
_______________________________________________
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
Re: Filenames of recordings: access from the desktop [ In reply to ]
On 16/01/2022 11:19, John Pilkington wrote:

> For some time I have used a lightly customised MythCenter-wide theme,
> not always kept fully compatible with the current version.  Now master
> has a bigger update and I had another look.
>

This works for me now. It's a little cramped but fits into the space
allocated.

> {{{

<textarea name="timedate" from="basetextarea">
<area>295,444,415,30</area>
<align>hcenter</align>

<!-- This is the current template from GitHub -->

<!-- <template>%startdate%%| startyear%, %starttime% </template> -->

<!-- Add actual end time to the display and change start time to be
actual, not scheduled time.
Then squeeze in more, with chanid and recordedid shown too.
The formats are set in Appearance > Localisation
-->

<template>%recstartdate% %startyear%
%recstarttime%-%recendtime% %chanid% %recordedid%</template>
</textarea>

> }}}
>
> although the date/year sequence has often given me slightly strange
> results that probably depend on my specified short-date format.
>
> It's easy to tweak this and I will experiment some more, but I wonder if
> it, or at least the inclusion of the RecordedId, might be considered as
> an official change?
>
>
> >  > John P

_______________________________________________
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