How To: Convert mythcommflag markers to chapter marks within a transcoded file - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: PVR & Live TV Support (https://forum.kodi.tv/forumdisplay.php?fid=167) +---- Forum: MythTV (https://forum.kodi.tv/forumdisplay.php?fid=170) +---- Thread: How To: Convert mythcommflag markers to chapter marks within a transcoded file (/showthread.php?tid=287013) |
How To: Convert mythcommflag markers to chapter marks within a transcoded file - zakaron - 2016-08-15 I liked the fact that Kodi can handle an EDL for commercial markers provided by MythTV or even an external text source file for its markers. What I didn't like is that it ignores the EDL once I've transcoded my recordings to an mp4 file with HandBrake. Apparently the framerate does not get calculated correctly while playing one of my mp4 files (shows 0 framerate in the info screen during playback) and because it is 0, the EDL code section is skipped. Seems to match up with this thread: 237747 (thread) I am not running .28 nor am I ready to do so since I am running MythTV on FreeBSD and don't feel like compiling my own (.27.5 is available in freshports). Oddly I do transcode with constant framerate using --cfr option in my HandBrake command line. Since I need to transcode my recordings to conserve space, I came up with an alternate way to handle commercials. Basically in my user job to transcode my recording, right after I do the transcoding process, I call mythcommflag on the new .mp4 to work its magic and mark the commercials. I then select out the ending commercial flags (type 5 in the recordedmarkup table) and build a temporary chapter file (I called chapfile) that is compatible with mp4box utility ( https://gpac.wp.mines-telecom.fr/mp4box/ ) that can merge in the chapter flags with the video & audio streams to create a new mp4 container file. I then move this new file back into my recordings directory and update the database with the new file size, filename and transcoded flag set. I also delete out the recordedmarkup table entries since the chapter markers are now permanent within the mp4 container. Here's the section showing the chapter creation with an explanation of the variables used (this is bourne shell, btw): $DBUSER = your mysql user name $DBPASSWD = your mysql user password $CHAN = channel ID as a passed in argument $START = start time of recording as a passed in argument $OUTFILE = basename of new mp4 file (basically basename from recorded table with updated mp4 extension instead of mpg) $VIDEODIR = directory to your recordings $CHAPCNT = just an incremental chapter count to be used in the chapter name Code: # Mark commercials and set chapter markers in actual MP4 container file If you would like to see the entire script for what I do to transcode, I can paste that too if it would help to see. I figured I'd share this to start with for those wanting an alternate way to skip commercials without cutting them completely in case of detection errors. That was my main hang up; I didn't want to lose part of the show and wanted the option to rewind if necessary to go back through a commercial to get the part of the show if incorrectly marked. RE: How To: Convert mythcommflag markers to chapter marks within a transcoded file - nixfu - 2016-09-18 (2016-08-15, 21:16)zakaron Wrote: If you would like to see the entire script for what I do to transcode, I can paste that too if it would help to see. I figured I'd share this to start with for those wanting an alternate way to skip commercials without cutting them completely in case of detection errors. That was my main hang up; I didn't want to lose part of the show and wanted the option to rewind if necessary to go back through a commercial to get the part of the show if incorrectly marked. I would love to see your whole setup. I have the exact same issue. Too many times I have been burned by comm skipping cutting out part of the actual show. I like the fact that kodi can use a skip list so you don't actually have to physically chop them out and lose it for ever. So yeah, I would be very interesting in your process. |