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

Geoffrey Hausheer ou401cru02 at sneakemail.com
Mon Oct 6 10:30:08 EDT 2003


On Mon, 6 Oct 2003 09:33:47 +0100, "Edward Wildgoose
Edward.Wildgoose-at-FRMHedge.com |mythtv/1.0-Allow|"
<pfnahiui2x0t at sneakemail.com> said:
> > > I also found:
> > > http://mpgtx.sourceforge.net/
> > > 
> > > Which references: gop-fixup
> > > http://mlug.missouri.edu/~markrages/tavi/index.php?page=GopFixup
> > That software looks like it has had no activity in the past year.  In any
> > case, I don't think changing the header timecodes is difficult (I already
> > do this for mpeg4 streams).  I'd prefer to not rely on different programs
> > for the transcoder if at all possible, and I have seen nothing so far
> > that requires one.
> 
> Does it matter if it's unmaintained...  If it works then perhaps it's
> just finished...?  Presumably the code could be incorporated though
> rather than using it standalone anyway.
I guess I was just saying that we might be able to borrow with prejudice,
but I didn't see anything which that program would bring to the table
that is difficult to implement with the tools already included with myth.

> 
> By the way, I did a test transcode of a show into mpeg4.  The sound ends
> up out of sync as a result.  I was cutting commercials front and back, so
> I can't rule out that it wasn't caused by this.
Possibly.  In general, the transcoder is just a special type of player
(at least as far as mpeg2->mpeg4 goes).  It just asks for a video frame,
and sends all relevant data to the encoder (the corresponding audio,
frame number and timecode).  So in theory it should just work (myth takes
care of audio/video sync during playback as long as the timecodes are
accurate).  This caused issues for the fifo code, since it needed to
actually sync the streams before sending them, so perhaps we could try
that.

Could you try using mythtranscode standalone with the --fifo switch and
recording with mencoder/ffmpeg.

The directions are as follows:
start mythtranscode from the command line (something like:
mythtranscode --starttime 2003-10-06-08:00:00 --chanid 1036
--honourcutlist --profile autodetect --fifodir $PWD

Then, in a new window (in the same directory):
a) start mencoder (from the 1.0 branch or CVS.  the old 0.9x stream won't
work):
mencoder -audiofile audout -audio-demuxer 20 -rawaudio rate=32000
-rawvideo on:w=640:h=480:fps=29.97 -ovc lavc -oac mp3lame -o out.avi
vidout

or b) start ffmpeg:
ffmpeg -f u16le -ar 32000 -ac 2 -i <path>/audout -f rawvideo -s 640x480
-r 29.97 -i <path>/vidout -vcodec mpeg4 -b 2000 -acodec mp3 -ab 128
out.avi

(you obviously need to adjust the parameters to match the video stream
for either case)

Either of those should generate mpeg4 streams which are compatible with
mplayer/xine whatever.  I'd be interested in whether the audio was synced
or not.

Also, if you can provide me with a sample DVB video-stream which has this
problem, (along with the relevant cutlist), I can try to debug it
locally.

.Geoff


More information about the mythtv-dev mailing list