[mythtv] [PATCH] MPEG2->MPEG2 commercial cut (myth patch)

Geoffrey Hausheer ou401cru02 at sneakemail.com
Fri Jan 2 22:08:10 EST 2004


On Fri, 2 Jan 2004 21:24:53 -0500, "Jim Paris" said:
> > yeah, sorry about that.  it works this way because it is faster to do a
> > rename nuv->old, tmp->nuv, rm old than to do a rm num, mv tmp->nuv (less
> > time when the user could try to watch a recording that is being swapped).
> >  I don't really plan to change it, so the answer is 'don't do that'
> 
> But
> 
>   if(SaveTranscodings)
>      rename(nuv, old);
>   rename(tmp, nuv);
> 
> will do the trick just as fast, since rename clobbers the destination.
This seems to be very filesystem dependant as to how fast it is.
If you'd like to try it (with a large (>4GB) file on ext3/reiser/xfs/jfs,
I'll be happy to change it, otherwise, I don't think it's a good idea (I
know I've had problems on our NFS systems at work doing just that).  I
think thisis a minor issue, personally.

> OK, so I tried again on my next recording, this time making sure the
> cutlist had been specified for a while before starting transcoding. 
> This time, it hung: more details at the end...
I'll look into it, thanks.

> 
> > > - If it didn't cut the commercials, why did the file shrink?
> >
> > Most likely it pruned out bogus audio/video frames.  If it was recorded
> > with a DVB/HDTV card, then it is probably the TS->PS conversion
> 
> This is with a PVR-350, DVD Special-2 mode.
I dunno.  With both original and new mpgs, I could look into it, but you
don't have those anymore :)

> 
> > > - The cut file seems to play OK in mplayer and MythTV, but from
> > >   within MythTV seeking around is slow, and the total recording time
> > >   jumps around, getting closer and closer to the actual time (30 mins)
> > >   as I near the end of the recording.  I also can't enter edit-mode
> > >   anymore.
> > well, we don't rebuild the keyframe index yet, so yeah, you'll see this
> > for now.
> 
> I suppose running mythcommflag or something would fix that for now.
Yeah.  This will get implemented soon-enough.

> 
> --
> 
> With my next MPEG, it hangs pretty early on.  This is again from a
> PVR-350, DVD special 2, and it hangs at a point where the MPEG is
> probably a bit messy (early on, when my cable box is just switching
> the channel).
> 
> The output of
> 
>   mythtranscode -c 1060 -s 2003-12-14T22:00:00 -p autodetect -d -l
yep, I can duplicate it here.  The problem is that there is a 0xbe frame
in your video.  I have no idea what that frame code means, and I can't
process it correctly (it's not mentioned in my mpegvideo documentation). 
I can discard those frames easily enough.
just add this at line 621 of mpeg2trans.cpp:
        else
            frame_len = len;


that will discard all unknown frames.  Maybe not the greatest solution,
but it won't hang.  I'll try to find out what a 0xbe frame is in the
meantime.

.Geoff


More information about the mythtv-dev mailing list