[FFmpeg-devel] [Patch]GSoC 2008 qualification task TS Muxer

zhentan feng spyfeng
Tue Mar 25 04:57:16 CET 2008


2008/3/25, Michael Niedermayer <michaelni at gmx.at>:
> On Mon, Mar 24, 2008 at 11:09:12PM +0800, zhentan feng wrote:
>  > hi all,
>
> > I have read through ISO13818 and the original TS Muxer codes by
>  > several days, and finally generated a patch attached below.
>  > I just extracted the common code lines from mpegtsenc.c and mpegenc.c,
>  > and added these codes to mpegpesenc.c and .h files.
>  > It may have some errors or unsuitable format although i have reviewed
>  > many times.
>  > Thanks anyone who points them out.
>  >
>
>  > Further more, I have 2 questions:
>  > 1)How can I test my patch is correct?
>  > I just get 4 files through the link:
>  > svn://svn.mplayerhq.hu/soc/dvbmuxer.
>  > I download the ffmpeg source code from
>  > svn://svn.mplayerhq.hu/ffmpeg/trunk,but I can not find the 4files.
>  > Is it means that I should copy the 4 files to ffmpeg sourcer code and
>  > overwrite some files and rebuild the all source codes?
>
>
> One of the 4 files is a patch which i assume can be applied, possibly to
>  an old ffmpeg version.
>

thanks firstly.

>
>  [...]
>
>  > Index: mpegenc.c
>  > ===================================================================
>  > --- mpegenc.c (revision 2027)
>  > +++ mpegenc.c (working copy)
>  [...]
>  > Index: mpegpes.h
>  > ===================================================================
>  > --- mpegpes.h (revision 2027)
>  > +++ mpegpes.h (working copy)
>  > @@ -61,7 +61,51 @@
>  >      int64_t vobu_start_pts;
>  >  } PESStream;
>  >
>  > +/**
>  > + * PS stream structure
>  > + */
>  > +typedef struct {
>  > +    int packet_size; /* required packet size */
>  > +    int packet_number;
>  > +    int pack_header_freq;     /* frequency (in packets^-1) at which we send pack headers */
>  > +    int system_header_freq;
>  > +    int system_header_size;
>  > +    int mux_rate; /* bitrate in units of 50 bytes/s */
>  > +    /* stream info */
>  > +    int audio_bound;
>  > +    int video_bound;
>  > +    int is_mpeg2;
>  > +    int is_vcd;
>  > +    int is_svcd;
>  > +    int is_dvd;
>  > +    int64_t last_scr; /* current system clock */
>  >
>  > +    double vcd_padding_bitrate; //FIXME floats
>  > +    int64_t vcd_padding_bytes_written;
>  > +
>  > +} MpegMuxContext;
>  > +
>  > +/**
>  > + * TS stream structure
>  > + */
>  > +typedef struct MpegTSWrite {
>  > +    MpegTSSection pat; /* MPEG2 pat table */
>  > +    MpegTSSection sdt; /* MPEG2 sdt table context */
>  > +    MpegTSService **services;
>  > +    int sdt_packet_count;
>  > +    int sdt_packet_freq;
>  > +    int pat_packet_count;
>  > +    int pat_packet_freq;
>  > +    int nb_services;
>  > +    int onid;
>  > +    int tsid;
>  > +    int packet_number;
>  > +    int64_t last_pcr; /* last programme clock reference */
>  > +    int64_t cur_pcr; /* current programme clock reference */
>  > +    int mux_rate;
>  > +    int packet_size;
>  > +} MpegTSWrite;
>
>  These structs do not belong into the PES code
>
>  Also this patch is against soc-svn not ffmpeg-svn. We need one or more
>  clean patches against ffmpeg-svn which move the common PES code into
>  seperate files and makes both PS and TS muxers use this common code.
>

I modified the codes and attached 2 new patches.

The patch names "TSMuxerPatch_svn_dev" is the 4 files against
svn://svn.mplayerhq.hu/ffmpeg/trunk/libavformat
I think if the patch works correctly, it would be our expect.


The patch names "TSMuxerPatch_svn_soc" is the 4 files against
svn://svn.mplayerhq.hu/soc/dvbmuxer
I created the pactch just for reviewing the codes easily.

thanks again,when anyone points mistakes out.

best wishes~


>  [...]
>
> --
>  Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
>  While the State exists there can be no freedom; when there is freedom there
>  will be no State. -- Vladimir Lenin
>
> -----BEGIN PGP SIGNATURE-----
>  Version: GnuPG v1.4.6 (GNU/Linux)
>
>  iD8DBQFH6AbJYR7HhwQLD6sRAjLBAJ0SaU09FFv2omYQaHlSeFJ7zt0O4wCgidjL
>  Og4KgSoYUgoO121sJaIPALA=
>  =SzqG
>  -----END PGP SIGNATURE-----
>
> _______________________________________________
>  ffmpeg-devel mailing list
>  ffmpeg-devel at mplayerhq.hu
>  https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>


-- 
Best wishes~
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TSMuxerPatch_svn_soc.patch
Type: application/octet-stream
Size: 25256 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080325/baee2153/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TSMuxerPatch_svn_dev.patch
Type: application/octet-stream
Size: 56348 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080325/baee2153/attachment-0001.obj>



More information about the ffmpeg-devel mailing list