[mythtv-users] Lossless-cut Not Ubuntu

Jason But jbut at swin.edu.au
Wed Nov 7 21:17:03 UTC 2012

On 11/02/12 23:23, Doug Vaughan wrote:
> On 12-11-01 11:00 PM, Jason But wrote:
>> As an aside, I'm currently using mythnuv2mkv
>> (http://www.mythtv.org/wiki/Mythnuv2mkv) to do my cutting. With regards to
>> lossless_cut, I see mention that cuts "should" be made on key-frames, what
>> happens if they are not?
>> I have made a number of recordings which I've cut and compressed,
>> selecting good frames to end/start cuts on is difficult and you often get
>> artifacts of commercials in the final cut. Alternatively, sometimes the
>> nearest key-frame means that audio and images are cut from the final copy.
>> I suppose what I am trying to say is that it would be nice to be able to
>> do frame-accurate cutting (or at least near). If we are re-encoding to
>> h264 anyway, is there any reason you aren't decoding all frames and
>> re-encoding them?

Sorry for the late reply, I've been away for a while

> Jason,
> Maybe I can rephrase the comment "should", no matter if you chose keyframes
> in the MythTV UI or just let commflag decide your cut points, the utility
> that does the cutting "mkvmerge" picks the nearest keyframe based ontheinput
> time stamp value.
> Those time stamps are calculated "Frame number * Frames-per-sec =
> HH:MM:SS.nnnnnnnnn" time code(the decimals are nanosecond accurate).So if
> you had concerns about loosing some video and/or audio because you are
> forced to use a keyframe the point is moot.
> No matter what, a keyframe will always be used so it is better that YOU
> choose which keyframe. You are right that sometimes choosing a keyframe does
> chop off video. I use a HDPVR and found that with a 720p59.940 FPS recording
> that the keyframes are approximately 2.48 seconds apart which definitely
> means I experience some unwanted chop now and again. This is an issue no
> matter which tool I used (ffmpeg, mkvmerge or Avidemux).
> In the end I do not want to see video artefacts at cut points so chose the
> tools which deliver that and accept the downside. My understanding is that
> with other video encoding types the amount of video time that passes between
> keyframes varies and are usually shorter.
> With the Lossless Cut script, even if you have not actively set your cut
> points on keyframes it adjusts what it is given to the nearest cut
> pointsautomatically. This is done so that the cut segments better reflect
> the cut points input from MythTV.
> - The start cut frames are adjusted to the nearest keyframe less than or
> equal to the start skip or cut frame number
> - The end cut frames are adjusted to the nearest keyframe greater than or
> equal to the end skip or cut frame number
> As for the comment "If we are re-encoding to h264 anyway", well in my case I
> already have h264 recordings. The point of Lossless Cut was to provide a
> consistent, MythTV integrated, method of producing lossless cut video files
> from as many different recording encoding types as possible. What you do
> after you have a lossless cut video, such as re-transcoding to different
> encoding types, it up to you.
> When I started the project the MythTV developers commented that I should
> concentrate on lossless cuts for h264 recordings as the current solutions
> were wanting. That is what I did but I found out that mkvmerge handlesa
> wider range of video, audio and subtitle types than just h264. So the script
> was generic by virtue of the tools used.

So am I then correct in assuming that if the original recording is MPEG2 
(all dtv streams in Australia are MPEG2) then after the lossless cut it will 
remain encoded in MPEG-2 video and audio streams, just that they will now be 
enclosed in an MKV container?

If so, then cutting commercials and converting to h264 would be a two step 
process. I believe my current script mythnuv2mkv uses mythtranscode in the 
background to do the cutting before using mencoder to transcode. By decoding 
and then re-encoding you can get inter keyframe cuts, unfortunately the UI 
doesn't always display the correct frame on the screen when doing a 
frame-by-frame step for tagging

> Previously I was using Avidemux to manually cut commercials and it took
> about 5-7 minutes per 60 minute TV show. Now with a commflagged video and
> using Mythtv UI to manually verify and adjust the cut points (if required)it
> takes 2 minutes tops. For me this has been a worthy effort.

Commercial flagging never worked for me, but it never takes me longer than 
about 1 minute per 30 minute recording to do manual commercial flagging via 
the UI

> Thanks
> Doug
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users


Dr. Jason But
Program Co-Ordinator, Bachelor of ICT (Network Design and Security)
Telecommunications Engineering Academic Group
Faculty of Information and Communication Technologies
Swinburne University of Technology

Phone: +61 3 9214 4839
Email: jbut at swin.edu.au
www:   http://caia.swin.edu.au

More information about the mythtv-users mailing list