Cinelerra, high def MPEG from TiVo, slicing out a clip, creating DVD and portable versions

Ben Scott dragonhawk at gmail.com
Sun Mar 29 20:18:24 EDT 2009


  First, thanks for all the ideas and tips everyone has posted.
There's a wealth of knowledge on this list!

  Here's new/more information from this end:

>>> Original file

  Just to reiterate, I've already gotten the file off my Tivo and have
decrypted it with tivodecode.  My understanding is that the .tivo
files are just MPEG streams with a general-purpose cipher applied, so
I've been assuming that since tivodecode produced something that could
be played, it did everything right.

  The original program was recorded from Comcast digital cable, from a
local broadcast channel, so it wasn't encrypted by the cable operator.
 (Most shows are, and I can't get them from the TiVo with HTTP.)  It's
high-definition, 1080i.

  My clip is at 4:40 (M:SS) into the 1-hour recording, and ends at
7:40, for a duration of 3 minutes.

>>> TiVo format quirks?

  I discovered that Totem will occasionally give errors when I attempt
to seek back and forth in the original file.  The GUI says:

	An error occured
	Internal data flow error.

  Whether or not I try to seek, I also get repeated messages in the
xterm running Totem:

	packetize: ******** unknown id 0xBC

  I haven't been able to reproduce the seek errors with the original
file with mplayer or Xine.  And of course, VLC won't play it at all,
but *will* play the clip (see below).  This makes me suspect that
maybe the TiVo's MPEG stream has some "quirks" that are confusing
things.  They might be violations of the standard, or just usual
characteristics that some software isn't prepared to handle.

  Anyone know if there's "something funny" that TiVo does here?

>>> ffmpeg

  On the strength of two recommendations, I tried to use ffmpeg to
slice out a clip.  My basic command is:

ffmpeg -acodec copy -vcodec copy -i full.mpeg -ss 00:04:40 -t 00:03:00 clip.mpeg

  At the start, ffmpeg says this:

Output #0, mpeg, to 'clip.mpeg':
  Stream #0.0: Video: 0x0000, yuv420p, 1920x1080 [PAR 0:1 DAR 0:1],
q=2-31, 19000 kb/s, 29.97 tb(c)
  Stream #0.1: Audio: ac3, 48000 Hz, 5:1, 384 kb/s

There is a matching remark for input, and something that implies
output is mapped to input, so it looks promising.  But then messages
like these are repeated many times throughout the process:

buffer underflow i=0 bufi=234676 size=252173
packet too large, ignoring buffer limits to mux it

  It does produce a file of 388 MB, which file(1) calls "MPEG
sequence, v1, system multiplex" (different from the "v2, program
multiplex" of the original).

  But I don't get any sound when I play it with mplayer, Xine, or VLC.
 The video looks right on, just no sound.  Totem just displays an
empty black square which doesn't get re-painted if I cover/uncover it
with another window.  mplayer had this to say:

Too many video packets in the buffer: (4096 in 8358029 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
MPEG: No audio stream found -> no sound.

  I tried adding "-itsoffset" as one suggested, to yield:

ffmpeg -acodec copy -vcodec copy -itsoffset -00:04:40 -i full.mpeg -ss
00:04:40 -t 00:03:00 clip.mpeg

  That yielded video from the wrong part of the program, still with no
sound.  I also tried dropping the minus sign from the offset argument,
which yielded *different* wrong video with no sound.

>>> mencoder

  Next I tried mencoder, as follows:

mencoder -ovc copy -oac copy full.mpeg -ss 00:04:40 -endpos 00:03:00
-o clip.mpeg

  That produced a 387 MB file (slightly smaller than ffmpeg's output).
 The message "Skipping frame!" occurs during the process.

  mplayer would play it, but couldn't seek.  Totem would just play the
audio, with no video.  Xine plays A/V, but resets to start of media on
a seek attempt.

Then I tried file(1) command, and found it said:

RIFF (little-endian) data, AVI, 1920 x 1080, ~30 fps, video:, audio:
Dolby AC3 (stereo, 48000 Hz)

  Going back and examining the text output of mencoder, I learned that
it had apparently produced an AVI file, not an MPEG file.  I tried
adding the option "-of mpeg".  That produced a file of 11 MB (much too
small), and many messages like the following:

BUFFER UNDEFLOW at stream 0, raising muxrate to 1980 kb/s, delta_scr: 223418
ERROR: scr 0.962, dts 0.000, pts 0.233
Skipping frame!

  mplayer, Xine, and Totem all play about three seconds worth of A/V
for this too-short file.  mplayer then aborts; Xine and Totem continue
with audio only.

  I went back to the 387 MB apparently-AVI file and renamed it to
"clip.avi", but that didn't appear to help any of the players deal
with it any better.

>>> Other options

 There are lots more things people have suggested, which I am still
going to try, but I wanted to report back this much so far, both to
(1) share knowledge and (2) in case someone spots an easy fix.

-- Ben


More information about the gnhlug-discuss mailing list