分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
最近一两年内FFmpeg项目发展的速度很快,本来是一件好事。但是随之而来的问题就是其API(接口函数)一直在发生变动。这么一来基于旧一点版本的FFmpeg的程序的代码在最新的类库上可能就跑不通了。
例如一年前的程序中,获取媒体信息使用的函数是av_find_stream_info()。但是最近的版本中,av_find_stream_info()函数已经无法使用了,取而代之的是avformat_find_stream_info()。再比如,早一些的程序中,打开解码器可以使用avcodec_open(),但是新版本的程序中必须使用avcodec_open2()。而早期版本的FFmpeg中打开媒体的函数av_open_input_file()也已经被avformat_open_input()所取代。可以看出一些与libavformat相关的av_***()都变更为了avformat_***(),这一趋势也说明FFmpeg的API正在慢慢朝着“名称更加规范”的方向发展。
在FFmpeg的doc目录下碰巧看到了一个FFmpeg的API变更记录,记载了到今天为止FFmpeg所有的API变化情况,在这里记录一下。
整个文件中主要有三种记录:
Add:新增的
Change/Rename:修改的
Deprecate:过时的。以后很有可能删除。
Remove:删除的
文件位于doc/APIchanges,内容如下。
Never assume the API of libav* to be stable unless at least 1 month has passed
since the last major version increase or the API was added.
The last version increases were:
libavcodec: 2014-08-09
libavdevice: 2014-08-09
libavfilter: 2014-08-09
libavformat: 2014-08-09
libavresample: 2014-08-09
libpostproc: 2014-08-09
libswresample: 2014-08-09
libswscale: 2014-08-09
libavutil: 2014-08-09
API changes, most recent first:
2014-11-xx - xxxxxxx - lavc 56.6.0 - vorbis_parser.h
Add a public API for parsing vorbis packets.
2014-10-xx - xxxxxxx - lavc 56.5.0 - avcodec.h
Replace AVCodecContext.time_base used for decoding
with AVCodecContext.framerate.
2014-10-xx - xxxxxxx - lavc 56.4.0 - avcodec.h
Add AV_HWACCEL_FLAG_IGNORE_LEVEL flag to av_vdpau_bind_context().
2014-10-13 - xxxxxxx - lavc 56.03.0 - avcodec.h
Add AVCodecContext.initial_padding. Deprecate the use of AVCodecContext.delay
for audio encoding.
2014-09-xx - xxxxxxx - lavu 54.04.0 - pixdesc.h
Add API to return the name of frame and context color properties.
2014-09-xx - xxxxxxx - lavc 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 - xxxxxxx - lavc 56.2.100 - avcodec.h
2014-10-02 - xxxxxxx - 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 - xxxxxxx - lavu 54.8.100 - avstring.h
Add av_match_list()
2014-09-24 - xxxxxxx - libpostproc 53.1.100
Add visualization support
2014-09-xx - xxxxxxx - 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-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-25 - 215db29 / b263f8f - lavf 56.3.100 / 56.3.0 - avformat.h
Add AVFormatContext.max_ts_probe.
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 - xxxxxxx - 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 - xxxxxxx - 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-xx - xxxxxxx - 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 - lavu 52.84.100 - 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-xx - xxxxxxx - lavu 52.82.0 - fifo.h
Add av_fifo_freep() function.
2014-05-02 - ba52fb11 - lavu 52.81.0 - 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-29 - 1bf6396 - lavc 55.60.100 - avcodec.h
Add AVCodecDescriptor.mime_types field.
2014-04-29 - xxxxxxx - lavu 52.80.0 - 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-XX - xxxxxxx - lavf xx.xx.1xx - 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.
-------- 8< --------- FFmpeg 2.2 was cut here -------- 8< ---------
2014-03-18 - 37c07d4 - lsws 2.5.102
Make gray16 full-scale.
2014-03-16 - 6b1ca17 / 1481d24 - lavu 52.67.100 / 53.6.0 - pixfmt.h
Add RGBA64_LIBAV pixel format and variants for compatibility
2014-03-11 - 3f3229c - lavf 55.34.101 - avformat.h
Set AVFormatContext.start_time_realtime when demuxing.
2014-03-03 - 06fed440 - lavd 55.11.100 - avdevice.h
Add av_input_audio_device_next().
Add av_input_video_device_next().
Add av_output_audio_device_next().
Add av_output_video_device_next().
2014-02-24 - fff5262 / 1155fd0 - lavu 52.66.100 / 53.5.0 - frame.h
Add av_frame_copy() for copying the frame data.
2014-02-24 - a66be60 - lswr 0.18.100 - swresample.h
Add swr_is_initialized() for checking whether a resample context is initialized.
2014-02-22 - 5367c0b / 7e86c27 - lavr 1.2.0 - avresample.h
Add avresample_is_open() for checking whether a resample context is open.
2014-02-19 - 6a24d77 / c3ecd96 - lavu 52.65.100 / 53.4.0 - opt.h
Add AV_OPT_FLAG_EXPORT and AV_OPT_FLAG_READONLY to mark options meant (only)
for reading.
2014-02-19 - f4c8d00 / 6bb8720 - lavu 52.64.101 / 53.3.1 - opt.h
Deprecate unused AV_OPT_FLAG_METADATA.
2014-02-xx - xxxxxxx - lavd 55.10.100 - avdevice.h
Add avdevice_list_devices() and avdevice_free_list_devices()
2014-02-16 - db3c970 - lavf 55.33.100 - avio.h
Add avio_find_protocol_name() to find out the name of the protocol that would
be selected for a given URL.
2014-02-15 - a2bc6c1 / c98f316 - lavu 52.64.100 / 53.3.0 - frame.h
Add AV_FRAME_DATA_DOWNMIX_INFO value to the AVFrameSideDataType enum and
downmix_info.h API, which identify downmix-related metadata.
2014-02-11 - 1b05ac2 - lavf 55.32.100 - avformat.h
Add av_write_uncoded_frame() and av_interleaved_write_uncoded_frame().
2014-02-04 - 3adb5f8 / d9ae103 - lavf 55.30.100 / 55.11.0 - avformat.h
Add AVFormatContext.max_interleave_delta for controlling amount of buffering
when interleaving.
2014-02-02 - 5871ee5 - lavf 55.29.100 - avformat.h
Add output_ts_offset muxing option to AVFormatContext.
2014-01-27 - 102bd64 - lavd 55.7.100 - avdevice.h
lavf 55.28.100 - avformat.h
Add avdevice_dev_to_app_control_message() function.
2014-01-27 - 7151411 - lavd 55.6.100 - avdevice.h
lavf 55.27.100 - avformat.h
Add avdevice_app_to_dev_control_message() function.
2014-01-24 - 86bee79 - lav