<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="font-family: Calibri, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">
<span style="color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">Hi
 Team,</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">
<span style="color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);"><br>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">
<span style="color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">Thank
 you very much for developing and supporting this great FFMPEG libaray .</span><br style="box-sizing: border-box; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">
<span style="color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">I
 am an iOS developer. I used FFMPEG library for video conversion i.e mpg format to mp4 format with high quality video. I am getting below error in debug console and getting return zero value for this line **ret = avcodec_open2(enc_ctx, encoder, NULL); ** in </span><span style="box-sizing: border-box; font-weight: 600; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">open_output_file</span><span style="color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);"> method
 for below code .</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">
Would you please help on this issue.</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">
Thank you very in Advance.</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">
<br>
</div>
<div><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">
<p style="font-family: Helvetica; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<span style="font-size: 20px;"><b>Code :</b></span></p>
<p style="font-family: Helvetica; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<span style="color: rgb(0, 0, 0); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';">———————————————————————————————————————————————————————————————————————————————————————————————————————</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
//</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #78492a">#import </span>"VideoTranscodeObj.h"</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #78492a">#include </span><libavcodec/avcodec.h></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #78492a">#include </span><libavformat/avformat.h></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #78492a">#include </span><libavfilter/buffersink.h></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #78492a">#include </span><libavfilter/buffersrc.h></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #78492a">#include </span><libavutil/opt.h></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #78492a">#include </span><libavutil/pixdesc.h></p>
<p style="font-family: Helvetica; font-size: 12px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<br>
</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #78492a">#import </span>"VideoTranscodeH264.h"</p>
<p style="font-family: Helvetica; font-size: 12px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<br>
</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">@implementation</span> VideoTranscodeH264</p>
<p style="font-family: Helvetica; font-size: 12px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<br>
</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> AVFormatContext *ifmt_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> AVFormatContext *ofmt_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">typedef</span> <span style="color: #ba2da2">struct</span> FilteringContext {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFilterContext *buffersink_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFilterContext *buffersrc_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFilterGraph *filter_graph;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
} FilteringContext;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> FilteringContext *filter_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">typedef</span> <span style="color: #ba2da2">struct</span> StreamContext {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVCodecContext *dec_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVCodecContext *enc_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
} StreamContext;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> StreamContext *stream_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> <span style="color: #ba2da2">int</span> open_input_file(<span style="color: #ba2da2">const</span>
<span style="color: #ba2da2">char</span> *filename)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
{</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>unsigned<span style="color: #000000"> </span>
int<span style="color: #000000"> i;</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    ifmt_ctx = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> ((ret = avformat_open_input(&ifmt_ctx, filename,
<span style="color: #ba2da2">NULL</span>, <span style="color: #ba2da2">NULL</span>)) <
<span style="color: #272ad8">0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Cannot open input file\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> ((ret = avformat_find_stream_info(ifmt_ctx,
<span style="color: #ba2da2">NULL</span>)) < <span style="color: #272ad8">0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Cannot find stream information\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    stream_ctx = av_mallocz_array(ifmt_ctx->nb_streams, <span style="color: #ba2da2">
sizeof</span>(*stream_ctx));</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!stream_ctx)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> AVERROR(ENOMEM);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">for</span> (i = <span style="color: #272ad8">0</span>; i < ifmt_ctx->nb_streams; i++) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        AVStream *stream = ifmt_ctx->streams[i];</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        AVCodec *dec = avcodec_find_decoder(stream->codecpar->codec_id);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        AVCodecContext *codec_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!dec) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Failed to find decoder for stream #%u\n"<span style="color: #000000">, i);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">return</span> AVERROR_DECODER_NOT_FOUND;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        codec_ctx = avcodec_alloc_context3(dec);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!codec_ctx) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Failed to allocate the decoder context for stream #%u\n"<span style="color: #000000">, i);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">return</span> AVERROR(ENOMEM);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = avcodec_parameters_to_context(codec_ctx, stream->codecpar);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Failed to copy decoder parameters to input decoder context "</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                   <span style="color: #d12f1b">"for stream #%u\n"</span>, i);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        </span>/* Reencode video & audio and remux subtitles etc. */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            || codec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                codec_ctx->framerate = av_guess_frame_rate(ifmt_ctx, stream, <span style="color: #ba2da2">
NULL</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            </span>/* Open decoder */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = avcodec_open2(codec_ctx, dec, <span style="color: #ba2da2">NULL</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Failed to open decoder for stream #%u\n"</span>, i);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        stream_ctx[i].dec_ctx = codec_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_dump_format(ifmt_ctx, <span style="color: #272ad8">0</span>, filename, <span style="color: #272ad8">
0</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>return<span style="color: #000000"> </span>
<span style="color: #272ad8">0</span><span style="color: #000000">;</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
}</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> <span style="color: #ba2da2">int</span> open_output_file(<span style="color: #ba2da2">const</span>
<span style="color: #ba2da2">char</span> *filename)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
{</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVStream *out_stream;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVStream *in_stream;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVCodecContext *dec_ctx, *enc_ctx = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVCodec *encoder;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>unsigned<span style="color: #000000"> </span>
int<span style="color: #000000"> i;</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    ofmt_ctx = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    avformat_alloc_output_context2(&ofmt_ctx, <span style="color: #ba2da2">NULL</span>,
<span style="color: #ba2da2">NULL</span>, filename);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!ofmt_ctx) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Could not create output context\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> AVERROR_UNKNOWN;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">for</span> (i = <span style="color: #272ad8">0</span>; i < ifmt_ctx->nb_streams; i++) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        out_stream = avformat_new_stream(ofmt_ctx, <span style="color: #ba2da2">NULL</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!out_stream) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Failed allocating output stream\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">return</span> AVERROR_UNKNOWN;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        in_stream = ifmt_ctx->streams[i];</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        dec_ctx = stream_ctx[i].dec_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            || dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 13px;">
                </p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                encoder = avcodec_find_encoder(AV_CODEC_ID_H264);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">if</span> (!encoder) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                    av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_FATAL,
<span style="color: #d12f1b">"Necessary encoder not found\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                    <span style="color: #ba2da2">return</span> AVERROR_INVALIDDATA;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                }</p>
<p style="font-family: Helvetica; font-size: 12px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<br>
</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx = avcodec_alloc_context3(encoder);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">if</span> (!enc_ctx) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                    av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_FATAL,
<span style="color: #d12f1b">"Failed to allocate the encoder context\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                    <span style="color: #ba2da2">return</span> AVERROR(ENOMEM);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                }</p>
<p style="font-family: Helvetica; font-size: 12px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<br>
</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->height = dec_ctx->height;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->width = dec_ctx->width;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                </span>/* take first format from list of supported formats */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->pix_fmt = encoder->pix_fmts[<span style="color: #272ad8">0</span>];</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                </span>/* video time_base can be set to whatever is handy and supported by encoder */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->time_base = dec_ctx->time_base;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                </span>//                enc_ctx->pix_fmt = AV_PIX_FMT_YUV420P;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->profile = FF_PROFILE_H264_BASELINE;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->level = <span style="color: #272ad8">40</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->bit_rate = dec_ctx->bit_rate;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                </span>//                enc_ctx->gop_size = 12;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->thread_count = FF_THREAD_SLICE;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                av_opt_set(enc_ctx->priv_data, <span style="color: #d12f1b">
"preset"</span>, <span style="color: #d12f1b">"slow"</span>, <span style="color: #272ad8">
0</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                </span>//                av_opt_set(enc_ctx->priv_data, "vprofile", "main", AV_OPT_SEARCH_CHILDREN);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                </span>//                enc_ctx->me_range = 16;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->qmin = <span style="color: #272ad8">18</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->qmax = <span style="color: #272ad8">24</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">if</span> (encoder-><span style="color: #ba2da2">id</span> ==  AV_CODEC_ID_H264) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                    av_opt_set( enc_ctx->priv_data, <span style="color: #d12f1b">
"preset"</span>, <span style="color: #d12f1b">"slow"</span>, <span style="color: #272ad8">
0</span> );</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            } <span style="color: #ba2da2">else</span> {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                encoder = avcodec_find_encoder(dec_ctx->codec_id);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">if</span> (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO && !encoder) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                    encoder = avcodec_find_encoder(AV_CODEC_ID_MP2);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->sample_rate = dec_ctx->sample_rate;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->channel_layout = dec_ctx->channel_layout;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->channels = av_get_channel_layout_nb_channels(enc_ctx->channel_layout);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                </span>/* take first format from list of supported formats */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">if</span> (encoder->sample_fmts) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                    enc_ctx->sample_fmt = encoder->sample_fmts[<span style="color: #272ad8">0</span>];</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                }<span style="color: #ba2da2">else</span> {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 13px;">
                    </p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 13px;">
                </p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->time_base = (AVRational){<span style="color: #272ad8">1</span>, enc_ctx->sample_rate};</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            </span>/* Third parameter can be used to pass settings to encoder */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = avcodec_open2(enc_ctx, encoder, <span style="color: #ba2da2">NULL</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Cannot open video encoder for stream #%u\n"<span style="color: #000000">, i);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = avcodec_parameters_from_context(out_stream->codecpar, enc_ctx);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Failed to copy encoder parameters to output stream #%u\n"<span style="color: #000000">, i);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            out_stream->time_base = enc_ctx->time_base;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            stream_ctx[i].enc_ctx = enc_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        } <span style="color: #ba2da2">else</span> <span style="color: #ba2da2">if</span> (dec_ctx->codec_type == AVMEDIA_TYPE_UNKNOWN) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_FATAL,
</span>"Elementary stream #%d is of unknown type, cannot proceed\n"<span style="color: #000000">, i);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">return</span> AVERROR_INVALIDDATA;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        } <span style="color: #ba2da2">else</span> {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            </span>/* if this stream must be remuxed */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Copying parameters for stream #%u failed\n"<span style="color: #000000">, i);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            out_stream->time_base = in_stream->time_base;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_dump_format(ofmt_ctx, <span style="color: #272ad8">0</span>, filename, <span style="color: #272ad8">
1</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = avio_open(&ofmt_ctx->pb, filename, AVIO_FLAG_WRITE);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Could not open output file '%s'"</span>, filename);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* init muxer, write output file header */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    ret = avformat_write_header(ofmt_ctx, <span style="color: #ba2da2">NULL</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Error occurred when opening output file\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>return<span style="color: #000000"> </span>
<span style="color: #272ad8">0</span><span style="color: #000000">;</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
}</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> <span style="color: #ba2da2">int</span> init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                       AVCodecContext *enc_ctx, <span style="color: #ba2da2">const</span>
<span style="color: #ba2da2">char</span> *filter_spec)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
{</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">char</span> args[<span style="color: #272ad8">512</span>];</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> ret = <span style="color: #272ad8">0</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">const</span> AVFilter *buffersrc = <span style="color: #ba2da2">
NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">const</span> AVFilter *buffersink = <span style="color: #ba2da2">
NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFilterContext *buffersrc_ctx = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFilterContext *buffersink_ctx = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFilterInOut *outputs = avfilter_inout_alloc();</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFilterInOut *inputs  = avfilter_inout_alloc();</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFilterGraph *filter_graph = avfilter_graph_alloc();</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!outputs || !inputs || !filter_graph) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = AVERROR(ENOMEM);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        buffersrc = avfilter_get_by_name(<span style="color: #d12f1b">"buffer"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        buffersink = avfilter_get_by_name(<span style="color: #d12f1b">"buffersink"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!buffersrc || !buffersink) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"filtering source or sink element not found\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = AVERROR_UNKNOWN;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        snprintf(args, <span style="color: #ba2da2">sizeof</span>(args),</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                 </span>"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d"<span style="color: #000000">,</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                 dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                 dec_ctx->time_base.num, dec_ctx->time_base.den,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                 dec_ctx->sample_aspect_ratio.num,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                 dec_ctx->sample_aspect_ratio.den);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, <span style="color: #d12f1b">
"in"</span>,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                           args, <span style="color: #ba2da2">NULL</span>, filter_graph);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Cannot create buffer source\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, <span style="color: #d12f1b">
"out"</span>,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                           <span style="color: #ba2da2">NULL</span>,
<span style="color: #ba2da2">NULL</span>, filter_graph);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Cannot create buffer sink\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = av_opt_set_bin(buffersink_ctx, <span style="color: #d12f1b">"pix_fmts"</span>,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                             (uint8_t*)&enc_ctx->pix_fmt, <span style="color: #ba2da2">
sizeof</span>(enc_ctx->pix_fmt),</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                             AV_OPT_SEARCH_CHILDREN);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Cannot set output pixel format\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    } <span style="color: #ba2da2">else</span> <span style="color: #ba2da2">if</span> (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        buffersrc = avfilter_get_by_name(<span style="color: #d12f1b">"abuffer"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        buffersink = avfilter_get_by_name(<span style="color: #d12f1b">"abuffersink"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!buffersrc || !buffersink) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"filtering source or sink element not found\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = AVERROR_UNKNOWN;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!dec_ctx->channel_layout)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            dec_ctx->channel_layout =</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_get_default_channel_layout(dec_ctx->channels);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        snprintf(args, <span style="color: #ba2da2">sizeof</span>(args),</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">                 </span>"time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%"<span style="color: #000000">PRIx64,</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                 dec_ctx->time_base.num, dec_ctx->time_base.den, dec_ctx->sample_rate,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                 av_get_sample_fmt_name(dec_ctx->sample_fmt),</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                 dec_ctx->channel_layout);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, <span style="color: #d12f1b">
"in"</span>,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                           args, <span style="color: #ba2da2">NULL</span>, filter_graph);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Cannot create audio buffer source\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, <span style="color: #d12f1b">
"out"</span>,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                           <span style="color: #ba2da2">NULL</span>,
<span style="color: #ba2da2">NULL</span>, filter_graph);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Cannot create audio buffer sink\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = av_opt_set_bin(buffersink_ctx, <span style="color: #d12f1b">"sample_fmts"</span>,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                             (uint8_t*)&enc_ctx->sample_fmt, <span style="color: #ba2da2">
sizeof</span>(enc_ctx->sample_fmt),</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                             AV_OPT_SEARCH_CHILDREN);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Cannot set output sample format\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = av_opt_set_bin(buffersink_ctx, <span style="color: #d12f1b">"channel_layouts"</span>,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                             (uint8_t*)&enc_ctx->channel_layout,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                             <span style="color: #ba2da2">sizeof</span>(enc_ctx->channel_layout), AV_OPT_SEARCH_CHILDREN);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Cannot set output channel layout\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = av_opt_set_bin(buffersink_ctx, <span style="color: #d12f1b">"sample_rates"</span>,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                             (uint8_t*)&enc_ctx->sample_rate, <span style="color: #ba2da2">
sizeof</span>(enc_ctx->sample_rate),</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                             AV_OPT_SEARCH_CHILDREN);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Cannot set output sample rate\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    } <span style="color: #ba2da2">else</span> {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = AVERROR_UNKNOWN;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* Endpoints for the filter graph. */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    outputs->name       = av_strdup(<span style="color: #d12f1b">"in"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    outputs->filter_ctx = buffersrc_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    outputs->pad_idx    = <span style="color: #272ad8">0</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    outputs->next       = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    inputs->name       = av_strdup(<span style="color: #d12f1b">"out"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    inputs->filter_ctx = buffersink_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    inputs->pad_idx    = <span style="color: #272ad8">0</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    inputs->next       = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!outputs->name || !inputs->name) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = AVERROR(ENOMEM);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> ((ret = avfilter_graph_parse_ptr(filter_graph, filter_spec,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                        &inputs, &outputs, <span style="color: #ba2da2">
NULL</span>)) < <span style="color: #272ad8">0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> ((ret = avfilter_graph_config(filter_graph,
<span style="color: #ba2da2">NULL</span>)) < <span style="color: #272ad8">0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* Fill FilteringContext */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    fctx->buffersrc_ctx = buffersrc_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    fctx->buffersink_ctx = buffersink_ctx;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    fctx->filter_graph = filter_graph;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
end:</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    avfilter_inout_free(&inputs);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    avfilter_inout_free(&outputs);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
}</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> <span style="color: #ba2da2">int</span> init_filters(<span style="color: #ba2da2">void</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
{</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">const</span> <span style="color: #ba2da2">char</span> *filter_spec;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>unsigned<span style="color: #000000"> </span>
int<span style="color: #000000"> i;</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    filter_ctx = av_malloc_array(ifmt_ctx->nb_streams, <span style="color: #ba2da2">
sizeof</span>(*filter_ctx));</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!filter_ctx)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> AVERROR(ENOMEM);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">for</span> (i = <span style="color: #272ad8">0</span>; i < ifmt_ctx->nb_streams; i++) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        filter_ctx[i].buffersrc_ctx  = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        filter_ctx[i].buffersink_ctx = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        filter_ctx[i].filter_graph   = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!(ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
              || ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO))</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">continue</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            filter_spec = </span><span style="color: #d12f1b">"null"</span><span style="color: #000000">;
</span>/* passthrough (dummy) filter for video */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">else</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            filter_spec = </span><span style="color: #d12f1b">"anull"</span><span style="color: #000000">;
</span>/* passthrough (dummy) filter for audio */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = init_filter(&filter_ctx[i], stream_ctx[i].dec_ctx,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                          stream_ctx[i].enc_ctx, filter_spec);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>return<span style="color: #000000"> </span>
<span style="color: #272ad8">0</span><span style="color: #000000">;</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
}</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> <span style="color: #ba2da2">int</span> encode_write_frame(AVFrame *filt_frame,
<span style="color: #ba2da2">unsigned</span> <span style="color: #ba2da2">int</span> stream_index,
<span style="color: #ba2da2">int</span> *got_frame) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> got_frame_local;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVPacket enc_pkt;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> (*enc_func)(AVCodecContext *, AVPacket *,
<span style="color: #ba2da2">const</span> AVFrame *, <span style="color: #ba2da2">
int</span> *) =</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    (ifmt_ctx->streams[stream_index]->codecpar->codec_type ==</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
     AVMEDIA_TYPE_VIDEO) ? avcodec_encode_video2 : avcodec_encode_audio2;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!got_frame)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        got_frame = &got_frame_local;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_INFO, <span style="color: #d12f1b">
"Encoding frame\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* encode filtered frame */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    enc_pkt.data = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    enc_pkt.size = <span style="color: #272ad8">0</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_init_packet(&enc_pkt);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    ret = enc_func(stream_ctx[stream_index].enc_ctx, &enc_pkt,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                   filt_frame, got_frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_frame_free(&filt_frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!(*got_frame))</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> <span style="color: #272ad8">0</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* prepare packet for muxing */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    enc_pkt.stream_index = stream_index;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_packet_rescale_ts(&enc_pkt,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                         stream_ctx[stream_index].enc_ctx->time_base,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                         ofmt_ctx->streams[stream_index]->time_base);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_DEBUG, <span style="color: #d12f1b">
"Muxing frame\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* mux encoded frame */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    ret = av_interleaved_write_frame(ofmt_ctx, &enc_pkt);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
}</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> <span style="color: #ba2da2">int</span> filter_encode_write_frame(AVFrame *frame,
<span style="color: #ba2da2">unsigned</span> <span style="color: #ba2da2">int</span> stream_index)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
{</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFrame *filt_frame;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_INFO,
</span>"Pushing decoded frame to filters\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* push the decoded frame into the filtergraph */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    ret = av_buffersrc_add_frame_flags(filter_ctx[stream_index].buffersrc_ctx,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                       frame, <span style="color: #272ad8">0</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_ERROR,
</span>"Error while feeding the filtergraph\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* pull filtered frames from the filtergraph */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">while</span> (<span style="color: #272ad8">1</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        filt_frame = av_frame_alloc();</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!filt_frame) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = AVERROR(ENOMEM);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">break</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_INFO,
</span>"Pulling filtered frame from filters\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = av_buffersink_get_frame(filter_ctx[stream_index].buffersink_ctx,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                      filt_frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            </span>/* if no more frames for output - returns AVERROR(EAGAIN)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
             * if flushed and no more frames for output - returns AVERROR_EOF</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
             * rewrite retcode to 0 to show it as normal procedure completion</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
             */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                ret = <span style="color: #272ad8">0</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_frame_free(&filt_frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">break</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        filt_frame->pict_type = AV_PICTURE_TYPE_NONE;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = encode_write_frame(filt_frame, stream_index, <span style="color: #ba2da2">
NULL</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">break</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
}</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #ba2da2">static</span> <span style="color: #ba2da2">int</span> flush_encoder(<span style="color: #ba2da2">unsigned</span>
<span style="color: #ba2da2">int</span> stream_index)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
{</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> got_frame;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (!(stream_ctx[stream_index].enc_ctx->codec->capabilities &</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
          AV_CODEC_CAP_DELAY))</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span> <span style="color: #272ad8">0</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">while</span> (<span style="color: #272ad8">1</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_INFO, <span style="color: #d12f1b">
"Flushing stream #%u encoder\n"</span>, stream_index);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = encode_write_frame(<span style="color: #ba2da2">NULL</span>, stream_index, &got_frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">break</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!got_frame)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">return</span> <span style="color: #272ad8">
0</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">return</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
}</p>
<p style="font-family: Helvetica; font-size: 12px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<br>
</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
-(<span style="color: #ba2da2">void</span>)transcodingFileWithPath:(NSString *)inputPath saveTo:(NSString *)outputPath onProgress:(onProgress)onprogress onComplete:(<span style="color: #ba2da2">void</span> (^)(<span style="color: #ba2da2">BOOL</span>))oncomplete</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
{</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    NSLog(</span>@"transcodingFileWithPath"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> ret;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVPacket packet = { .data = <span style="color: #ba2da2">NULL</span>, .size =
<span style="color: #272ad8">0</span> };</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    AVFrame *frame = <span style="color: #ba2da2">NULL</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">enum</span> AVMediaType type;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">unsigned</span> <span style="color: #ba2da2">int</span> stream_index;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>unsigned<span style="color: #000000"> </span>
int<span style="color: #000000"> i;</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> got_frame;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">int</span> (*dec_func)(AVCodecContext *, AVFrame *,
<span style="color: #ba2da2">int</span> *, <span style="color: #ba2da2">const</span> AVPacket *);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_register_all();</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    avfilter_register_all();</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> ((ret = open_input_file([inputPath UTF8String])) <
<span style="color: #272ad8">0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> ((ret = open_output_file([outputPath UTF8String])) <
<span style="color: #272ad8">0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> ((ret = init_filters()) < <span style="color: #272ad8">
0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* read all packets */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">while</span> (<span style="color: #272ad8">1</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> ((ret = av_read_frame(ifmt_ctx, &packet)) <
<span style="color: #272ad8">0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">break</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        stream_index = packet.stream_index;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        type = ifmt_ctx->streams[packet.stream_index]->codecpar->codec_type;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_DEBUG,
</span>"Demuxer gave frame of stream_index %u\n"<span style="color: #000000">,</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
               stream_index);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (filter_ctx[stream_index].filter_graph) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            av_log(</span><span style="color: #ba2da2">NULL</span><span style="color: #000000">, AV_LOG_DEBUG,
</span>"Going to reencode&filter the frame\n"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            frame = av_frame_alloc();</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (!frame) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                ret = AVERROR(ENOMEM);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">break</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_packet_rescale_ts(&packet,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                 ifmt_ctx->streams[stream_index]->time_base,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                 stream_ctx[stream_index].dec_ctx->time_base);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            dec_func = (type == AVMEDIA_TYPE_VIDEO) ? avcodec_decode_video2 :</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            avcodec_decode_audio4;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = dec_func(stream_ctx[stream_index].dec_ctx, frame,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                           &got_frame, &packet);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                av_frame_free(&frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Decoding failed\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">break</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (got_frame) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                frame->pts = frame->best_effort_timestamp;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                ret = filter_encode_write_frame(frame, stream_index);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                av_frame_free(&frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                    <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            } <span style="color: #ba2da2">else</span> {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                av_frame_free(&frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        } <span style="color: #ba2da2">else</span> {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">            </span>/* remux this frame without reencoding */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_packet_rescale_ts(&packet,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                 ifmt_ctx->streams[stream_index]->time_base,</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                                 ofmt_ctx->streams[stream_index]->time_base);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            ret = av_interleaved_write_frame(ofmt_ctx, &packet);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
                <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        av_packet_unref(&packet);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">    </span>/* flush filters and encoders */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">for</span> (i = <span style="color: #272ad8">0</span>; i < ifmt_ctx->nb_streams; i++) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        </span>/* flush filter */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (!filter_ctx[i].filter_graph)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">continue</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = filter_encode_write_frame(<span style="color: #ba2da2">NULL</span>, i);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Flushing filter failed\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        </span>/* flush encoder */</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        ret = flush_encoder(i);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">
0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Flushing encoder failed\n"</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            <span style="color: #ba2da2">goto</span> end;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_write_trailer(ofmt_ctx);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
end:</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_packet_unref(&packet);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_frame_free(&frame);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">for</span> (i = <span style="color: #272ad8">0</span>; i < ifmt_ctx->nb_streams; i++) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        avcodec_free_context(&stream_ctx[i].dec_ctx);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (ofmt_ctx && ofmt_ctx->nb_streams > i && ofmt_ctx->streams[i] && stream_ctx[i].enc_ctx)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            avcodec_free_context(&stream_ctx[i].enc_ctx);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">if</span> (filter_ctx && filter_ctx[i].filter_graph)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
            avfilter_graph_free(&filter_ctx[i].filter_graph);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_free(filter_ctx);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    av_free(stream_ctx);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    avformat_close_input(&ifmt_ctx);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE))</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        avio_closep(&ofmt_ctx->pb);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    avformat_free_context(ofmt_ctx);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 13px;">
    </p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">0</span>)</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        av_log(<span style="color: #ba2da2">NULL</span>, AV_LOG_ERROR, <span style="color: #d12f1b">
"Error occurred: %s\n"</span>, av_err2str(ret));</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 13px;">
    </p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (<span style="color: #ba2da2">self</span>.checkCancellConver ==
<span style="color: #ba2da2">YES</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        </span>//   [[NSFileManager defaultManager] removeItemAtPath:outputPath error:nil];</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        oncomplete(<span style="color: #ba2da2">false</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        <span style="color: #ba2da2">return</span>;</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    <span style="color: #ba2da2">if</span> (ret < <span style="color: #272ad8">0</span>) {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        NSLog(</span>@"Fail to convert ************ "<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        oncomplete(<span style="color: #ba2da2">false</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }<span style="color: #ba2da2">else</span> {</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        NSLog(</span>@"************* \n inputPath:%@ \n outputPath:%@ \n**************"<span style="color: #000000">,inputPath,outputPath);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
<span style="color: #000000">        NSLog(</span>@"Success *********** viswa"<span style="color: #000000">);</span></p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
        oncomplete(<span style="color: #ba2da2">true</span>);</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
    }</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 13px;">
    </p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
}</p>
<p style="font-family: Helvetica; font-size: 12px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal; min-height: 14px;">
<br>
</p>
<p style="font-family: Menlo; font-size: 11px; color: rgb(186, 45, 162); background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;">
@end</p>
<div style="background-color: rgb(255, 255, 255);"><font face="-apple-system,system-ui,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol">———————————————————————————————————————————————————————————————————————————————————————————————————————</font></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255);">
<span style="color: rgb(255, 0, 0);"><br>
</span></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; color: rgb(36, 41, 46); background-color: rgb(255, 255, 255);">
<span style="color: rgb(255, 0, 0);"><br>
</span></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; color: rgb(36, 41, 46);">
<span style="background-color: rgb(255, 255, 255); font-size: 20px;"><b>Debug console Error:</b></span></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; color: rgb(36, 41, 46);">
<font color="#ff0000" style="background-color: rgb(255, 255, 255);"><span style="font-variant-ligatures: normal;">------------------------------------------------------------------</span></font><span style="background-color: rgb(255, 255, 255); color: rgb(255, 0, 0);">------------------------------------------------------------------</span><span style="background-color: rgb(255, 255, 255); color: rgb(255, 0, 0);">------------------------------------------------------------------</span><span style="background-color: rgb(255, 255, 255); color: rgb(255, 0, 0);">-------------------------------------</span></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; background-color: rgb(255, 255, 255);">
<font color="#ff0000"><span style="font-variant-ligatures: normal;">transcodingFileWithPath</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/viswanath/Library/Developer/CoreSimulator/Devices/A71B16D3-86A9-4403-A6B1-9A8D23B842C0/data/Containers/Bundle/Application/0342E695-051C-4C71-9C54-581196CC2FE8/DLGDemo.app/VID_00222.mpg':</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Metadata:</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">major_brand : isom</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">minor_version : 512</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">compatible_brands: isomiso2mp41</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">encoder : Lavf54.0.100</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Duration: 00:00:30.08, start: 0.000000, bitrate: 1360 kb/s</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 1024x720 [SAR 1:1 DAR 64:45], 1226 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Metadata:</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">handler_name : VideoHandler</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Metadata:</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">handler_name : SoundHandler</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">[h264_videotoolbox @ 0x7f9354822600] Error setting max bitrate property: -12902</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Cannot open video encoder for stream #0</span><br style="box-sizing: border-box; font-variant-ligatures: normal;">
<span style="font-variant-ligatures: normal;">Error occurred: Generic error in an external library</span></font></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; background-color: rgb(255, 255, 255);">
<font color="#ff0000"><span style="font-variant-ligatures: normal;"><br>
</span></font></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; background-color: rgb(255, 255, 255);">
<font color="#ff0000"><span style="font-variant-ligatures: normal;">------------------------------------------------------------------</span></font><span style="color: rgb(255, 0, 0);">------------------------------------------------------------------</span><span style="color: rgb(255, 0, 0);">------------------------------------------------------------------</span><span style="color: rgb(255, 0, 0);">-------------------------------------</span></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; background-color: rgb(255, 255, 255);">
<font color="#ff0000"><span style="font-variant-ligatures: normal;"><br>
</span></font></div>
<div style="font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; background-color: rgb(255, 255, 255);">
<div style="font-family: Calibri, sans-serif;"><span style="color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; background-color: rgb(255, 254, 254);">Thanks
 and regards,</span></div>
<div style="font-family: Calibri, sans-serif;"><span style="color: rgb(36, 41, 46); font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant-ligatures: normal; background-color: rgb(254, 253, 253);">Viswanath</span></div>
</div>
</span></div>
<p></p>

<p></p>

<p></p>

<p style="font-size: 9px; ">This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.</p></body>
</html>