[mythtv] Lossless MPEG2 editing!

Isaac Richards ijr at case.edu
Thu Jan 20 01:55:47 EST 2005


On Thursday 20 January 2005 12:25 am, Nigel Pearson wrote:
> >> only been tested on DVB recorded MPEG2 streams, but it works!
> >
> > I can't see how, as it's completely disregarding the internal file
> > structure.
>
>  Yes, it does strip off .nuv headers, but the
> resultant file plays normally in MythTV. Incredibly.
> I haven't checked for errors on stdout/stderr yet.
>
>  It is probably a raw MPEG2 file now?

Erm, what .nuv headers is it stripping off?  There's no such thing for dvb 
recordings.

> >   Neither does it actually cut to the desired frame.
>
>  Certainly not frame accurate - only cuts to the nearest
> markup (DVB sequence header?). But the edits seem to be
> accurate to at least the nearest half second, maybe less.
> Definitely acceptable.

Certainly not acceptable to me.  If I go to the trouble of editing something, 
I want the cuts where I edited, not a half second off.

> >> 2) Now, I assume that a recordedmarkup entry will always correspond
> >>     to a sequence header or keyframe, but I am not sure if the
> >>     audio and video blocks or packets will always align to these
> >>     byte offsets.
> >
> > Not true at _all_.  Audio is commonly very roughly aligned with video
> > data -
> > this is the reason for the 'extra audio buffering' option for playback.
>
>  OK. So something that tries to trim ads out of a file
> would need to recompress the audio? Or just adjust the length
> of audio packets?

The stream needs to be remuxed, and all the timestamps adjusted.  Audio needs 
to be cut as appropriate, new packets created, etc.

> >>     Given that it doesn't actually transcode, I prefer having
> >>     a separate program and set of UI actions for it. Thoughts?
> >
> > It shouldn't be part of anything,
> >
>  :-)
> >
> >  but if it has to be, it'd be best part of mythtranscode.
> > Doesn't make sense to have vastly similar functionality part
> > of a separate set of options and UI actions.
>
>  Vastly similar? Both make a file smaller,
> and mythtranscode _can_ use the cutlist I guess.
>
>  If I wanted to burn some programmes onto a DVD,
> I would want to not lose quality. If I wanted to keep
> something on my backend for fast access, I would want
> to compress it a little.
>
>  For me, they seem to be different activities?
>
>
>  Anyway, I will accept your sage wisdom and sit on
> this for a while. But I think a lot of users are dying
> for a lossless cutting utility. I know I was.

Why haven't you simply used gopchop?  It's been around for ages, and does 
almost exactly this.  Check out past messages on this list (and others) as to 
why it doesn't work all that well.

Isaac


More information about the mythtv-dev mailing list