[FFmpeg-devel] [PATCH] connect AVCodecContext.rtp_payload_size to x264_params_t.i_slice_max_size

Michael Niedermayer michaelni at gmx.at
Sat Sep 15 03:03:31 CEST 2012


On Sat, Sep 15, 2012 at 12:42:02AM +0300, Lyubomir Marinov wrote:
> Dear FFmpeg developers,
> 
> We at the Jitsi open-source VoIP and Instant Messaging client community would like to propose the following patch which allows instructing the FFmpeg x264 encoder through AVCodecContext to produce payload suitable for the H.264 RTP packetization-mode 0 i.e. single NAL unit per RTP packet:
> 

>  libx264.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> c875f0cd07291c778e455664b9fcfcf4f600de1f  libavcodec_libx264.c-rtp_payload_size.patch
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index f2f8990..5efe69a 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -477,6 +477,14 @@ static av_cold int X264_init(AVCodecContext *avctx)
>  //    x4->params.b_open_gop     = !(avctx->flags & CODEC_FLAG_CLOSED_GOP);
>  
>      x4->params.i_slice_count  = avctx->slices;
> +    /*
> +     * Allow x246 to be instructed through AVCodecContext about the maximum size
                ^^^^
x264


> +     * of the RTP payload. For example, this enables the production of payload
> +     * suitable for the H.264 RTP packetization-mode 0 i.e. single NAL unit per
> +     * RTP packet.
> +     */
> +    if (avctx->rtp_payload_size)
> +        x4->params.i_slice_max_size = avctx->rtp_payload_size;

This should be before the x4->slice_max_size based setting of this
field together with the other avctx based initialization


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120915/dc23446a/attachment.asc>


More information about the ffmpeg-devel mailing list