Changing recorded filename and info after external transcode?

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

Moderator: Forum Moderators

Post Reply
wmorrison
Junior
Posts: 83
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Changing recorded filename and info after external transcode?

Post by wmorrison » Fri Jan 03, 2020 2:47 pm

What I would like to do is, transcode a recording with an external transcoder (handbrake, ffmpeg, etc.) then update mythconverg so that the recording points to the new file (different extension than .ts) and the info about the recording is correct (file size, resolution, etc.)

I haven't found an api for this. Does it exist? Or is there a script somewhere?

I know the recorded table has some info on the recording (title, season/episode, etc.) and the recordedfile table has info on the actual recorded file (file size, resolution, etc.) and the key between them is basename (the actual file name.) I assume after MythTV finishes recording a show, it updates recordedfile with the file size, etc.

I tried mythtranscode, but the file actually got bigger, and it didn't update the file size for display, just replaced the file.

srhtc
Newcomer
Posts: 1
Joined: Wed Jan 15, 2020 5:56 am
United States of America

Re: Changing recorded filename and info after external transcode?

Post by srhtc » Wed Jan 15, 2020 6:28 am

Google MythTV: Give your recordings a human readable filename

For more than renaming, also search MythicalLibrarian, and myth2kodi.

I have also been researching this, as I desire my recorded filenames to follow https://kodi.wiki/view/Naming_video_files, but not extra metadata files unless I really want to add a recording to my archives. Reasoning is that I record a lot to have content readily available, watch a portion of them, and only save a smaller subset that I want to archive.
I am just getting started with mythtv-backend/kodi and noticed OTA EIT isn't providing season/episode data; hopefully Schedules Direct does.

halucigenia
Junior
Posts: 99
Joined: Tue Nov 11, 2014 11:03 am
Great Britain

Re: Changing recorded filename and info after external transcode?

Post by halucigenia » Thu Jan 16, 2020 4:41 pm

Use the MythVideo folders instead of the recordings folders to store your transcodes - that's how I do it.

If you transcode programmatically you can get the series name, episode name, from the job command that invokes the transcode job, series number and episode number from the database if they contain them after the recording has been made and rename the transcode programmatically accordingly.
And also copy the files to pre set video folders if you wish.

I am sure that you can find examples and better ways to do things form other user's scripts but here's some ideas from mine:-

MYTHTV User Job Command:

Code: Select all

transcodejobname.sh "%DIR%/%FILE%" "%TITLE%" "%SUBTITLE%" "%CHANID%" "%STARTTIMEUTC%" "%JOBID%"
(I do have other parameters passed from the Job command to my script as well as the ones above).
Grab title and subtitle

Code: Select all

TITLE=$2
SUBTITLE=$3
Grab series and episode number from database using a pre set SQL command and generating a suitable program start-time.

Code: Select all

EPISODE_SERIES=$(${SQLCMD}"select syndicatedepisodenumber from recordedprogram where chanid=${CHANID} and starttime='${PSTARTTIME}'";)
SERIES=$(${SQLCMD}"select season from recordedprogram where chanid=${CHANID} and starttime='${PSTARTTIME}'";)
If the recordings don't have a series and episode number but do have the correct subtitle looking them up on the TVDB is possible for mannual renaming

Looking up the metadata when the files are in the Mythvideo video folders usually works OK once they are named correctly.

Post Reply