欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

【FFmpeg】截至ffmpeg4.2不赞成(Deprecate)继续使用的接口,以及代替它的接口汇总

程序员文章站 2022-03-09 20:18:32
...
1、问题描述

使用ffmpeg库写程序,编译时,经常报警告“xxx is deprecated”
查看源码时,该接口或结构体字段被标记attribute_deprecated,表示它已经过时,不推荐使用。
如:

attribute_deprecated
void avcodec_register(AVCodec *codec);

attribute_deprecated
void avcodec_register_all(void);
2、以下列出截至 FFmpeg 4.2 Deprecate的接口

详细内容请查看,FFmpeg源码中doc/APIchanges文档,该文档记录接口的变更:Add、Deprecate、Rename、Remove。

2018-04-03 - d6fc031caf - lavu 56.13.100 - pixdesc.h
  Deprecate AV_PIX_FMT_FLAG_PSEUDOPAL

2018-04-01 - f1805d160d - lavfi 7.14.100 - avfilter.h
  Deprecate use of avfilter_register(), avfilter_register_all(), avfilter_next().

2018-02-06 - 0694d87024 - lavf 58.9.100 - avformat.h
  Deprecate use of av_register_input_format(), av_register_output_format(), av_register_all(), av_iformat_next(), av_oformat_next().

2018-02-06 - 36c85d6e77 - lavc 58.10.100 - avcodec.h
  Deprecate use of avcodec_register(), avcodec_register_all(), av_codec_next(), av_register_codec_parser(), and av_parser_next().

2018-01-28 - ea3672b7d6 - lavf 58.7.100 - avformat.h
  Deprecate AVFormatContext filename field which had limited length, use the new dynamically allocated url field instead.

2018-01-16 - 6512ff72f9 - lavf 58.4.100 - avformat.h
  Deprecate AVStream.recommended_encoder_configuration. It was useful only for FFserver, which has been removed.

2018-01-05 - 798dcf2432 - lavfi 7.11.101 - avfilter.h
  Deprecate avfilter_link_get_channels(). Use av_buffersink_get_channels().

2017-01-04 - c29038f304 - lavr 4.0.0 - avresample.h
  Deprecate libavresample use libswresample.

2017-12-26 - a04c2c707d - lavc 58.9.100 - avcodec.h
  Deprecate av_lockmgr_register(). 

2017-11-26 - 3536a3efb9 - lavc 58.5.100 - avcodec.h
  Deprecate user visibility of the AVHWAccel structure and the functions  av_register_hwaccel() and av_hwaccel_next().

2017-09-26 - b1cf151c4d - lavc 57.106.102 - avcodec.h
  Deprecate AVCodecContext.refcounted_frames. 

2017-03-21 - d682ae70b4 - lavf 57.66.105, lavc 57.83.101 - avformat.h, avcodec.h
  Deprecate AVFMT_FLAG_KEEP_SIDE_DATA. 
  Deprecate av_packet_merge_side_data() and av_packet_split_side_data().

2017-03-18 - 3796fb2692 - lavfi 6.77.100 - avfilter.h
  Deprecate AVFilterGraph.resample_lavr_opts

2017-01-17 - 2a4a8653b6 - lavc 57.74.100 - vaapi.h
  Deprecate struct vaapi_context and the vaapi.h installed header.
  Callers should set AVCodecContext.hw_frames_ctx instead.

2016-04-17 - af9cac1 / 33d1898 - lavc 57.35.100 / 57.15.0 - avcodec.h
  Deprecate the old bitstream filtering API.

2016-04-11 - 6f69f7a / 9200514 - lavf 57.33.100 / 57.5.0 - avformat.h
  Deprecate AVStream.codec.

2015-12-22 - 39a09e9 - lavfi 6.21.101 - avfilter.h
  Deprecate avfilter_link_set_closed().

2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h
  Deprecate av_free_packet() use av_packet_unref() instead
  Deprecate av_dup_packet() use av_packet_ref() instead
  
2015-08-19 - 9f8e57ef - lavu 54.31.100 - pixfmt.h
  Deprecate old VA-API related pixel formats: AV_PIX_FMT_VAAPI_MOCO, AV_PIX_FMT_VAAPI_IDCT, AV_PIX_FMT_VAAPI_VLD.

2015-02-14 - ba22295 - lavc 56.21.102
  Deprecate VIMA decoder.

2014-10-13 - da21895 / 2df0c32e - lavc 56.5.100 / 56.3.0 - avcodec.h
  Deprecate the use of AVCodecContext.delay for audio encoding.

2014-09-19 - 6edd6a4 - lavc 56.1.101 - dv_profile.h
  deprecate avpriv_dv_frame_profile2(), which was made public by accident.

2014-08-08 - 3841f2a / d35b94f - lavc 55.73.102 / 55.57.4 - avcodec.h
  Deprecate FF_IDCT_XVIDMMX define and xvidmmx idct option. Replaced by FF_IDCT_XVID and xvid respectively.

2014-08-08 - 5c3c671 - lavf 55.53.100 - avio.h
  Deprecate url_feof().

2014-08-03 - 71d008e / 1ef9e83 - lavu 52.95.100 / 53.20.0 - frame.h
  Deprecate AVCodecContext.dtg_active_format and use side-data instead.

2014-08-03 - 9400603 / 9f17685 - lavc 55.71.101 / 55.57.1 - avcodec.h
  Deprecate unused FF_IDCT_IPP define and ipp avcodec option.
  Deprecate unused FF_DEBUG_PTS define and pts avcodec option.
  Deprecate unused FF_CODER_TYPE_DEFLATE define and deflate avcodec option.
  Deprecate unused FF_DCT_INT define and int avcodec option.
  Deprecate unused avcodec option scenechange_factor.

2014-05-19 - 999a99c / a312f71 - lavf 55.38.101 / 55.17.1 - avformat.h
  Deprecate AVStream.pts and the AVFrac struct

2014-05-01 - e77b985 / a2941c8 - lavc 55.60.103 / 55.50.3 - avcodec.h
  Deprecate CODEC_FLAG_MV0. 

2014-05-01 - e40ae8c / 6484149 - lavc 55.60.102 / 55.50.2 - avcodec.h
  Deprecate CODEC_FLAG_GMC. 

2014-05-01 - 1851643 / b2c3171 - lavc 55.60.101 / 55.50.1 - avcodec.h
  Deprecate CODEC_FLAG_NORMALIZE_AQP

2014-05-01 - cac07d0 / 5fcceda - avcodec.h
  Deprecate CODEC_FLAG_INPUT_PRESERVED.

2014-04-30 - 617e866 - lavu 52.81.100 - pixdesc.h
  Deprecate avcodec_get_pix_fmt_loss(), avcodec_find_best_pix_fmt_of_2()

2014-02-19 - f4c8d00 / 6bb8720 - lavu 52.64.101 / 53.3.1 - opt.h
  Deprecate unused AV_OPT_FLAG_METADATA.

2014-01-20 - eef74b2 / 93c553c - lavc 55.48.102 / 55.32.1 - avcodec.h
  Deprecate  CODEC_FLAG_EMU_EDGE and avcodec_get_edge_width().

2013-11-14 - b71e4d8 / 8941971 - lavc 55.43.100 / 55.27.0 - avcodec.h
  Deprecate AVCodecContext.error_rate.

2013-08-05 - 9547e3e / f824535 - lavc 55.22.100 / 55.13.0 - avcodec.h
  Deprecate the bitstream-related members from struct AVVDPAUContext.

2013-08-05 - 3b805dc / 549294f - lavc 55.21.100 / 55.12.0 - avcodec.h
  Deprecate the CODEC_CAP_HWACCEL_VDPAU codec capability. Use CODEC_CAP_HWACCEL
  and select the AV_PIX_FMT_VDPAU format with get_format() instead.

2013-08-05 - 4ee0984 / a0ad5d0 - lavu 52.41.100 / 52.14.0 - pixfmt.h
  Deprecate AV_PIX_FMT_VDPAU_*. Use AV_PIX_FMT_VDPAU instead.

2013-07-03 - 838bd73 - lavfi 3.78.100 - avfilter.h
  Deprecate avfilter_graph_parse() in favor of the equivalent avfilter_graph_parse_ptr().

2013-04-11 - lavfi 3.53.100 / 3.8.0
  Deprecate avfilterhraph.h use avfilter.h instead
  Deprecate avfilter_open() and avfilter_graph_add_filter().
  Deprecate avfilter_init_filter().
  Deprecate av_filter_next().
  Deprecate avfilter_uninit().

2013-03-16 - ecade98 / 42c7c61 - lavfi 3.47.100 / 3.6.0
  Deprecate AVFilterGraph.filter_count.

2013-03-08 - Reference counted buffers - lavu 52.8.0, lavc 55.0.100 / 55.0.0, lavf 55.0.100 / 55.0.0,
lavd 54.4.100 / 54.0.0, lavfi 3.5.0
            Deprecate AVCodecContext.get_buffer() / release_buffer() /
            reget_buffer(), avcodec_default_get_buffer(),
            avcodec_default_reget_buffer(), avcodec_default_release_buffer().
            Remove avcodec_default_free_buffers(), which should not have ever
            been called from outside of lavc.
            Deprecate the following AVFrame fields:
                * base -- is now stored in AVBufferRef
                * reference, type, buffer_hints -- are unnecessary in the new API
                * hwaccel_picture_private, owner, thread_opaque -- should not
                  have been accessed from outside of lavc
                * qscale_table, qstride, qscale_type, mbskip_table, motion_val,
                  mb_type, dct_coeff, ref_index -- mpegvideo-specific tables,
                  which are not exported anymore.
  a05a44e / 7e35037 - Deprecate av_buffersrc_buffer().
            deprecate av_buffersink_read() and av_buffersink_read_samples().
            Deprecate AVFilterBufferRef and all functions for working with it.

2012-12-29 - lavu 52.13.100 / 52.3.0 - avstring.h
  deprecate avcodec_get_chroma_sub_sample.

2012-06-12 - c7b9eab / 9baeff9 - lavfi 2.79.100 / 2.23.0 - avfilter.h
  Deprecate   AVFilterContext.input/output_count.

2012-05-15 - lavfi 2.74.100 / 2.17.0 1cbf7fb / 720c6b7 - 
  Deprecate av_vsrc_buffer_add_frame()

2012-03-20 - 0ebd836 / 3c90cc2 - lavfo 54.2.0
  Deprecate av_read_packet(), use av_read_frame() with
  AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN in AVFormatContext.flags

2012-02-08 - f2b20b7 / 52f82a1 - lavc 54.2.100 / 54.1.0
  Deprecate avcodec_encode_video().

2012-01-15 - lavc 53.56.105 / 53.34.0
  deprecate avcodec_encode_audio(). 

2011-12-18 - 7c29313 / 8400b12 - lavc 53.46.1 / 53.28.1
  Deprecate AVFrame.age. 

2011-12-12 - 8bc7fe4 / 5266045 - lavf 53.25.0 / 53.17.0
  Deprecate av_close_input_file() and av_close_input_stream().

2011-12-02 - e4de716 / 0eea212 - lavc 53.40.0 / 53.25.0
  Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE.
  Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4().
  avcodec_decode_audio4() writes output samples to an AVFrame, which allows
  audio decoders to use get_buffer().

2011-10-27 - 6faf0a2 / 512557b - lavc 53.24.0 / 53.15.0
  Remove avcodec_parse_frame.
  Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.

2011-10-19 - d049257 / 569129a - lavf 53.17.0 / 53.10.0
  Deprecate av_new_stream().

2011-09-06 - c4415f6 - lavfi 2.38.0
  deprecate av_vsink_buffer_get_video_buffer_ref()

2011-08-14 - 323b930 - lavu 51.12.0
  deprecate av_fifo_peek().

2011-07-10 - 3602ad7 / a67c061 - lavf 53.6.0
  deprecate av_find_stream_info().

2011-07-10 - 3602ad7 / 0b950fe - lavc 53.8.0
  deprecate avcodec_open().
  Deprecate avcodec_alloc_context() and avcodec_alloc_context2().

2011-06-16 - 2905e3f / 05e84c9, 2905e3f / 25de595 - lavf 53.4.0 / 53.2.0 - avformat.h
  Deprecate av_open_input_stream, av_open_input_file, AVFormatParameters and av_write_header.

2011-06-16 - 2905e3f / 7e83e1c, 2905e3f / dc59ec5 - lavu 51.9.0 / 51.7.0 - opt.h
  Deprecate av_find_opt().

2011-06-07 - d552f61 / a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
  Deprecate av_get_bits_per_sample_fmt().


2011-05-28 - e71f260 - lavu 51.3.0 - pixdesc.h
  deprecate  avcodec_get_pix_fmt_name()

2011-05-22 - 5ecdfd0 - lavf 53.2.0 - avformat.h
  eprecate  avformat_alloc_output_context().

2011-05-10 - 59eb12f / 188dea1 - lavc 53.6.0 - avcodec.h
  Deprecate AVLPCType and the following fields in AVCodecContext: 
	lpc_coeff_precision, prediction_order_method,
	min_partition_order, max_partition_order, lpc_type, lpc_passes.
  Corresponding FLAC encoder options should be used instead.

2011-04-26 - d7e5aeb / bebe72f - lavu 51.1.0 - avutil.h
  deprecate FF_*_TYPE defines and av_get_pict_type_char() defined in libavcodec/avcodec.h.

2011-04-12 - lavf 52.107.0 - avio.h
  Avio cleanup, part II - deprecate the entire URLContext API:
    c55780d / 175389c add avio_check as a replacement for url_exist
    9891004 / ff1ec0c add avio_pause and avio_seek_time as replacements
            for _av_url_read_fseek/fpause
    d4d0932 / cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
            should be used instead.
    c88caa5 / 80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
    c88caa5 / f87b1b3 rename open flags: URL_* -> AVIO_*
    d4d0932 / 5593f03 deprecate URLProtocol.
    d4d0932 / c486dad deprecate URLContext.
    d4d0932 / 026e175 deprecate the typedef for URLInterruptCB
    c88caa5 / 8e76a19 deprecate av_register_protocol2.
    11d7841 / b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
    11d7841 / 1305d93 deprecate av_url_read_seek
    11d7841 / fa104e1 deprecate av_url_read_pause
    434f248 / 727c7aa deprecate url_get_filename().
    434f248 / 5958df3 deprecate url_max_packet_size().
    434f248 / 1869ea0 deprecate url_get_file_handle().
    434f248 / 32a97d4 deprecate url_filesize().
    434f248 / e52a914 deprecate url_close().
    434f248 / 58a48c6 deprecate url_seek().
    434f248 / 925e908 deprecate url_write().
    434f248 / dce3756 deprecate url_read_complete().
    434f248 / bc371ac deprecate url_read().
    434f248 / 0589da0 deprecate url_open().
    434f248 / 62eaaea deprecate url_connect.
    434f248 / 5652bb9 deprecate url_alloc.
    434f248 / 333e894 deprecate url_open_protocol
    434f248 / e230705 deprecate url_poll and URLPollEntry

2011-04-08 - lavf 52.106.0 - avformat.h
  Minor avformat.h cleanup:
    d4d0932 / a9bf9d8 deprecate av_guess_image2_codec
    d4d0932 / c3675df rename avf_sdp_create->av_sdp_create

2011-04-03 - lavf 52.105.0 - avio.h
  Large-scale renaming/deprecating of AVIOContext-related functions:
    2cae980 / 724f6a0 deprecate url_fdopen
    2cae980 / 403ee83 deprecate url_open_dyn_packet_buf
    2cae980 / 6dc7d80 rename url_close_dyn_buf       -> avio_close_dyn_buf
    2cae980 / b92c545 rename url_open_dyn_buf        -> avio_open_dyn_buf
    1caa412 / b64030f deprecate get_checksum()
    1caa412 / 4c4427a deprecate init_checksum()
    2fd41c9 / 4ec153b deprecate udp_set_remote_url/get_local_port
    4fa0e24 / 933e90a deprecate av_url_read_fseek/fpause
    4fa0e24 / 8d9769a deprecate url_fileno
    0fecf26 / b7f2fdd rename put_flush_packet -> avio_flush
    0fecf26 / 35f1023 deprecate url_close_buf
    0fecf26 / 83fddae deprecate url_open_buf
    0fecf26 / d9d86e0 rename url_fprintf -> avio_printf
    0fecf26 / 59f65d9 deprecate url_setbufsize
    6947b0c / 3e68b3b deprecate url_ferror
    e8bb2e2 deprecate url_fget_max_packet_size
    76aa876 rename url_fsize -> avio_size
    e519753 deprecate url_fgetc
    655e45e deprecate url_fgets
    a2704c9 rename url_ftell -> avio_tell
    e16ead0 deprecate get_strz() in favor of avio_get_str
    0300db8,2af07d3 rename url_fskip -> avio_skip
    6b4aa5d rename url_fseek -> avio_seek
    61840b4 deprecate put_tag
    22a3212 rename url_fopen/fclose -> avio_open/close.
    0ac8e2b deprecate put_nbyte
    77eb550 rename put_byte          -> avio_w8
                   put_[b/l]e<type>  -> avio_w[b/l]<type>
                   put_buffer        -> avio_write
    b7effd4 rename get_byte          -> avio_r8,
                   get_[b/l]e<type>  -> avio_r[b/l]<type>
                   get_buffer        -> avio_read
    b3db9ce deprecate get_partial_buffer
    8d9ac96 rename av_alloc_put_byte -> avio_alloc_context

2011-03-02 - 863c471 - lavf  52.103.0 - av_pkt_dump2, av_pkt_dump_log2
   Deprecate av_pkt_dump and av_pkt_dump_log.

2011-02-09 - c0b102c - lavc 52.112.0 - avcodec_thread_init()
  Deprecate avcodec_thread_init()/avcodec_thread_free() use; instead set thread_count before calling avcodec_open.

2011-02-02 - lavf 52.95.0
  Deprecate corresponding semi-public {put,get}_str*.

2011-01-07 - 81c623f - lavc 52.107.0 - deprecate reordered_opaque
  Deprecate reordered_opaque in favor of pkt_pts/dts.

2010-12-04 - bb4afa1 - lavu 50.34.0 - av_get_pix_fmt_string()
  Deprecate avcodec_pix_fmt_string() in favor of pixdesc.h/av_get_pix_fmt_string().

2010-11-21 - 176a615 - lavcore 0.14.0 - audioconvert.h
  deprecate the corresponding functions in libavcodec:
	avcodec_get_channel_name()
	avcodec_get_channel_layout()
	avcodec_get_channel_layout_string()
	avcodec_channel_layout_num_channels()
	and the CH_* macros defined in libavcodec/avcodec.h.

2010-11-08 - d2af720 - lavu 50.33.0 - eval.h
  Deprecate functions:
	av_parse_and_eval_expr(),
	av_parse_expr(),
	av_eval_expr(),
	av_free_expr(),
  in favor of the functions:
	av_expr_parse_and_eval(),
	av_expr_parse(),
	av_expr_eval(),
	av_expr_free().

2010-11-02 - 6f84cd1 - lavcore 0.12.0 - av_get_bits_per_sample_fmt()
  deprecate av_get_bits_per_sample_format().

2010-11-02 - d63e456 - lavcore 0.11.0 - samplefmt.h
  deprecate the corresponding libavcodec/audioconvert.h functions:
	avcodec_get_sample_fmt_name(),
	avcodec_get_sample_fmt(),
	avcodec_sample_fmt_string().

2010-11-02 - 262d1c5 - lavcore 0.10.0 - samplefmt.h
  deprecate enum SampleFormat.

2010-10-15 - 03700d3 - lavf 52.83.0 - metadata API
  Deprecate the public conversion API.

2010-09-24 - f66eb58 - lavc 52.90.0 - av_opt_show2()
  Deprecate av_opt_show() in favor or av_opt_show2().

2010-09-04 - 7160bb7 - lavu 50.25.0 - AV_CPU_FLAG_*
  Deprecate the FF_MM_* flags defined in libavcodec/avcodec.h in favor of the AV_CPU_FLAG_* flags defined in libavutil/cpu.h.

2010-08-06 - bf176f5 - lavcore 0.3.0 - av_check_image_size()
  Deprecate avcodec_check_dimensions() in favor of the function av_check_image_size() defined in libavcore/imgutils.h.

2010-07-27 - 126b638 - lavcore 0.1.0 - parseutils.h
  Deprecate av_parse_video_frame_size() and av_parse_video_frame_rate()
  defined in libavcodec in favor of the newly added functions
  av_parse_video_size() and av_parse_video_rate() declared in
  libavcore/parseutils.h.

2010-07-11 - 23940f1 - lavc 52.83.0
  Add AVCodecContext.lpc_type and AVCodecContext.lpc_passes fields.
  Add AVLPCType enum.
  Deprecate AVCodecContext.use_lpc.

2009-04-11 - 80d403f - lavc 52.25.0 - 
  deprecate av_destruct_packet_nofree() use NULL instead.
相关标签: 视频