[mythtv-users] Extracting a portion of HD mpegts file from myth

Tom Dexter digitalaudiorock at gmail.com
Sun Mar 23 17:09:17 UTC 2008


I'm looking to extract a portion of a show to a video file.  The show
is an HD recording of a Saturday Night Live episode in 1080i HD.  Note
that some of the problems I'm having may be due to NBC's awful
practice of mixing progressive and interlaced frames as well as
switching frame rates (are they just trying to screw with everyone or
what??).  Even mythtv will constantly enable and disable deinterlacing
playing their stuff unless you go into the video menu during playback
and force it on...really screwy stuff.

I'm using current stable versions of ffmpeg and mplayer/mencoder under Gentoo.

One thing I've always noticed is that, in general, working directly
with the mpegts files exactly as mythtv captures them off my tuner is
always an issue, as programs like mplayer (and as a result mencoder)
can't understand their time codes at all...often mplayer will start
off showing something completely bogus like "6:33:10 of 0:20" or
something that makes equally little sense.  In the past I've sometimes
been able to get around that by making a copy with mencoder using
"-oac copy -ovc copy".  Don't ask me what this was all about, but when
I attempted that with this mpeg file it got to a point where it
thought it was 95% complete (though I don't think it was actually that
far at all) and almost completely brought down my machine...it took me
like 15 minutes to get to a non-X virtual terminal and kill it.  Even
then my X session never really recovered and required a
Ctrl-Alt-Backspace...I can't begin to imagine that that was all about.

Up until now I had never used mythtranscode.  After reading up on it I
created an mpeg2 on my mythbackend from the show using mythtranscode
with the --mpeg2 option.  That appeared to be a good start, as mplayer
played it fine and could recognize the time codes etc.

However, even using that mpeg2 from mythtranscode, any attempt to
touch that thing with either mencoder or ffmpeg broke it in one way or
another.  For example, doing this:

mencoder snl.mpg -ovc copy -oac copy -of mpeg -ss 8:16 -endpos 3:22 -o test.mpg

...produces a file with completely black video, although the audio and
the time segment it took seems to be correct.  Using mencoder to
encode it as an mpeg4 ended up creating a file with super-slow-motion
video.  Attempting to do anything with it at all in ffmpeg using
"-vcodec copy -acodec copy" lost the audio altogether.  For one thing,
ffmpeg generates tone of these errors attempting to process it:

[mpeg @ 0xb7f0fe70]packet too large, ignoring buffer limits to mux it
[mpeg @ 0xb7f0fe70]buffer underflow i=0 bufi=250350 size=264540
[mpeg @ 0xb7f0fe70]buffer underflow i=0 bufi=252391 size=264540
[mpeg @ 0xb7f0fe70]packet too large, ignoring buffer limits to mux it
[mpeg @ 0xb7f0fe70]buffer underflow i=0 bufi=252391 size=264540
[mpeg @ 0xb7f0fe70]buffer underflow i=0 bufi=254432 size=264540
[mpeg @ 0xb7f0fe70]packet too large, ignoring buffer limits to mux it
[mpeg @ 0xb7f0fe70]buffer underflow i=0 bufi=254432 size=264540

Actually, I went through so many failed attempts at various things
that I can't even remember them all.  The fact that I'm typing this
and haven't actually thrown my cpu into the street is amazing :D

Is there some way to do this (preferably one that doesn't require
transcode and a phd ;)).  Like I said, it's entirely possible that the
bulk of my problems are from that strange stuff NBC does with their
stream.

Thanks in advance.
Tom


More information about the mythtv-users mailing list