static av_cold int movie_init(AVFilterContext *ctx)
{
    MovieContext *movie = ctx->priv;
    AVInputFormat *iformat = NULL;
    AVStream *st;
    AVCodec *codec;
    int ret;
    int64_t timestamp;
    av_register_all();
    iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
    movie->format_ctx = NULL;
    if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
        av_log(ctx, AV_LOG_ERROR,
               "Failed to avformat_open_input '%s'\n", movie->file_name);
        return ret;
    }
    if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)
        av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
    if (movie->seek_point > 0) {
        timestamp = movie->seek_point;
        if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
            if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
                av_log(ctx, AV_LOG_ERROR,
                       "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
                       movie->file_name, movie->format_ctx->start_time, movie->seek_point);
                return AVERROR(EINVAL);
            }
            timestamp += movie->format_ctx->start_time;
        }
        if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {
            av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\n",
                   movie->file_name, timestamp);
            return ret;
        }
    }
    if ((ret = av_find_best_stream(movie->format_ctx, AVMEDIA_TYPE_VIDEO,
                                   movie->stream_index, -1, NULL, 0)) < 0) {
        av_log(ctx, AV_LOG_ERROR, "No video stream with index '%d' found\n",
               movie->stream_index);
        return ret;
    }
    movie->stream_index = ret;
    st = movie->format_ctx->streams[movie->stream_index];
    codec = avcodec_find_decoder(st->codecpar->codec_id);
    if (!codec) {
        av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\n");
        return AVERROR(EINVAL);
    }
    movie->codec_ctx = avcodec_alloc_context3(codec);
    if (!movie->codec_ctx)
        return AVERROR(ENOMEM);
    ret = avcodec_parameters_to_context(movie->codec_ctx, st->codecpar);
    if (ret < 0)
        return ret;
    movie->codec_ctx->refcounted_frames = 1;
    if ((ret = avcodec_open2(movie->codec_ctx, codec, NULL)) < 0) {
        av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n");
        return ret;
    }
    movie->w = movie->codec_ctx->width;
    movie->h = movie->codec_ctx->height;
    av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
           movie->seek_point, movie->format_name, movie->file_name,
           movie->stream_index);
    return 0;
}
['static av_cold int movie_init(AVFilterContext *ctx)\n{\n    MovieContext *movie = ctx->priv;\n    AVInputFormat *iformat = NULL;\n    AVStream *st;\n    AVCodec *codec;\n    int ret;\n    int64_t timestamp;\n    av_register_all();\n    iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;\n    movie->format_ctx = NULL;\n    if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {\n        av_log(ctx, AV_LOG_ERROR,\n               "Failed to avformat_open_input \'%s\'\\n", movie->file_name);\n        return ret;\n    }\n    if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)\n        av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\\n");\n    if (movie->seek_point > 0) {\n        timestamp = movie->seek_point;\n        if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {\n            if (timestamp > INT64_MAX - movie->format_ctx->start_time) {\n                av_log(ctx, AV_LOG_ERROR,\n                       "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\\n",\n                       movie->file_name, movie->format_ctx->start_time, movie->seek_point);\n                return AVERROR(EINVAL);\n            }\n            timestamp += movie->format_ctx->start_time;\n        }\n        if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {\n            av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\\n",\n                   movie->file_name, timestamp);\n            return ret;\n        }\n    }\n    if ((ret = av_find_best_stream(movie->format_ctx, AVMEDIA_TYPE_VIDEO,\n                                   movie->stream_index, -1, NULL, 0)) < 0) {\n        av_log(ctx, AV_LOG_ERROR, "No video stream with index \'%d\' found\\n",\n               movie->stream_index);\n        return ret;\n    }\n    movie->stream_index = ret;\n    st = movie->format_ctx->streams[movie->stream_index];\n    codec = avcodec_find_decoder(st->codecpar->codec_id);\n    if (!codec) {\n        av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\\n");\n        return AVERROR(EINVAL);\n    }\n    movie->codec_ctx = avcodec_alloc_context3(codec);\n    if (!movie->codec_ctx)\n        return AVERROR(ENOMEM);\n    ret = avcodec_parameters_to_context(movie->codec_ctx, st->codecpar);\n    if (ret < 0)\n        return ret;\n    movie->codec_ctx->refcounted_frames = 1;\n    if ((ret = avcodec_open2(movie->codec_ctx, codec, NULL)) < 0) {\n        av_log(ctx, AV_LOG_ERROR, "Failed to open codec\\n");\n        return ret;\n    }\n    movie->w = movie->codec_ctx->width;\n    movie->h = movie->codec_ctx->height;\n    av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\\n",\n           movie->seek_point, movie->format_name, movie->file_name,\n           movie->stream_index);\n    return 0;\n}', 'void av_register_all(void)\n{\n    static int initialized;\n    if (initialized)\n        return;\n    initialized = 1;\n    avcodec_register_all();\n    REGISTER_MUXER   (A64,              a64);\n    REGISTER_DEMUXER (AAC,              aac);\n    REGISTER_MUXDEMUX(AC3,              ac3);\n    REGISTER_MUXER   (ADTS,             adts);\n    REGISTER_MUXDEMUX(ADX,              adx);\n    REGISTER_DEMUXER (AEA,              aea);\n    REGISTER_MUXDEMUX(AIFF,             aiff);\n    REGISTER_MUXDEMUX(AMR,              amr);\n    REGISTER_DEMUXER (ANM,              anm);\n    REGISTER_DEMUXER (APC,              apc);\n    REGISTER_DEMUXER (APE,              ape);\n    REGISTER_MUXDEMUX(ASF,              asf);\n    REGISTER_MUXDEMUX(ASS,              ass);\n    REGISTER_MUXER   (ASF_STREAM,       asf_stream);\n    REGISTER_MUXDEMUX(AU,               au);\n    REGISTER_MUXDEMUX(AVI,              avi);\n    REGISTER_DEMUXER (AVISYNTH,         avisynth);\n    REGISTER_MUXER   (AVM2,             avm2);\n    REGISTER_DEMUXER (AVS,              avs);\n    REGISTER_DEMUXER (BETHSOFTVID,      bethsoftvid);\n    REGISTER_DEMUXER (BFI,              bfi);\n    REGISTER_DEMUXER (BINK,             bink);\n    REGISTER_DEMUXER (BMV,              bmv);\n    REGISTER_DEMUXER (C93,              c93);\n    REGISTER_DEMUXER (CAF,              caf);\n    REGISTER_MUXDEMUX(CAVSVIDEO,        cavsvideo);\n    REGISTER_DEMUXER (CDG,              cdg);\n    REGISTER_DEMUXER (CDXL,             cdxl);\n    REGISTER_MUXER   (CRC,              crc);\n    REGISTER_MUXER   (DASH,             dash);\n    REGISTER_MUXDEMUX(DAUD,             daud);\n    REGISTER_DEMUXER (DFA,              dfa);\n    REGISTER_MUXDEMUX(DIRAC,            dirac);\n    REGISTER_MUXDEMUX(DNXHD,            dnxhd);\n    REGISTER_DEMUXER (DSICIN,           dsicin);\n    REGISTER_DEMUXER (DSS,              dss);\n    REGISTER_MUXDEMUX(DTS,              dts);\n    REGISTER_MUXDEMUX(DV,               dv);\n    REGISTER_DEMUXER (DXA,              dxa);\n    REGISTER_DEMUXER (EA,               ea);\n    REGISTER_DEMUXER (EA_CDATA,         ea_cdata);\n    REGISTER_MUXDEMUX(EAC3,             eac3);\n    REGISTER_MUXER   (F4V,              f4v);\n    REGISTER_MUXDEMUX(FFMETADATA,       ffmetadata);\n    REGISTER_MUXDEMUX(FILMSTRIP,        filmstrip);\n    REGISTER_MUXDEMUX(FLAC,             flac);\n    REGISTER_DEMUXER (FLIC,             flic);\n    REGISTER_MUXDEMUX(FLV,              flv);\n    REGISTER_DEMUXER (FOURXM,           fourxm);\n    REGISTER_MUXER   (FRAMECRC,         framecrc);\n    REGISTER_MUXER   (FRAMEMD5,         framemd5);\n    REGISTER_MUXDEMUX(G722,             g722);\n    REGISTER_MUXDEMUX(G723_1,           g723_1);\n    REGISTER_DEMUXER (G729,             g729);\n    REGISTER_MUXER   (GIF,              gif);\n    REGISTER_DEMUXER (GSM,              gsm);\n    REGISTER_MUXDEMUX(GXF,              gxf);\n    REGISTER_MUXDEMUX(H261,             h261);\n    REGISTER_MUXDEMUX(H263,             h263);\n    REGISTER_MUXDEMUX(H264,             h264);\n    REGISTER_MUXER   (HDS,              hds);\n    REGISTER_MUXDEMUX(HEVC,             hevc);\n    REGISTER_MUXDEMUX(HLS,              hls);\n    REGISTER_DEMUXER (HNM,              hnm);\n    REGISTER_DEMUXER (IDCIN,            idcin);\n    REGISTER_DEMUXER (IFF,              iff);\n    REGISTER_MUXDEMUX(ILBC,             ilbc);\n    REGISTER_MUXDEMUX(IMAGE2,           image2);\n    REGISTER_MUXDEMUX(IMAGE2PIPE,       image2pipe);\n    REGISTER_DEMUXER (INGENIENT,        ingenient);\n    REGISTER_DEMUXER (IPMOVIE,          ipmovie);\n    REGISTER_MUXER   (IPOD,             ipod);\n    REGISTER_MUXER   (ISMV,             ismv);\n    REGISTER_DEMUXER (ISS,              iss);\n    REGISTER_DEMUXER (IV8,              iv8);\n    REGISTER_MUXDEMUX(IVF,              ivf);\n    REGISTER_DEMUXER (JV,               jv);\n    REGISTER_MUXDEMUX(LATM,             latm);\n    REGISTER_DEMUXER (LMLM4,            lmlm4);\n    REGISTER_DEMUXER (LXF,              lxf);\n    REGISTER_MUXDEMUX(M4V,              m4v);\n    REGISTER_MUXER   (MD5,              md5);\n    REGISTER_MUXDEMUX(MATROSKA,         matroska);\n    REGISTER_MUXER   (MATROSKA_AUDIO,   matroska_audio);\n    REGISTER_MUXDEMUX(MJPEG,            mjpeg);\n    REGISTER_MUXDEMUX(MLP,              mlp);\n    REGISTER_DEMUXER (MM,               mm);\n    REGISTER_MUXDEMUX(MMF,              mmf);\n    REGISTER_MUXDEMUX(MOV,              mov);\n    REGISTER_MUXER   (MP2,              mp2);\n    REGISTER_MUXDEMUX(MP3,              mp3);\n    REGISTER_MUXER   (MP4,              mp4);\n    REGISTER_DEMUXER (MPC,              mpc);\n    REGISTER_DEMUXER (MPC8,             mpc8);\n    REGISTER_MUXER   (MPEG1SYSTEM,      mpeg1system);\n    REGISTER_MUXER   (MPEG1VCD,         mpeg1vcd);\n    REGISTER_MUXER   (MPEG1VIDEO,       mpeg1video);\n    REGISTER_MUXER   (MPEG2DVD,         mpeg2dvd);\n    REGISTER_MUXER   (MPEG2SVCD,        mpeg2svcd);\n    REGISTER_MUXER   (MPEG2VIDEO,       mpeg2video);\n    REGISTER_MUXER   (MPEG2VOB,         mpeg2vob);\n    REGISTER_DEMUXER (MPEGPS,           mpegps);\n    REGISTER_MUXDEMUX(MPEGTS,           mpegts);\n    REGISTER_DEMUXER (MPEGTSRAW,        mpegtsraw);\n    REGISTER_DEMUXER (MPEGVIDEO,        mpegvideo);\n    REGISTER_MUXDEMUX(MPJPEG,           mpjpeg);\n    REGISTER_DEMUXER (MSNWC_TCP,        msnwc_tcp);\n    REGISTER_DEMUXER (MTV,              mtv);\n    REGISTER_DEMUXER (MV,               mv);\n    REGISTER_DEMUXER (MVI,              mvi);\n    REGISTER_MUXDEMUX(MXF,              mxf);\n    REGISTER_MUXER   (MXF_D10,          mxf_d10);\n    REGISTER_DEMUXER (MXG,              mxg);\n    REGISTER_DEMUXER (NC,               nc);\n    REGISTER_DEMUXER (NSV,              nsv);\n    REGISTER_MUXER   (NULL,             null);\n    REGISTER_MUXDEMUX(NUT,              nut);\n    REGISTER_DEMUXER (NUV,              nuv);\n    REGISTER_MUXER   (OGA,              oga);\n    REGISTER_MUXDEMUX(OGG,              ogg);\n    REGISTER_MUXDEMUX(OMA,              oma);\n    REGISTER_MUXER   (OPUS,             opus);\n    REGISTER_DEMUXER (PAF,              paf);\n    REGISTER_MUXDEMUX(PCM_ALAW,         pcm_alaw);\n    REGISTER_MUXDEMUX(PCM_MULAW,        pcm_mulaw);\n    REGISTER_MUXDEMUX(PCM_F64BE,        pcm_f64be);\n    REGISTER_MUXDEMUX(PCM_F64LE,        pcm_f64le);\n    REGISTER_MUXDEMUX(PCM_F32BE,        pcm_f32be);\n    REGISTER_MUXDEMUX(PCM_F32LE,        pcm_f32le);\n    REGISTER_MUXDEMUX(PCM_S32BE,        pcm_s32be);\n    REGISTER_MUXDEMUX(PCM_S32LE,        pcm_s32le);\n    REGISTER_MUXDEMUX(PCM_S24BE,        pcm_s24be);\n    REGISTER_MUXDEMUX(PCM_S24LE,        pcm_s24le);\n    REGISTER_MUXDEMUX(PCM_S16BE,        pcm_s16be);\n    REGISTER_MUXDEMUX(PCM_S16LE,        pcm_s16le);\n    REGISTER_MUXDEMUX(PCM_S8,           pcm_s8);\n    REGISTER_MUXDEMUX(PCM_U32BE,        pcm_u32be);\n    REGISTER_MUXDEMUX(PCM_U32LE,        pcm_u32le);\n    REGISTER_MUXDEMUX(PCM_U24BE,        pcm_u24be);\n    REGISTER_MUXDEMUX(PCM_U24LE,        pcm_u24le);\n    REGISTER_MUXDEMUX(PCM_U16BE,        pcm_u16be);\n    REGISTER_MUXDEMUX(PCM_U16LE,        pcm_u16le);\n    REGISTER_MUXDEMUX(PCM_U8,           pcm_u8);\n    REGISTER_DEMUXER (PMP,              pmp);\n    REGISTER_MUXER   (PSP,              psp);\n    REGISTER_DEMUXER (PVA,              pva);\n    REGISTER_DEMUXER (QCP,              qcp);\n    REGISTER_DEMUXER (R3D,              r3d);\n    REGISTER_MUXDEMUX(RAWVIDEO,         rawvideo);\n    REGISTER_DEMUXER (RL2,              rl2);\n    REGISTER_MUXDEMUX(RM,               rm);\n    REGISTER_MUXDEMUX(ROQ,              roq);\n    REGISTER_DEMUXER (RPL,              rpl);\n    REGISTER_MUXDEMUX(RSO,              rso);\n    REGISTER_MUXDEMUX(RTP,              rtp);\n    REGISTER_MUXER   (RTP_MPEGTS,       rtp_mpegts);\n    REGISTER_MUXDEMUX(RTSP,             rtsp);\n    REGISTER_MUXDEMUX(SAP,              sap);\n    REGISTER_DEMUXER (SDP,              sdp);\n#if CONFIG_RTPDEC\n    ff_register_rtp_dynamic_payload_handlers();\n    ff_register_rdt_dynamic_payload_handlers();\n#endif\n    REGISTER_DEMUXER (SEGAFILM,         segafilm);\n    REGISTER_MUXER   (SEGMENT,          segment);\n    REGISTER_DEMUXER (SHORTEN,          shorten);\n    REGISTER_DEMUXER (SIFF,             siff);\n    REGISTER_DEMUXER (SMACKER,          smacker);\n    REGISTER_MUXDEMUX(SMJPEG,           smjpeg);\n    REGISTER_MUXER   (SMOOTHSTREAMING,  smoothstreaming);\n    REGISTER_DEMUXER (SMUSH,            smush);\n    REGISTER_DEMUXER (SOL,              sol);\n    REGISTER_MUXDEMUX(SOX,              sox);\n    REGISTER_MUXER   (SPX,              spx);\n    REGISTER_MUXDEMUX(SPDIF,            spdif);\n    REGISTER_MUXDEMUX(SRT,              srt);\n    REGISTER_DEMUXER (STR,              str);\n    REGISTER_MUXDEMUX(SWF,              swf);\n    REGISTER_DEMUXER (TAK,              tak);\n    REGISTER_MUXER   (TG2,              tg2);\n    REGISTER_MUXER   (TGP,              tgp);\n    REGISTER_DEMUXER (THP,              thp);\n    REGISTER_DEMUXER (TIERTEXSEQ,       tiertexseq);\n    REGISTER_DEMUXER (TMV,              tmv);\n    REGISTER_MUXDEMUX(TRUEHD,           truehd);\n    REGISTER_DEMUXER (TTA,              tta);\n    REGISTER_DEMUXER (TXD,              txd);\n    REGISTER_DEMUXER (TTY,              tty);\n    REGISTER_DEMUXER (VC1,              vc1);\n    REGISTER_MUXDEMUX(VC1T,             vc1t);\n    REGISTER_DEMUXER (VMD,              vmd);\n    REGISTER_MUXDEMUX(VOC,              voc);\n    REGISTER_DEMUXER (VQF,              vqf);\n    REGISTER_DEMUXER (W64,              w64);\n    REGISTER_MUXDEMUX(WAV,              wav);\n    REGISTER_DEMUXER (WC3,              wc3);\n    REGISTER_MUXER   (WEBM,             webm);\n    REGISTER_DEMUXER (WSAUD,            wsaud);\n    REGISTER_DEMUXER (WSVQA,            wsvqa);\n    REGISTER_DEMUXER (WTV,              wtv);\n    REGISTER_MUXDEMUX(WV,               wv);\n    REGISTER_DEMUXER (XA,               xa);\n    REGISTER_DEMUXER (XMV,              xmv);\n    REGISTER_DEMUXER (XWMA,             xwma);\n    REGISTER_DEMUXER (YOP,              yop);\n    REGISTER_MUXDEMUX(YUV4MPEGPIPE,     yuv4mpegpipe);\n}']