[mythtv-users] Good toolchain for cutting?

John Pilkington J.Pilk at tesco.net
Wed Nov 22 12:52:10 UTC 2017


On 22/11/17 07:48, Philipp Hahn wrote:
> Hello,
> 
> I'm using MythTV for several year by now and want to say "thank you".
> Most of the time it works as expected. By now I have collected several
> TByte of recorded series, which still include commercials, which I want
> to cut out.
> 
> If they are still SD and "good old" MPEG-2, using the MythTV built-in
> editing is fine, but already there I miss some functions:
> 
> 1. scene change detection: some times they do a "rewind" after the
> commercial, which makes the parts before and after the break overlap.
> Commercial detection has never been satisfying enough for me, so I most
> often do it manually. Cutting out that overlap would be simpler, if I
> could jump from scene change to scene change until I find the "same"
> frame again and cut everything in-between out.¹
> 
> 2. nearest I-frame: If my understanding is correct, MythTV currently
> cannot transcode H.264. For now I use "aviudemux"², where I can jump
> from I-frame to I-frame and cut out the sequence in-between easily. I
> still have several (not yet transcoded) recordings, where I used the
> MytvTV editor to mark the start and end point of some shown to cut out
> the end of the previous and the beginning of the next showing. Currently
> they are "frame exact" and most often are not positioned at an I-frame.
> It would help if the MythTV editor could show the position as "x frames
> after the previous/before the next I-frame", as I then could decide to
> cut out some "fade to black" frames just to reach the next I-frame to
> simplify lossless transcoding.
> 
> 3. MythTV frame count: As MythTV currently does not satisfy all my
> requirements, I often use some other tools like "ffmpeg" or "avidemux"².
> They use "hh:mm:ss.xxx" to specify a position, which is prone to
> rounding effects (will it rewind back to include that frame or will it
> got forward to pick the next frame after that time stamp?). MythTV also
> displays that format, but some times it is not the same. Also the
> "number of frames" is not the same "number of frames" as shown my "ffprobe":
> 
>> ffprobe \
>>                  -select_streams v \
>>                  -count_frames \
>>                  -show_frames \
>>                  -print_format csv \
>>                  -show_entries 'frame=key_frame,pict_type,pkt_pts_time,pkt_dts_time,best_effort_timestamp_time,pkt_pos,pkt_size' \
>>                  -i some_file.ts
> 
> So using the MythTV editor for setting the cut points and then using
> ffmpeg to do the transcode job fails, as the rounding errors change the
> points.
> I also wonder if the "start/end cut" is the "last frame I will keep" of
> the "first frame I will not see"?
> Also with interlaced video I sometime get a difference if I move forward
> or backwards, so showing a "interlaced video aware frame count" would
> also help.
> 
> 4. consecutive recording: I'm living in Germany and use DVC-C. In the
> past I had a miss-configuration, where I allowed MythTV to only record
> one show per adapter, even when the show was on the same MUX. This lead
> to MythTV switching files for consecutive recordings, leading to either
> the end of the previous show being the start of the next file, or the
> reverse.
> Being MPEG-TS files it's easy to temporarily concatenate them using
> plain `cat` (or one of the ffmpeg concatenate implementations³), but I
> still have to lookup the filenames, do the command line fu, put both new
> files back, tell MythTV to re-index them, ...
> 
> 
> All in all no serious issues, but together they sum up to be annoying
> enough for me to send this email to ask, if other users have the same
> issues and/or how they solved them?
> Do you know of some good tools to simplify those task?
> 
> (I run MythTV on my desktop PC, so I'm not restricted to using some
> remote control. Also I'm a Debian Developer, so I'm not afraid of
> getting my hands dirty.)
> 
> Philipp
> 
> ¹: <http://pyscenedetect.readthedocs.io/en/latest/>
> ²: <http://avidemux.sourceforge.net/>
> ³: <https://trac.ffmpeg.org/wiki/Concatenate>

Years ago I had problems when creating DVDs from mythtranscoded 
recordings;  I wrote mythDVBcut which almost always worked and I'm still 
using it today on SD mpeg2 recordings made with master.  It cuts other 
formats too, but then internal cuts can have audio transients.  I use a 
variant of it on DBV-T radio.  It cuts only at keyframes, but with 
digital content I rarely find this inadequate and it saves a lot of 
visual hunting time;  ymmv.

https://www.mythtv.org/wiki/MythDVBcut

I have had timestamp troubles with ProjectX for cat and .ts files.

John P






More information about the mythtv-users mailing list