Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

A prelude to transcoding MPEG2->MPEG2

 

 

First page Previous page 1 2 Next page Last page  View All MythTV dev RSS feed   Index | Next | Previous | View Threaded


developstuff at qwest

Dec 9, 2003, 1:08 AM

Post #26 of 28 (1841 views)
Permalink
Re: A prelude to transcoding MPEG2->MPEG2 [In reply to]

Geoffrey Hausheer wrote:
> On Mon, 8 Dec 2003 18:28:18 -0500, "Doug Larrick doug-at-ties.org
> |mythtv/1.0-Allow|" <bccihm3msa0t [at] sneakemail> said:
>
>>On 12/08/03 17:47:53, Geoffrey Hausheer wrote:
>>
>>
>>>Also, I'd really like to get my hands on a MPEG2-TS stream from one
>>>of the HDTV/DVB guys so I can work on making that work too, so if
>>>anyone wants to snip ~5 minutes from such a beast and find a way to
>>>get it to me, that'd help (MPEG2-TS won't be supported otherwise)
>>
>>I happen to have 38 seconds of MPEG-TS (80 MB!) lying around, and
>>you're welcome to it, though please be kind as it's a (slow-uplink)
>>cable modem. http::/jekyl.ddts.net/enterprise.mpg . If you truly need
>>5 minutes, I'll have to defer to somebody with a bigger pipe.
>>
>
> This should be perfect. I am downloading it now. I won't look at it
> until the MPEG-PS stuff actually works, but I'm sure it will be useful.
>
> .Geoff

There is also a shorter clip on the pcHDTV site ( http://www.pchdtv.com/ ) in the Downloads section.

--
Craig Rindy


ou401cru02 at sneakemail

Dec 9, 2003, 12:23 PM

Post #27 of 28 (1852 views)
Permalink
Re: A prelude to transcoding MPEG2->MPEG2 [In reply to]

On Tue, 09 Dec 2003 00:58:25 -0700, "Craig Rindy" said:
> I am using GOPchop 0.9.1 with one minor modification to avoid an endless
> loop because I'm using Gentoo's libmpeg2-0.3.2_pre20030625 ebuild and
> GOPchop 0.9.1 was written against mpeg2dec version 0.3.1. All of my
> streams are 720x480 with a bitrate of 4 Mbps default or 8 Mbps for high
> quality.
>

Note that all that I am currently doing is reimplementing GOPchop from
scratch. There are two reasons for wasting my time on this:
1) From my understanding (and what I've gleaned from the code), GOPchop
plays some nasty tricks to do its job. For instance it doesn't demux the
audio and video before chopping. Maybe it does, but I don't think so
from my understandingof how it works. which leads us to...
2) the MPEG2 format is quite complex, and trying to understand it from a
piece of code which doesn't directly implement the spec is not easy. By
writing all the code myself, I am learning how the format goes together,
which should make everytihng a lot easier down the road.

After all this, I'd really like to find a way to use libavformat to
decode the streams, since getting all the corner-cases right is a real
pain.

Anyhow, I have been able to successfully take a stream, seperate audio
and video, and clip the video and audio. I have yet to determine how to
remux the streams successfully. The problem is that the mpeg-audio
format has a fixed number of samples per frame (for mp2, it is 1152). At
48kHZ, this is .024 sec (at 32kHz it is .036 sec). However, the video
frames have a resolution of about 1/29.97 = .033 or 1/25 = .04 sec. So
after doing a cut, I can only guarantee A/V sync up-to about .012 sec for
48kHZ, .018sec for 32kHZ audio. This means that the audio may be off by
as much as ~0.5 of a video frame. If I get it all right, it should not
be an additive affect, but it isn't perfect. I don't know if that is a
noticable delta or not to be honest. The fix appears to be to adjust the
time-offsets during muxing, but I'm not sure if all decoders will honour
those time-offsets.

.Geoff


ou401cru02 at sneakemail

Dec 9, 2003, 2:07 PM

Post #28 of 28 (1867 views)
Permalink
Re: A prelude to transcoding MPEG2->MPEG2 [In reply to]

By the way, I found this while poking around:
http://www.metzlerbros.org/dvb/

has anyone played with these tools? especially the replex tool looks
like it could be useful. It will demux and remux any MPEG2 stream into a
MPEG2-PS stream. It doesn't appear too complicated, and is
self-contained.

After I'm done with my experiments, I'll likely move over to using this
'replex' tool instead of my own code, so if people with MPEG2-TS streams
could tell me if it works for them, that could give us a leg up. replex
appears to be pretty early in development, but the author has been doing
MPEG2 utilities for quite some time, so certainly knows what he is doing
a lot better than I do.

.Geoff

First page Previous page 1 2 Next page Last page  View All MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.