ffmpeg新旧接口,新旧函数替换

ffmpeg每个版本的更新都可能会有新旧接口的更替,从而在使用新版的ffmpeg开发包编译旧版的代码时就会出现:******was not  declared in this scope或者**找不到标志符之类的错误。解决办法就是使用新版的函数替代这些旧版本的函数。在每个版本发布时,ffmpeg的源码包的doc文件夹中都有一个APIchanges文件,这中间记录了新版本中间函数的变更。ffmpeg的源码包在下载页的右边get sourece处的 download snapshot可以下载。

下面列出了ffmpeg2.2到2015-7-22(2.7)期间的接口变更情况,希望对大家有所帮助(人懒,没有翻译了)

2015-xx-xx - lavc 56.35.0 - avcodec.h
  xxxxxxxxx - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
  xxxxxxxxx - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
  xxxxxxxxx - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
              to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.

2015-07-22 - c40ecff - lavc 56.51.100 - avcodec.h
  Add AV_PKT_DATA_QUALITY_STATS to export the quality value, PSNR, and pict_type
  of an AVPacket.

2015-07-16 - 8dad213 - lavc 56.49.100
  Add av_codec_get_codec_properties(), FF_CODEC_PROPERTY_LOSSLESS
  and FF_CODEC_PROPERTY_CLOSED_CAPTIONS

2015-07-03 - d563e13 / 83212943 - lavu 54.28.100 / 56.15.0
  Add av_version_info().

-------- 8< --------- FFmpeg 2.7 was cut here -------- 8< ---------

2015-06-04 - cc17b43 - lswr  1.2.100
  Add swr_get_out_samples()

2015-05-27 - c312bfa - lavu 54.26.100 - cpu.h
  Add AV_CPU_FLAG_AVXSLOW.

2015-05-26 - 1fb9b2a - lavu 54.25.100 - rational.h
  Add av_q2intfloat().

2015-05-13 - cc48409 / e7c5e17 - lavc 56.39.100 / 56.23.0
  Add av_vda_default_init2.

2015-05-11 - 541d75f - lavf 56.33.100 - avformat.h
  Add AVOpenCallback AVFormatContext.open_cb

2015-05-07 - a7dd933 - 56.38.100 - avcodec.h
  Add av_packet_side_data_name().

2015-05-07 - 01e59d4 - 56.37.102 - avcodec.h
  Add FF_PROFILE_VP9_2 and FF_PROFILE_VP9_3.

2015-05-04 - 079b7f6 - 56.37.100 - avcodec.h
  Add FF_PROFILE_VP9_0 and FF_PROFILE_VP9_1.

2015-04-22 - 748d481 - lavf 56.31.100 - avformat.h
  Add AVFMT_FLAG_FAST_SEEK flag. Some formats (initially mp3) use it to enable
  fast, but inaccurate seeking.

2015-04-20 - 8e8219e / c253340 - lavu 54.23.100 / 54.12.0 - log.h
  Add AV_LOG_TRACE for extremely verbose debugging.

2015-04-02 - 26e0e393 - lavf 56.29.100 - avio.h
  Add AVIODirEntryType.AVIO_ENTRY_SERVER.
  Add AVIODirEntryType.AVIO_ENTRY_SHARE.
  Add AVIODirEntryType.AVIO_ENTRY_WORKGROUP.

2015-03-31 - 3188696 - lavu 54.22.100 - avstring.h
  Add av_append_path_component()

2015-03-27 - 184084c - lavf 56.27.100 - avio.h url.h
  New directory listing API.

  Add AVIODirEntryType enum.
  Add AVIODirEntry, AVIODirContext structures.
  Add avio_open_dir(), avio_read_dir(), avio_close_dir(), avio_free_directory_entry().
  Add ff_alloc_dir_entry().
  Extend URLProtocol with url_open_dir(), url_read_dir(), url_close_dir().

2015-03-29 - 268ff17 / c484561 - lavu 54.21.100 / 54.10.0 - pixfmt.h
  Add AV_PIX_FMT_MMAL for MMAL hardware acceleration.

2015-03-19 - 11fe56c - 56.29.100 / lavc 56.22.0
  Add FF_PROFILE_DTS_EXPRESS.

-------- 8< --------- FFmpeg 2.6 was cut here -------- 8< ---------

2015-03-04 - cca4476 - lavf 56.25.100
  Add avformat_flush()

2015-03-03 - 81a9126 - lavf 56.24.100
  Add avio_put_str16be()

2015-02-19 - 560eb71 / 31d2039 - lavc 56.23.100 / 56.13.0
  Add width, height, coded_width, coded_height and format to
  AVCodecParserContext.

2015-02-19 - e375511 / 5b1d9ce - lavu 54.19.100 / 54.9.0
  Add AV_PIX_FMT_QSV for QSV hardware acceleration.

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

2015-01-27 - 62a82c6 / 728685f - lavc 56.21.100 / 56.12.0, lavu 54.18.100 / 54.8.0 - avcodec.h, frame.h
  Add AV_PKT_DATA_AUDIO_SERVICE_TYPE and AV_FRAME_DATA_AUDIO_SERVICE_TYPE for
  storing the audio service type as side data.

2015-01-16 - a47c933 - lavf 56.19.100 - avformat.h
  Add data_codec and data_codec_id for storing codec of data stream

2015-01-11 - 007c33d - lavd 56.4.100 - avdevice.h
  Add avdevice_list_input_sources().
  Add avdevice_list_output_sinks().

2014-12-25 - d7aaeea / c220a60 - lavc 56.19.100 / 56.10.0 - vdpau.h
  Add av_vdpau_get_surface_parameters().

2014-12-25 - ddb9a24 / 6c99c92 - lavc 56.18.100 / 56.9.0 - avcodec.h
  Add AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH flag to av_vdpau_bind_context().

2014-12-25 - d16079a / 57b6704 - lavc 56.17.100 / 56.8.0 - avcodec.h
  Add AVCodecContext.sw_pix_fmt.

2014-12-04 - 6e9ac02 - lavc 56.14.100 - dv_profile.h
  Add av_dv_codec_profile2().

-------- 8< --------- FFmpeg 2.5 was cut here -------- 8< ---------

2014-11-21 - ab922f9 - lavu 54.15.100 - dict.h
   Add av_dict_get_string().

2014-11-18 - a54a51c - lavu 54.14.100 - float_dsp.h
  Add avpriv_float_dsp_alloc().

2014-11-16 - 6690d4c3 - lavf 56.13.100 - avformat.h
  Add AVStream.recommended_encoder_configuration with accessors.

2014-11-16 - bee5844d - lavu 54.13.100 - opt.h
  Add av_opt_serialize().

2014-11-16 - eec69332 - lavu 54.12.100 - opt.h
  Add av_opt_is_set_to_default().

2014-11-06 - 44fa267 / 5e80fb7 - lavc 56.11.100 / 56.6.0 - vorbis_parser.h
  Add a public API for parsing vorbis packets.

2014-10-15 - 17085a0 / 7ea1b34 - lavc 56.7.100 / 56.5.0 - avcodec.h
  Replace AVCodecContext.time_base used for decoding
  with AVCodecContext.framerate.

2014-10-15 - 51c810e / d565fef1 - lavc 56.6.100 / 56.4.0 - avcodec.h
  Add AV_HWACCEL_FLAG_IGNORE_LEVEL flag to av_vdpau_bind_context().

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

2014-10-08 - bb44f7d / 5a419b2 - lavu 54.10.100 / 54.4.0 - pixdesc.h
  Add API to return the name of frame and context color properties.

2014-10-06 - a61899a / e3e158e - lavc 56.3.100 / 56.2.0 - vdpau.h
  Add av_vdpau_bind_context(). This function should now be used for creating
  (or resetting) a AVVDPAUContext instead of av_vdpau_alloc_context().

2014-10-02 - cdd6f05 - lavc 56.2.100 - avcodec.h
2014-10-02 - cdd6f05 - lavu 54.9.100 - frame.h
  Add AV_FRAME_DATA_SKIP_SAMPLES. Add lavc CODEC_FLAG2_SKIP_MANUAL and
  AVOption "skip_manual", which makes lavc export skip information via
  AV_FRAME_DATA_SKIP_SAMPLES AVFrame side data, instead of skipping and
  discarding samples automatically.

2014-10-02 - 0d92b0d - lavu 54.8.100 - avstring.h
  Add av_match_list()

2014-09-24 - ac68295 - libpostproc 53.1.100
  Add visualization support

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


-------- 8< --------- FFmpeg 2.4 was cut here -------- 8< ---------

2014-08-25 - 215db29 / b263f8f - lavf 56.3.100 / 56.3.0 - avformat.h
  Add AVFormatContext.max_ts_probe.

2014-08-28 - f30a815 / 9301486 - lavc 56.1.100 / 56.1.0 - avcodec.h
  Add AV_PKT_DATA_STEREO3D to export container-level stereo3d information.

2014-08-23 - 8fc9bd0 - lavu 54.7.100 - dict.h
  AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL arguments are now
  freed even on error. This is consistent with the behaviour all users
  of it we could find expect.

2014-08-21 - 980a5b0 - lavu 54.6.100 - frame.h motion_vector.h
  Add AV_FRAME_DATA_MOTION_VECTORS side data and AVMotionVector structure

2014-08-16 - b7d5e01 - lswr 1.1.100 - swresample.h
  Add AVFrame based API

2014-08-16 - c2829dc - lavu 54.4.100 - dict.h
  Add av_dict_set_int helper function.

2014-08-13 - c8571c6 / 8ddc326 - lavu 54.3.100 / 54.3.0 - mem.h
  Add av_strndup().

2014-08-13 - 2ba4577 / a8c104a - lavu 54.2.100 / 54.2.0 - opt.h
  Add av_opt_get_dict_val/set_dict_val with AV_OPT_TYPE_DICT to support
  dictionary types being set as options.

2014-08-13 - afbd4b8 - lavf 56.01.0 - avformat.h
  Add AVFormatContext.event_flags and AVStream.event_flags for signaling to
  the user when events happen in the file/stream.

2014-08-10 - 78eaaa8 / fb1ddcd - lavr 2.1.0 - avresample.h
  Add avresample_convert_frame() and avresample_config().

2014-08-10 - 78eaaa8 / fb1ddcd - lavu 54.1.100 / 54.1.0 - error.h
  Add AVERROR_INPUT_CHANGED and AVERROR_OUTPUT_CHANGED.

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
  Add avio_feof() and deprecate url_feof().

2014-08-07 - bb78903 - lsws 2.1.3 - swscale.h
  sws_getContext is not going to be removed in the future.

2014-08-07 - a561662 / ad1ee5f - lavc 55.73.101 / 55.57.3 - avcodec.h
  reordered_opaque is not going to be removed in the future.

2014-08-02 - 28a2107 - lavu 52.98.100 - pixelutils.h
  Add pixelutils API with SAD functions

2014-08-04 - 6017c98 / e9abafc - lavu 52.97.100 / 53.22.0 - pixfmt.h
  Add AV_PIX_FMT_YA16 pixel format for 16 bit packed gray with alpha.

2014-08-04 - 4c8bc6f / e96c3b8 - lavu 52.96.101 / 53.21.1 - avstring.h
  Rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8 to better identify the format.
  An alias pixel format and color space name are provided for compatibility.

2014-08-04 - 073c074 / d2962e9 - lavu 52.96.100 / 53.21.0 - pixdesc.h
  Support name aliases for pixel formats.

2014-08-03 - 71d008e / 1ef9e83 - lavc 55.72.101 / 55.57.2 - avcodec.h
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 - e680c73 - lavc 55.72.100 - avcodec.h
  Add get_pixels() to AVDCT

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-07-30 - ba3e331 - lavu 52.94.100 - frame.h
  Add av_frame_side_data_name()

2014-07-29 - 80a3a66 / 3a19405 - lavf 56.01.100 / 56.01.0 - avformat.h
  Add mime_type field to AVProbeData, which now MUST be initialized in
  order to avoid uninitialized reads of the mime_type pointer, likely
  leading to crashes.
  Typically, this means you will do 'AVProbeData pd = { 0 };' instead of
  'AVProbeData pd;'.

2014-07-29 - 31e0b5d / 69e7336 - lavu 52.92.100 / 53.19.0 - avstring.h
  Make name matching function from lavf public as av_match_name().

2014-07-28 - 2e5c8b0 / c5fca01 - lavc 55.71.100 / 55.57.0 - avcodec.h
  Add AV_CODEC_PROP_REORDER to mark codecs supporting frame reordering.

2014-07-27 - ff9a154 - lavf 55.50.100 - avformat.h
  New field int64_t probesize2 instead of deprecated
  field int probesize.

2014-07-27 - 932ff70 - lavc 55.70.100 - avdct.h
  Add AVDCT / avcodec_dct_alloc() / avcodec_dct_init().

2014-07-23 - 8a4c086 - lavf 55.49.100 - avio.h
  Add avio_read_to_bprint()


-------- 8< --------- FFmpeg 2.3 was cut here -------- 8< ---------

2014-07-14 - 62227a7 - lavf 55.47.100 - avformat.h
  Add av_stream_get_parser()

2014-07-09 - c67690f / a54f03b - lavu 52.92.100 / 53.18.0 - display.h
  Add av_display_matrix_flip() to flip the transformation matrix.

2014-07-09 - 1b58f13 / f6ee61f - lavc 55.69.100 / 55.56.0 - dv_profile.h
  Add a public API for DV profile handling.

2014-06-20 - 0dceefc / 9e500ef - lavu 52.90.100 / 53.17.0 - imgutils.h
  Add av_image_check_sar().

2014-06-20 - 4a99333 / 874390e - lavc 55.68.100 / 55.55.0 - avcodec.h
  Add av_packet_rescale_ts() to simplify timestamp conversion.

2014-06-18 - ac293b6 / 194be1f - lavf 55.44.100 / 55.20.0 - avformat.h
  The proper way for providing a hint about the desired timebase to the muxers
  is now setting AVStream.time_base, instead of AVStream.codec.time_base as was
  done previously. The old method is now deprecated.

2014-06-11 - 67d29da - lavc 55.66.101 - avcodec.h
  Increase FF_INPUT_BUFFER_PADDING_SIZE to 32 due to some corner cases needing
  it

2014-06-10 - 5482780 - lavf 55.43.100 - avformat.h
  New field int64_t max_analyze_duration2 instead of deprecated
  int max_analyze_duration.

2014-05-30 - 00759d7 - lavu 52.89.100 - opt.h
  Add av_opt_copy()

2014-06-01 - 03bb99a / 0957b27 - lavc 55.66.100 / 55.54.0 - avcodec.h
  Add AVCodecContext.side_data_only_packets to allow encoders to output packets
  with only side data. This option may become mandatory in the future, so all
  users are recommended to update their code and enable this option.

2014-06-01 - 6e8e9f1 / 8c02adc - lavu 52.88.100 / 53.16.0 - frame.h, pixfmt.h
  Move all color-related enums (AVColorPrimaries, AVColorSpace, AVColorRange,
  AVColorTransferCharacteristic, and AVChromaLocation) inside lavu.
  And add AVFrame fields for them.

2014-05-29 - bdb2e80 / b2d4565 - lavr 1.3.0 - avresample.h
  Add avresample_max_output_samples

2014-05-28 - d858ee7 / 6d21259 - lavf 55.42.100 / 55.19.0 - avformat.h
  Add strict_std_compliance and related AVOptions to support experimental
  muxing.

2014-05-26 - 55cc60c - lavu 52.87.100 - threadmessage.h
  Add thread message queue API.

2014-05-26 - c37d179 - lavf 55.41.100 - avformat.h
  Add format_probesize to AVFormatContext.

2014-05-20 - 7d25af1 / c23c96b - lavf 55.39.100 / 55.18.0 - avformat.h
  Add av_stream_get_side_data() to access stream-level side data
  in the same way as av_packet_get_side_data().

2014-05-20 - 7336e39 - lavu 52.86.100 - fifo.h
  Add av_fifo_alloc_array() function.

2014-05-19 - ef1d4ee / bddd8cb - lavu 52.85.100 / 53.15.0 - frame.h, display.h
  Add AV_FRAME_DATA_DISPLAYMATRIX for exporting frame-level
  spatial rendering on video frames for proper display.

2014-05-19 - ef1d4ee / bddd8cb - lavc 55.64.100 / 55.53.0 - avcodec.h
  Add AV_PKT_DATA_DISPLAYMATRIX for exporting packet-level
  spatial rendering on video frames for proper display.

2014-05-19 - 999a99c / a312f71 - lavf 55.38.101 / 55.17.1 - avformat.h
  Deprecate AVStream.pts and the AVFrac struct, which was its only use case.
  See use av_stream_get_end_pts()

2014-05-18 - 68c0518 / fd05602 - lavc 55.63.100 / 55.52.0 - avcodec.h
  Add avcodec_free_context(). From now on it should be used for freeing
  AVCodecContext.

2014-05-17 - 0eec06e / 1bd0bdc - lavu 52.84.100 / 54.5.0 - time.h
  Add av_gettime_relative() av_gettime_relative_is_monotonic()

2014-05-15 - eacf7d6 / 0c1959b - lavf 55.38.100 / 55.17.0 - avformat.h
  Add AVFMT_FLAG_BITEXACT flag. Muxers now use it instead of checking
  CODEC_FLAG_BITEXACT on the first stream.

2014-05-15 - 96cb4c8 - lswr 0.19.100 - swresample.h
  Add swr_close()

2014-05-11 - 14aef38 / 66e6c8a - lavu 52.83.100 / 53.14.0 - pixfmt.h
  Add AV_PIX_FMT_VDA for new-style VDA acceleration.

2014-05-07 - 351f611 - lavu 52.82.100 - fifo.h
  Add av_fifo_freep() function.

2014-05-02 - ba52fb11 - lavu 52.81.100 - opt.h
  Add av_opt_set_dict2() function.

2014-05-01 - e77b985 / a2941c8 - lavc 55.60.103 / 55.50.3 - avcodec.h
  Deprecate CODEC_FLAG_MV0. It is replaced by the flag "mv0" in the
  "mpv_flags" private option of the mpegvideo encoders.

2014-05-01 - e40ae8c / 6484149 - lavc 55.60.102 / 55.50.2 - avcodec.h
  Deprecate CODEC_FLAG_GMC. It is replaced by the "gmc" private option of the
  libxvid encoder.

2014-05-01 - 1851643 / b2c3171 - lavc 55.60.101 / 55.50.1 - avcodec.h
  Deprecate CODEC_FLAG_NORMALIZE_AQP. It is replaced by the flag "naq" in the
  "mpv_flags" private option of the mpegvideo encoders.

2014-05-01 - cac07d0 / 5fcceda - avcodec.h
  Deprecate CODEC_FLAG_INPUT_PRESERVED. Its functionality is replaced by passing
  reference-counted frames to encoders.

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

2014-04-29 - 1bf6396 - lavc 55.60.100 - avcodec.h
  Add AVCodecDescriptor.mime_types field.

2014-04-29 - b804eb4 - lavu 52.80.100 - hash.h
  Add av_hash_final_bin(), av_hash_final_hex() and av_hash_final_b64().

2014-03-07 - 8b2a130 - lavc 55.50.0 / 55.53.100 - dxva2.h
  Add FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO for old Intel GPUs.

2014-04-22 - 502512e /dac7e8a - lavu 53.13.0 / 52.78.100 - avutil.h
  Add av_get_time_base_q().

2014-04-17 - a8d01a7 / 0983d48 - lavu 53.12.0 / 52.77.100 - crc.h
  Add AV_CRC_16_ANSI_LE crc variant.

2014-04-15 - ef818d8 - lavf 55.37.101 - avformat.h
  Add av_format_inject_global_side_data()

2014-04-12 - 4f698be - lavu 52.76.100 - log.h
  Add av_log_get_flags()

2014-04-11 - 6db42a2b - lavd 55.12.100 - avdevice.h
  Add avdevice_capabilities_create() function.
  Add avdevice_capabilities_free() function.

2014-04-07 - 0a1cc04 / 8b17243 - lavu 52.75.100 / 53.11.0 - pixfmt.h
  Add AV_PIX_FMT_YVYU422 pixel format.

2014-04-04 - c1d0536 / 8542f9c - lavu 52.74.100 / 53.10.0 - replaygain.h
  Full scale for peak values is now 100000 (instead of UINT32_MAX) and values
  may overflow.

2014-04-03 - c16e006 / 7763118 - lavu 52.73.100 / 53.9.0 - log.h
  Add AV_LOG(c) macro to have 256 color debug messages.

2014-04-03 - eaed4da9 - lavu 52.72.100 - opt.h
  Add AV_OPT_MULTI_COMPONENT_RANGE define to allow return
  multi-component option ranges.

2014-03-29 - cd50a44b - lavu 52.70.100 - mem.h
  Add av_dynarray_add_nofree() function.

2014-02-24 - 3e1f241 / d161ae0 - lavu 52.69.100 / 53.8.0 - frame.h
  Add av_frame_remove_side_data() for removing a single side data
  instance from a frame.

2014-03-24 - 83e8978 / 5a7e35d - lavu 52.68.100 / 53.7.0 - frame.h, replaygain.h
  Add AV_FRAME_DATA_REPLAYGAIN for exporting replaygain tags.
  Add a new header replaygain.h with the AVReplayGain struct.

2014-03-24 - 83e8978 / 5a7e35d - lavc 55.54.100 / 55.36.0 - avcodec.h
  Add AV_PKT_DATA_REPLAYGAIN for exporting replaygain tags.

2014-03-24 - 595ba3b / 25b3258 - lavf 55.35.100 / 55.13.0 - avformat.h
  Add AVStream.side_data and AVStream.nb_side_data for exporting stream-global
  side data (e.g. replaygain tags, video rotation)

2014-03-24 - bd34e26 / 0e2c3ee - lavc 55.53.100 / 55.35.0 - avcodec.h
  Give the name AVPacketSideData to the previously anonymous struct used for
  AVPacket.side_data.

你可能感兴趣的:(ffmpeg,ffmpeg,函数变更,找不到标识符,was,not,declared,in)