[FFmpeg-devel] [PATCH] mp4a-latm rtp output & dynamic payload type from URL

Michael Niedermayer michaelni
Thu Dec 17 15:58:28 CET 2009


On Thu, Dec 17, 2009 at 04:45:11PM +0200, Sergiy wrote:
> 2009/10/12 Luca Abeni <lucabe72 at email.it>:
> > Hi Michael,
> >> for muxing maybe AVStream.id could be usefull? but we can also add a new
> >> field if its insufficient
> >> Also if id is used it should be used consistently by demuxer & muxer of
> >> the same container format
> >
> > Ok, thanks. I'll have a look at using AVStream.id for the payload type in
> > the RTP muxer
> 
> Unfortunaly AVStream.id is always 0 when raw h263/amr streamed.
> But AVOutputStream.file_index can be used to increase rtp dynamic type.
> 
> Here is simple patch that adds AVFormatContext.file_index and increase
> payload_type for every dynamic stream.

>  ffmpeg.c               |    2 ++
>  libavformat/avformat.h |    1 +
>  libavformat/rtpenc.c   |    2 +-
>  libavformat/sdp.c      |    6 +++---
>  4 files changed, 7 insertions(+), 4 deletions(-)
> 5aec09287e3bc62043fcdebb04334987db24a6c5  0001-rtp-dymamic-payload-fix.patch
> ---
>  ffmpeg.c               |    2 ++
>  libavformat/avformat.h |    1 +
>  libavformat/rtpenc.c   |    2 +-
>  libavformat/sdp.c      |    6 +++---
>  4 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 401b8bb..5191fdd 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -3362,6 +3362,8 @@ static void opt_output_file(const char *filename)
>          print_error(filename, AVERROR(ENOMEM));
>          av_exit(1);
>      }
> +    if (av_strstart(filename, "rtp:", NULL))
> +        oc->file_index = nb_output_files;
>  
>      if (last_asked_format) {
>          file_oformat = guess_format(last_asked_format, NULL, NULL);
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 4cc2fa6..8eb899c 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -536,6 +536,7 @@ typedef struct AVFormatContext {
>      void *priv_data;
>      ByteIOContext *pb;
>      unsigned int nb_streams;
> +    int file_index;      /**< file index, used in rtp-output for dynamic payload type */
>      AVStream *streams[MAX_STREAMS];

didnt review your patch but you cant add things into the middle ofpublic
 structs

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is not what we do, but why we do it that matters.
-------------- 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-devel/attachments/20091217/cf08712c/attachment.pgp>



More information about the ffmpeg-devel mailing list