Importing Video to transcode

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

Moderator: Forum Moderators

Post Reply
johnfm3
Newcomer
Posts: 6
Joined: Thu Sep 14, 2017 3:35 pm
United States of America

Importing Video to transcode

Post by johnfm3 » Thu Sep 14, 2017 5:32 pm

Hello,
I have the last release of MythBuntu 16.04.3 running. I am not sure which version of MythTV. But I do maintain regular updates on the box. Along with MythTV, I have installed Plex which is running 1.8.4 with Live TV and DVR support. I use no mthtv front ends as I have Kodi and Plex which are working great for me. I am not using the MythTV back end at this time, but it has been configured for kodi front ends to view live tv from it.

I really like the plex interface and device support, and as such I use that for all my recordings. I would like to make use of the MythTV for commercial detection and removal.

The first thing I see myself needing to be done is import the plex tv recording into MythTV. If all I want to do is import it in so I can edit commercials out and rebuild the file, what information do I need to supply?

Thanks,
John

johnfm3
Newcomer
Posts: 6
Joined: Thu Sep 14, 2017 3:35 pm
United States of America

Re: Importing Video to transcode

Post by johnfm3 » Fri Sep 15, 2017 1:51 am

So as a result of MythTV long history, there are all kinds of writings on Comercial Detection and Removal for a mythtv system. That is my reasoning for asking this question here.

I would use MythTV to record the TV shows, but its file naming appears to be some form of numerical which with out the DB is not helpful. Where Plex is building a folder/file structure based on show, season, episode (and if needed "part") in the file name.

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

Re: Importing Video to transcode

Post by bill6502 » Fri Sep 15, 2017 3:26 am

Don't use it myself, but see: https://www.mythtv.org/wiki/Mythlink.pl
which links human readable names to the date/time stamped file
names.

To see if it's installed on your system, try: locate -b '\mythlink.pl'

Not clear how you're going to run the backend without a DB if that's
what you're saying. mythbackend expects to be able to connect to
its DB.

johnfm3
Newcomer
Posts: 6
Joined: Thu Sep 14, 2017 3:35 pm
United States of America

Re: Importing Video to transcode

Post by johnfm3 » Fri Sep 15, 2017 4:19 am

bill6502 wrote:...Not clear how you're going to run the backend without a DB if that's
what you're saying. mythbackend expects to be able to connect to
its DB.
I had to re read my prior post see where I caused confusion. To be clear, I do have a fully functional MythTV standalone backend. I just dont have any frontend clients other than the one on the server hosting the backend. And other than live tv from a Kodi client, I dont use MythTV at all.

My DB comment is more about the fact that all the show data is in the DB and the file is just a numerical name pointed to by the DB. So if I loose my DB, the file naming is meaningless. Also means that plex wont know what to do with the files, so they will just show up as file names with no metadata and episode info.

Due to my work hours, I miss most of what I want to watch which allows recording to be so nice. I just want the commercials removed as I would like to keep these shows. And it looks like MythTV is fully setup for doing this task. And since I have a fully functional MythTV setup, I would like to see what it takes to make this work.

John

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

Re: Importing Video to transcode

Post by bill6502 » Fri Sep 15, 2017 3:32 pm

Sorry, I misunderstood the "...with out the DB..." comment.

mythlink.pl <should> work then and looks quite flexible in the
names it creates. Including seasons and episodes.

johnfm3
Newcomer
Posts: 6
Joined: Thu Sep 14, 2017 3:35 pm
United States of America

Re: Importing Video to transcode

Post by johnfm3 » Sat Sep 30, 2017 12:05 am

So I am back at this again. Since my last post, I have done much looking around on this topic. When looking for commercial detection, I am finding comskip which is a windows program and MythTV. The problem with ComSkip is I dont own a windows machine at all. Even my MAC has linux on it due to its age at this time.

this brings me back to using MythTV. And the problem of importing video (TS format) into MythTV for ability to remove commercials and re transcode the file as a mpg file.

Any thoughts on this would be helpful.

johnfm3
Newcomer
Posts: 6
Joined: Thu Sep 14, 2017 3:35 pm
United States of America

Re: Importing Video to transcode

Post by johnfm3 » Sat Sep 30, 2017 1:35 am

Ok, so I have found GUI software (DVBCUT) which works but in the last 2 months I have recorded 750GB of TV shows at about 2 to 4GB each show. Working with each file 1 at a time via GUI would be a very time consuming task, let alone I would have to keep doing this. And I record about 35 or so shows a week between all my family members. So performing this via a GUI is a no go. Hence importing these video's into MythTV and utilize myth's tools would be a great option.

John

johnfm3
Newcomer
Posts: 6
Joined: Thu Sep 14, 2017 3:35 pm
United States of America

Re: Importing Video to transcode

Post by johnfm3 » Tue Oct 03, 2017 3:08 am

Ok, so according to the following sites...
https://www.mythtv.org/wiki/Removing_Commercials
https://www.mythtv.org/wiki/Mythcommflag
https://www.mythtv.org/wiki/Mythtranscode

I should be able to run mythcommflag with the -f option followed by the file name with no channel id or start time. Yet that does not seem to be the case based on my response.

root@mythtv-755:/var/lib/mythtv/plex/news/60 Minutes (1968)/Season 50# mythcommflag -f 60\ Minutes\ -\ S50E01\ -\ Episode\ 1.ts
2017-10-02 20:01:16.044623 C mythcommflag version: fixes/0.28 [v0.28-2-g15cf421] www.mythtv.org
2017-10-02 20:01:16.044648 C Qt version: compile: 5.5.1, runtime: 5.5.1
2017-10-02 20:01:16.170094 E No program data exists for channel 0 at 20171002230115

Why does Mythtv care about program data? In this case I am looking for black screens between 60 min and commercials. What does it take for me to be successful at this????

John

User avatar
dizygotheca
Developer
Posts: 227
Joined: Wed Sep 03, 2014 9:02 am
Great Britain

Re: Importing Video to transcode

Post by dizygotheca » Tue Oct 03, 2017 10:51 am

It must be a filename of a Myth recording, ie. in the database.

Detecting commercials is hard. Different algorithms give different results for different channels/locations.
Usually they're are reliable enough to be useful but not completely accurate. So automatically transcoding (cutting out commercials) will sometimes result in losing parts of the show (often at the start/end). It is generally regarded as a risky approach & not recommended.

Firstly I'd suggest doing some test recordings via Myth to see how well the commflagging works for you, before you invest too much effort.

After commflagging, the alternatives are either;
1. Manually verify and adjust the cuts, then transcode.
2. Don't transcode but feed the cuts to a compatible player that will skip the commercials. It's less intensive and the user has the ability to override the skips when they are wrong. Nothing gets lost.

Myth adopts the 2nd approach. The Myth player & Kodi utilise "commflag marks" that are metadata associated to a recording detailing the frames/times which need to be jumped over. Currently the marks are stored in the recordedmarkup table of the database and thus can only be generated for Myth recordings. The commflagger also expects to run on a Myth recording for this (& possibly other) reason(s).

Theoretically it could run on an imported video, such as your .ts file, but that would require code changes throughout commflagger & player(s). It may be possible to store video commflag marks in the filemarkup table.
However, unless you're considering writing a patch, I wouldn't hold your breath; it's a niche feature request that in old & complex code.

So, essentially your problem becomes the much-requested "How can I import a recording into Myth ?"
That may be possible one day but is currently not easy/recommended due to probable database corruption that will cause crashes (even LiveTV).
MythImport may be of interest viewtopic.php?f=2&t=2082&p=10150

I suspect Plex won't handle commflag marks & generally steers well clear of any features supporting commercial skipping.
If you must transcode then you'll always need some tool for reviewing cutpoints, such as DVBCUT.
The MythPlayer contains a cutlist editor that allows you to easily inspect/adjust commflag marks. But that's only for Myth recordings that have marks in the database. Note that transcoding cuts out "cut marks" that are separate to "commflag marks", although you can easily convert commflag marks to cutmarks manually or programmatically.

So I think you're going up a dead-end. Other options seem to be;

1. Buy a Windows machine & investigate the Windows alternative!

2. Use Myth to make your recordings & commflag them. Kodi will skip commercials automatically. Use the MythFrontend cutlist editor to review cuts before transcoding and publishing them for Plex via mythlink.pl. If commercial skipping is important then recording via Myth & solving the "export to Plex" is probably always going to the easiest route. There's plenty of Myth/Plex users; that seems to be the norm.

3. Roll your own process to auto-detect commercials, pass the results to a review tool (DVBCUT?) and transcode. IIRC vlc has some options for logo & blank frame detection & will transcode. Maybe it can review cutpoints as well ? I would be interested in your findings if you explore this route.
the file is just a numerical name pointed to by the DB. So if I loose my DB, the file naming is meaningless
That's the point of mythlink.pl. It extracts metadata from the database & creates symbolic links to Myth recordings using human-readable filenames (configurable format) so that Plex/others can identify the title, episode etc from the filename alone.

Note. Myth will transcode but there's often talk about unsatisfactory results (due to formats etc) and there's plenty of alternative scripts floating around. Here's one
viewtopic.php?f=2&t=2248&p=11196

PhilB
Senior
Posts: 200
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Importing Video to transcode

Post by PhilB » Wed Oct 04, 2017 11:43 am

I don't know about US recordings, but here in the UK the main channels with adverts have exactly 4 minutes of advert plus a short sponsorship message. A 4 minute skip button invariably results in "This program" <skip> "is sponsored by xxx" which we find is simple and a good compromise.
Would this simple approach work for you?
Phil

Brian McNamara
Newcomer
Posts: 1
Joined: Thu Oct 19, 2017 9:24 am
United States of America

Re: Importing Video to transcode

Post by Brian McNamara » Thu Oct 19, 2017 9:26 am

Thank you so much, It worked wrll!

Post Reply