[mythtv-users] Commercial Flagging after Transcode

HP-mini blm-ubunet at slingshot.co.nz
Fri Mar 11 19:22:06 UTC 2016


On Fri, 2016-03-11 at 12:43 -0500, Daryl McDonald wrote:
> 
> 
> On Fri, Mar 11, 2016 at 11:40 AM, Michael Wisniewski
> <mikewiz38 at gmail.com> wrote:


>         On Thu, Mar 10, 2016 at 7:34 PM, Mark
>         <perkins1724 at hotmail.com> wrote:
>                 
>                 > -----Original Message-----
>                 > From: mythtv-users
>                 [mailto:mythtv-users-bounces at mythtv.org] On Behalf
>                 > Of Michael Wisniewski
>                 > Sent: Friday, 11 March 2016 9:51 AM
>                 > To: Discussion about MythTV
>                 > Subject: [mythtv-users] Commercial Flagging after
>                 Transcode
>                 >
>                 > Hi!
>                 >
>                 > I'm having a problem trying to do commercial
>                 flagging on a transcode.  After a
>                 > recording job runs, I have it run the commercial
>                 flagging and then a custom
>                 > script that transcodes the mpeg2 to a h.264 mpeg4
>                 file.  You can see the full
>                 > script here....
>                 >
>                 > http://pastebin.com/GveHsDft
>                 >
>                 > In particular, I have a question about these two
>                 lines:
>                 >
>                 > mythcommflag --chanid $CHANLID --starttime $STRTTIM
>                 --gencutlist
>                 
>                 MythTV can maintain in its database (amongst other
>                 things obviously) two sets of flags (relevant to your
>                 post). The first is commercial boundaries (set of
>                 start and end flags) commonly called the commskiplist.
>                 It is usually created by mythcommflag but there are
>                 other ways. The second is cut boundaries (set of start
>                 and end flags) commonly called the cutlist. It is
>                 usually created by copying the commercial boundaries
>                 (commskiplist) to the cutlist using --gencutlist
>                 switch or can be created / edited using the editor
>                 while viewing a recording in mythfrontend, but again
>                 there are other ways.
>                 
>                 Although I thought the --gencutlist switch applied to
>                 mythutil not to mythcommflag? Maybe it is undocumented
>                 feature of mythcommflag? I don’t specifically recall.
>                 What version MythTV are you running?
>                 
>                 Importantly, if your commskiplist is empty or wrong
>                 then using this switch will result in a cutlist that
>                 is empty or wrong. Also note that editing the cutlist
>                 does not update the commskiplist.
>                 
>                 > mythtranscode --chanid $CHANLID --starttime $STRTTIM
>                 --mpeg2 --
>                 > honorcutlist --outfile $MYTHDIR/$MPGFILE.tmp
>                 >
>                 
>                 When using mythtranscode to transcode, it can
>                 optionally remove the cutlist from the transcode
>                 output. The --honorcutlist is the switch to achieve
>                 this. Depending on your setup once you transcode your
>                 original file might be irretrievably destroyed and /
>                 or overwritten.
>                 
>                 > When it runs these commands, does it export the
>                 mpeg2 file with the
>                 > commercials already removed?
>                 
>                 Assuming that running mythcommflag with the
>                 --gencutlist switch is valid (which I can't confirm),
>                 then essentially yes assuming that the original
>                 commskiplist was generated and accurately marked the
>                 commercials intended for removal.
>                 
>                 > Or, does it export the mpeg2 file as the
>                 > original and puts the cutlist in a file alongside
>                 the mpeg2 file?
>                 
>                 mythtranscode will create a new file. It may or may
>                 not overwrite your original file depending on your
>                 specific setup and script. Full disclosure: I didn’t
>                 read your linked script. There is no text file
>                 containing the cutlist generated by default, it is all
>                 stored in the mythtv database.
>                 
>                 >
>                 > Going through mythweb, I see the commercial flag for
>                 the recorded
>                 > programs, but when watching it through a Kodi
>                 frontend, I see no dialog
>                 > recognizing commercials.
>                 
>                 Kodi doesn't understand anything to do with mythtv
>                 commskiplist or cutlist, it just plays the file as it
>                 currently is.
>                 
>                 My two guesses would be:
>                 a) using mythcommflag with --gencutlist is invalid
>                 therefore your cutlist is empty therefore your
>                 transcode output is the full file.
>                 b) your commskiplist is empty or incorrect to begin
>                 with therefore your cutlist is empty / incorrect
>                 therefore your transcode output is the full file.
>                 
>                 Easiest way to check the commskip list is to play a
>                 recording in mythfrontend, press 'e' to bring up the
>                 editor then press 'z' to import the commskiplist into
>                 the cutlist editor and check it there. When you exit
>                 it will give you the option to save the cutlist or
>                 discard changes.
>                 
>                 >
>                 > Thanks in advanced!
>                 
>         
>         
>         Thanks for the response.  You did a great job explaining how
>         it all works and it was extremely helpful. 
>         
>         
>         I ended up pulling up the editor and the commskiplist thing in
>         the mythfrontend.  (I figured I'll worry about Kodi later).
>         The "E" doesn't do anything (says no seektable) and the "Z"
>         just skips forward.  I also checked out that mythcommflag, and
>         there is no gencutlist option in it either.  Since the
>         transcoded file isn't shorter and includes the commercials,
>         and the 'z' doesn't do anything except skip around, I'm
>         guessing that commercial detection isn't working for me with
>         the transcode.  
>         
>         
>         Ideally, I'd like myth to flag the commercials after the
>         transcode in the database so that it doesn't cut up the
>         original file....just in case commercial detection doesn't
>         work, I can always view the show without loosing parts of it.
>         After running the transcode through handbrake, is it possible
>         to execute something like...
>         
>         
>         mythcommflag -f <file.mp4>
>         
>         
>         Will this keep the original file in tact (with the
>         commercials), but make mythtv flag the commercials properly?
>         
>         
>         Thanks for your help and responses again.


> because commflag is not 100% accurate I would never auto transcode a
> recording. Before transcoding is when E and Z act as previously
> described and once a cut list is edited the recording can be
> transcoded without losing anything you want kept. For recordings that
> have been transcoded they may still be available if in the BE set-up
> you haven't toggled off the switch to keep old recordings after
> transcoding, which would make it possible to rebuild the seek table,
> edit and save and transcode.  
> 
> 
If you transcode to AVCC format H264 mpeg PS (mpeg4 container) you then
can not generate seektable (& then cutlist) & probably can't
meaningfully use mythcommflag.

MythTV only generates seektables for H264 video in TS container.
You need to modify the H264 transcode script to use annexB H264 mpeg
transport stream container.
The other issues is that typical x264 settings has very sparse keyframes
(potential cut points).

The TS container file is a bit larger but is more robust. 



More information about the mythtv-users mailing list