Script to export Mythtv recordings to a folder or NAS

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

Moderator: Forum Moderators

Skinah2
Newcomer
Posts: 7
Joined: Fri Jan 20, 2017 3:57 am
Switzerland

Re: Script to export Mythtv recordings to a folder or NAS

Post by Skinah2 »

axel77 wrote: It's actually pretty surprising that the biggest difference isn't in the resolution, but in the compression format.
Yes that is what I found, also I found that different channels used a different resolution and they can change it up or down at will on the same channel during a day. What this means is that it is very difficult to get consistant quality and filesize as you would need to script a different quality setting depending on what resolution the video is in, I have seen other scripts do this and they are overly complex. My solution was to keep it simple and make the resolution smaller and then the same quality setting worked for all my channels. Of course every country has broadcasted material in different formats and each user of this script will have a different idea of what is a good filesize VS quality tradeoff VS speed to complete the transcode. On top of that you also find that some handbrake settings will then break the ability to play the files on mobile devices should you wish to watch your own movie or show on an airplane flight.
Skinah2
Newcomer
Posts: 7
Joined: Fri Jan 20, 2017 3:57 am
Switzerland

Re: Script to export Mythtv recordings to a folder or NAS

Post by Skinah2 »

axel77 wrote: If you want to get 720p you'll need to change the -X to -Y. It's actually pretty surprising that the biggest difference isn't in the resolution, but in the compression format.
I agree it may seem better to use the -Y but there was a reason why I used the -X and it may have been for supporting and getting more consistant results between 4:3, 16:9 and 21:9 programs as Handbrake will detect the black bars and strip/crop the black pixels away. It was a long time ago when I came up with those settings based on looking at what a large variety of recordings came out to be so I cant be sure. Record different channels at different times of the day and also different aspect ratios to compare before settling on your settings.

Very happy people are finding the script useful and this was one reason why I wanted to keep it to bash terminal commands so it is easy for a noob to edit changes as it will not suit what everyone wants. Try to limit the changes you make because if I make major changes and post an updated version it will make your life easier putting your changes into the new script.
george4
Newcomer
Posts: 1
Joined: Fri Feb 17, 2017 11:01 pm
United States of America

Re: Script to export Mythtv recordings to a folder or NAS

Post by george4 »

Thank you for this script. I set all quality levels to 0 and ignored all information re transcoding. It worked fine for me.
Skinah2
Newcomer
Posts: 7
Joined: Fri Jan 20, 2017 3:57 am
Switzerland

Re: Script to export Mythtv recordings to a folder or NAS

Post by Skinah2 »

Does anyone have features they wish to be added to this script?
MoisiePants
Junior
Posts: 54
Joined: Sat Jul 23, 2016 11:41 am
Great Britain

Re: Script to export Mythtv recordings to a folder or NAS

Post by MoisiePants »

Hello,

I've had a look around, but I can't see an answer to this: is there a way to run this script (presumably as a User Job) on specific recordings that have been made, rather than as an 'applies-to-every-recording' way?
I hoped there might be a key command in the FrontEnd to run a User Job - but I can't see that.

Thanks,

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

Re: Script to export Mythtv recordings to a folder or NAS

Post by bill6502 »

I *think* you're asking for a command line tool. See mythutil --help and
look near the very end for the --queuejob switch.
MoisiePants
Junior
Posts: 54
Joined: Sat Jul 23, 2016 11:41 am
Great Britain

Re: Script to export Mythtv recordings to a folder or NAS

Post by MoisiePants »

Thanks Bill - I'll look into that. An initial glance suggests that's exactly what I need!
daraden
Senior
Posts: 175
Joined: Tue Feb 23, 2016 7:33 am
United States of America

Re: Script to export Mythtv recordings to a folder or NAS

Post by daraden »

I hoped there might be a key command in the FrontEnd to run a User Job - but I can't see that.
press M > job options > begin job name. Alternatively if you use Mythweb you can queue a job from the recording details page.
MoisiePants
Junior
Posts: 54
Joined: Sat Jul 23, 2016 11:41 am
Great Britain

Re: Script to export Mythtv recordings to a folder or NAS

Post by MoisiePants »

Thanks Daraden - even better!
mikech
Newcomer
Posts: 2
Joined: Fri Dec 14, 2018 7:49 pm
United States of America

Re: Script to export Mythtv recordings to a folder or NAS

Post by mikech »

Hi, I'm intermediate-level familiar with Linux (used on and off since 2011) and newish to Myth in general (got a DVR running a couple times before abandoning), with this being my first serious go. I'm using Fedora 29 and mythtv from the RPMfusion repository.

I'm not able to make this script work, and after fixing permissions hell, I've finally gotten a log and I see two things that may be of concern:

1)

Code: Select all

Using configuration directory = /etc/mythtv
2018-12-14 10:37:04.296850 I  Assumed character encoding: en_US.UTF-8
2018-12-14 10:37:04.297082 E  Error parsing: /etc/mythtv/config.xml at line: 1  column: 1
2018-12-14 10:37:04.297089 E  Error Msg: unexpected end of file
2018-12-14 10:37:04.297162 E  DBHostName is not set in config.xml
2018-12-14 10:37:04.297177 E  DBHostName is not set in config.xml
2018-12-14 10:37:04.297198 N  Empty LocalHostName.
2018-12-14 10:37:04.297207 I  Using localhost value of DVR-PC
As far as I can tell, /etc/mythtv/config.xml is a blank and empty file. The guide I followed in the wiki doesn't include this file, but my database is pretty default (name mythtv, password blank) and it seems to be correctly substituting my PC's name for localhost.

2) Lots and lots of these:

Code: Select all

I  AVFrame.format is not set
2018-12-14 10:37:14.996817 I  AVFrame.width or height is not set
2018-12-14 10:37:15.002669 I  Converting frame #58 from B to I 
2018-12-14 10:37:15.004016 I  AVFrame.format is not set
2018-12-14 10:37:15.004020 I  AVFrame.width or height is not set
2018-12-14 10:37:15.005841 I  AVFrame.format is not set
2018-12-14 10:37:15.005846 I  AVFrame.width or height is not set
2018-12-14 10:37:15.011282 I  Converting frame #59 from P to I 
2018-12-14 10:37:15.413924 I  Del map found 0 at 54044 (54044)
I'm not sure where these are coming from (googling the string brings up a lot of ffmpeg posts) but I think they're being generated by mythtranscode?

(Update: Attached my complete log)
Attachments
ScriptsLastRun.log
(17.08 KiB) Downloaded 99 times
Post Reply