RE: transcoding mpeg2 -> mpeg2 (was: RE: [mythtv] DVB, (new) recording profiles, and transcoding)

mythdev at cue.cc mythdev at cue.cc
Sat Oct 4 10:51:04 EDT 2003


 
> > So it isn't possible at the moment to transcode mpeg2 to 
> mpeg2 to cut
> > commercials? Would be nice because I have H/W mpeg2 
> decoding but low cpu
> > power.
> 
> Yep, your statement is correct.  Also, i looked into tihs, 
> and don't see
> a good solution.  Edward's solution woul be the easiest (clip to key
> frames).  It would require basically no work to get right, but it
> sacrifices the per-frame precision we have today.  the second option
> would be to do what Isaac originally proposed, and I decided 
> against when
> this first came up for mpeg4.  That would be to clip to 
> key-frames, and
> then store 'micro-jumps' in the table that would allow myth 
> to skip the
> unwanted frames during playback as if there was a really short
> commercial.  The upside to this is that we don't need to do any
> re-encoding.  the downside is that playing mpeg2 streams on any other
> player (buring to DVD or whatever) would leave you with ~1 second of
> commercials at each cutpoint.  the third option is to 
> implement an mpeg2
> encoder.  Myth already ships with one in the form of 
> libavcodec, but it'd
> need to be hooked up.  This option allows exact commercial cuts, and
> wouldn't require much more CPU time (you're only reencoding a small
> number of frames), but it MAY end up creating incompatible 
> mpeg2 streams
> (which won't play in anything besides myth), since you don't 
> end up with
> key frames at even intervals, and again this may break saving 
> to DVD or
> other such things.


<snip>

> 
> Anyhow, that's how things stand today.  I am open for other 
> options and
> opinions.
> 
> .Geoff


Just thought I would chime in here with an idea...

On DVDs that I've made with Final Cut Pro and DVD Studio Pro, I've set
GOP intervals to 15 frames, and had problems breaking chapters at the
precise frames I needed.  Although I dont recall the exact process, I
remember that I used a recent version of FCP to set chapter markers.
That solved the problem of jumping to a scene from a menu, or skipping
scenes using navigation controls.

Now think of each part of a program between commercial breaks as a
chapter, and you could re-encode the mpeg2 stream to put chapter markers
into the stream where commercials end.  With DVDs created on DVD Studio
Pro, you can set actions to be performed at a frame... Can we skip ahead
to the next chapter marker when a commercial?

=====================================
| | | | |x|x|x|x][x|x|x|x|x|x|x|x|x|x|x|x|...
=====================================
        ^        ^
        |        + GOP
        +- Commercial break
           (frame with jump script attached)

where x is a blanked/black frame

Then on the other side of the commercial break:

======================================
|x|x|x][x|x|x|x| | | | | | | | | | | |...
======================================
       ^       ^
       |       + Program re-start
       |         (Chapter marker)
       + GOP


This way, the re-encoded stream will not break any DVD rules, and should
skip ahead the ~1 second of blanked frames when the chapter marker is
reached?

Are there any mpeg2 gurus that that can say this will/wont work?






More information about the mythtv-dev mailing list