How to change time into recording that preview is taken from?

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
mythmonsta
Newcomer
Posts: 2
Joined: Wed Jan 29, 2020 3:36 am
Australia

How to change time into recording that preview is taken from?

Post by mythmonsta » Wed Jan 29, 2020 3:56 am

How can I change the amount of time into the recordings that the preview image is taken from?

I sometimes record long sports events (~8h) and I find the preview is sometimes taken from hours in, which if I see it ruins half the event!! :x

I managed to google some stuff about PreviewPixmapOffset, but it seems that setting was deprecated a long time ago in favor of a "smarter" preview time generation algorithm.

A simple maximum time setting would be great. Then I could set it to 10 minutes or so, and then I would know that the preview image won't ruin the match for me.

I think I'm on mythtv28.

User avatar
bill6502
Developer
Posts: 1722
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: How to change time into recording that preview is taken from?

Post by bill6502 » Sun Aug 16, 2020 4:29 pm

I don't see a way to change it, but you can generate a new preview like this:

Code: Select all

mythpreviewgen --seconds 1 --chanid=1111 --starttime=20200621190000
Note, that if the preview has already been created (what you're trying to avoid) the
cache on all frontends needs to be deleted too. For the example above:

Code: Select all

rm ~/.mythtv/cache/thumbnails/-home-bill-.mythtv-cache-remotecache-1111_20200621190000.ts.png--418x238.png ~/.mythtv/cache/remotecache/1111_20200621190000.ts.png
If you're seeing previews that are "hours in", then I suspect that you've
bookmarked that location and a new preview was generated at that
spot.

Maybe a User Job would work here. https://www.mythtv.org/wiki/User_Jobs

User avatar
kmdewaal
Developer
Posts: 142
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: How to change time into recording that preview is taken from?

Post by kmdewaal » Sat Aug 29, 2020 5:02 pm

Looking at the code in previewgenerator.cpp around line 675

Code: Select all

        if (programDuration > 0)
        {
            captime = startEarly + (programDuration / 3);
        }
        if (captime < 0)
            captime = 600;
        captime += preroll;
        LOG(VB_GENERAL, LOG_INFO,
            QString("Preview at calculated offset (%1 seconds)").arg(captime));

the preview is taken from one third of the total program length. This means that with a six hour recording the preview will be taken after the first two hours. It is not too difficult to put an upper limit of e.g. 10 minutes on this. I do not know the history why the code is how it is but avoiding spoilers sound like a good reason to implement an upper limit. Does anybody have an opinion on this?

wesnewell
Senior
Posts: 669
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: How to change time into recording that preview is taken from?

Post by wesnewell » Sat Aug 29, 2020 6:04 pm

My opinion is I couldn't care less. You could completely do away with it and it wouldn't bother me. Most of the time it's a snapshot of a commercial.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.

User avatar
kmdewaal
Developer
Posts: 142
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: How to change time into recording that preview is taken from?

Post by kmdewaal » Mon Sep 21, 2020 9:19 pm

A simple maximum time setting would be great. Then I could set it to 10 minutes or so, and then I would know that the preview image won't ruin the match for me.
The preview is now taken from one third of the total program length with a maximum of 10 minutes.
I think I'm on mythtv28.
This is in v31 and in master, so this is a good reason to upgrade to v31.
Enjoy!

Post Reply