[FFmpeg-soc] Extend TSMuxer to H264 muxing

Michael Niedermayer michaelni at gmx.at
Wed Apr 16 19:59:24 CEST 2008


On Thu, Apr 17, 2008 at 01:15:09AM +0800, zhentan feng wrote:
[...]
> > > 3, Don't decode the SPS by TS muxer and get the information by add a new
> > > struct in AVCodecContext, such as MpegTSH264Desc.
> > > When decode the H264 stream, we can write useful information into
> > > MpegTSH264Desc and will be later fecthed by the upper level.But we still
> > > decode the AVC stream to check the AUD nal units, if the pkt->data
> > donnot
> > > have the AUD, we should insert AUD nal units to the AVC stream before
> > muxing
> > > into PES packet.
> > >
> > > Any ideas about the methods?
> >
> >
> > 1. duplicates code
> > I do not understand what you suggest in 3.
> 
> 
> I mean 3 as two patrs :
> 1)Since AVCodecContext priv_data could not be used to pass parameters from
> avcodec to avformat, I think it would be feasible to pass these using other
> field of AVCodecContext, like opaque, or add additional field to pass that.
> That would avoid the redundant work to decode h.264 packet in muxer again
> and keep the code in the h264.c decoder clean.

The problem is that a muxer can be used without a decoder or encoder.
For example if you have a raw .h264 file or h264 in .mp4 and then want to
store this in mpeg-ts.

In such a case there would be
mp4 demuxer --> h264_mp4toannexb bitstream filter --> mpegts muxer
or
mpeg ps demuxer --> h264 parser --> mpegts muxer


> 
> 2)This is about AUD nal unit problems.
> It is necessary to confirm the AVC stream data wrapped in AVPacket have AUD
> nal units. If not,we should decode the AVC stream again and insert AUD nal
> uints into the stream. So, this may cause some changes to H264.c or just
> decode the stream by TS muxer in the upper level and this may cause some
> small duplicate code.

This sounds like it could be implemented in a bitstream filter. Similar to
h264_mp4toannexb_bsf.c (but in a seperate file and filter of course)

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080416/33c2a02e/attachment.pgp>


More information about the FFmpeg-soc mailing list