{"id":326997,"date":"2022-01-10T08:43:14","date_gmt":"2022-01-10T08:43:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=326997"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=326997","title":{"rendered":"<span>FFmpeg libav \u0441 \u043d\u0443\u043b\u044f. \u0427\u0430\u0441\u0442\u044c 1: \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/e72\/835\/e9b\/e72835e9bfe9492bb75984d85b87416c.jpeg\" width=\"640\" height=\"640\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e72\/835\/e9b\/e72835e9bfe9492bb75984d85b87416c.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u043e\u0442\u043a\u0440\u044b\u0442\u044c<br \/>\u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044e <strong>FFmpeg libav<\/strong> \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0443\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libav*<\/strong>, \u0433\u0434\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0438\u0442 <strong>\u0421++<\/strong>.<\/p>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443 \u0442\u043e, \u0447\u0442\u043e \u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c<br \/>\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u043e\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u0435 \u0438 \u043c\u043e\u0435\u0439 \u0446\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u0442\u0435\u043c, \u043a\u0442\u043e, \u043a\u0430\u043a \u0438 \u044f, \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0448\u0430\u0433\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438.<\/p>\n<h2>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e (\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f)<\/h2>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0443\u0434\u0438\u043e \u0438 \u0432\u0438\u0434\u0435\u043e \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u044f\u0437\u044b\u043a\u0430 <strong>\u0421++<\/strong> \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a <strong>libav*<\/strong>. \u041f\u043e\u0434 <strong>libav*<\/strong> \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e <strong>libavformat<\/strong>, <strong>libavcodec<\/strong>, <strong>libavutil<\/strong> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<p>\u0417\u0430 \u0432\u0440\u0435\u043c\u044f, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u043e\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044e, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0435\u043c\u0443. \u041c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043b\u0438\u0448\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u0438\u0440\u043e\u0434\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043d\u043e \u0438 \u043e\u043d\u0438 \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u0443\u0441\u0442\u0430\u0440\u0435\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0445\u043e\u0447\u0443 \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0441\u043e \u0432\u0441\u0435\u043c\u0438, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u0440\u043d\u0438\u0441\u0442\u0443\u044e \u0442\u0440\u043e\u043f\u0443.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u0430\u0436\u043d\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u043c\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0448\u0443 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u0432\u0435\u0449\u0430\u044e\u0442\u0441\u044f <a href=\"https:\/\/github.com\/leandromoreira\/ffmpeg-libav-tutorial\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<\/details>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 FFmpeg<\/h2>\n<p><strong>FFmpeg<\/strong> &#8212; \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0443\u0442\u0438\u043b\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0434\u0438\u0439\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432. \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b <strong>FFmpeg<\/strong> \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043c\u0435\u0434\u0438\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong>\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong> \u0438 <strong>\u0442\u0440\u0430\u043d\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>, <strong>\u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong> \u0438 <strong>\u0434\u0435\u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>, <strong>\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432<\/strong>, <strong>\u043e\u0431\u0440\u0435\u0437\u043a\u0430 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/strong>, <strong>\u0441\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0434\u0438\u0430 \u0444\u0430\u0439\u043b\u043e\u0432<\/strong> \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 <strong>FFmpeg<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0434\u0438\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0435\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u043c\u0435\u0434\u0438\u0430 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>FFmpeg (libav*)<\/strong> \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 <strong>\u0421++<\/strong>, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431\u043e \u0432\u0441\u0451\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/www.ffmpeg.org\/about.html\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a> (\u043f\u0440\u043e\u043c\u043e\u0442\u0430\u0439\u0442\u0435 \u0432 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437, \u0435\u0441\u043b\u0438 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0438\u0445 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435).<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e)<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e, \u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043d\u0430 <strong>Windows<\/strong>. \u042f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0434\u0430 <strong>Visual Studio Code<\/strong>, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u0432 <strong>MSYS2<\/strong> \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c <strong>GCC<\/strong> \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 <strong>mingw-w64<\/strong>.<\/p>\n<ol>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441 <a href=\"http:\/\/www.msys2.org\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <strong>MSYS2<\/strong> \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b: <code>$ pacman -Syu<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <strong>MSYS2<\/strong> \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b: <code>$ pacman -Su<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <strong>mingw-w64<\/strong> \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b (<strong>make<\/strong>, <strong>pkgconf<\/strong>):<br \/><code>$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 <strong>FFmpeg<\/strong>:<br \/><code>$ pacman -S mingw-w64-x86_64-ffmpeg<\/code><\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c <strong>Visual Studio Code<\/strong>. \u041f\u043e \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 <a href=\"https:\/\/code.visualstudio.com\/docs\/cpp\/config-mingw\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043a\u0430\u0436\u0443 \u043b\u0438\u0448\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435:<\/p>\n<p>1. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c (<strong>FFmpeg libav*<\/strong>) \u0432 <code>\"includePath\"<\/code> .<br \/>2. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 (<strong>mingw-w64 gcc<\/strong>) \u0432 <code>\"compilerPath\"<\/code>.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"c_cpp_properties.json\" title=\"c_cpp_properties.json\" height=\"528\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ce1\/f67\/450\/ce1f674502b3b2e8ca067c06a3190e32.png\" data-width=\"992\"\/><figcaption>c_cpp_properties.json<\/figcaption><\/figure>\n<\/li>\n<\/ol>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 libav*<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043c\u0435\u0434\u0438\u0430\u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/Meystergod\/libavtutorial\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b, \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<pre><code class=\"cpp\">int main(int argc, char* argv[]) {     if(argc != 2)     {         av_log(NULL, AV_LOG_ERROR, \"Usage: &lt;input file>\\n\");         return ARGUMENTS_ERROR;     }     const char* input_file = argv[1];      return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>AVFormatContext<\/code> . \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u0441\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <code>AVFormatContext<\/code> \u0438 \u0435\u0433\u043e \u043f\u043e\u043b\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 <a href=\"https:\/\/libav.org\/documentation\/doxygen\/master\/structAVFormatContext.html\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e <code>format_context<\/code> , \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>avformat_alloc_context()<\/code> . \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>avformat_open_input()<\/code> \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>avformat_find_stream_info()<\/code> .<\/p>\n<pre><code class=\"cpp\">int open_input_media_file(AVFormatContext** format_context, const char* input_file) {     int response;      *format_context = avformat_alloc_context();     if(!(*format_context))     {         av_log(NULL, AV_LOG_ERROR, \"Could not allocate memory for the input format context.\\n\");         return ALLOCATE_FORMAT_CONTEXT_ERROR;     }      response = avformat_open_input(format_context, input_file, NULL, NULL);     if(response != 0)     {         av_log(NULL, AV_LOG_ERROR, \"Could not open the input file: %s.\\n\", input_file);         return OPEN_INPUT_FILE_ERROR;     }      response = avformat_find_stream_info(*format_context, NULL);     if(response &lt; 0)     {         av_log(NULL, AV_LOG_ERROR, \"Could not find the input stream information.\\n\");         return FIND_STREAM_INFO_ERROR;     }      return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>av_dump_format()<\/code> , \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>AVFormatContext<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <code>av_dump_format()<\/code>  \u0438 \u0435\u0451 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 <a href=\"https:\/\/libav.org\/documentation\/doxygen\/master\/group__lavf__misc.html#gae2645941f2dc779c307eb6314fd39f10\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>AVFormatContext<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438  <code>open_input_media_file()<\/code> \u0432 <code>main()<\/code> . <\/p>\n<p>\u041d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e \u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u043f\u0430\u043c\u044f\u0442\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>clean_memory()<\/code> \u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0451 \u0432\u044b\u0437\u043e\u0432 \u0432 <code>main()<\/code> .<\/p>\n<pre><code class=\"cpp\">void clean_memory(AVFormatContext* format_context) {     if(format_context != NULL)     {         avformat_close_input(&amp;format_context);         avformat_free_context(format_context);     } }<\/code><\/pre>\n<pre><code class=\"cpp\">int main(int argc, char* argv[]) {   AVFormatContext* format_context = NULL;      if(argc != 2)     {         av_log(NULL, AV_LOG_ERROR, \"Usage: &lt;input file>\\n\");         return ARGUMENTS_ERROR;     }     const char* input_file = argv[1];      int response = open_input_media_file(&amp;format_context, input_file);     if(response != EXIT_SUCCESS)     {       clean_memory(format_context);         return response;     }      av_dump_format(format_context, 0, input_file, 0);      clean_memory(format_context);     return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0421\u0431\u043e\u0440\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438:<br \/><code>g++ 1.cpp -o out -lavformat -lavutil<\/code> , \u0442\u0430\u043a \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Makefile (\u043e\u0431 \u044d\u0442\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435).<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0435\u0434\u0438\u0430\u0444\u0430\u0439\u043b\u0430, \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430\u0445.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"av_dump_format\" title=\"av_dump_format\" height=\"282\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7a3\/bde\/a0e\/7a3bdea0e91b94c5d10dedff1d0416c9.png\" data-width=\"1183\"\/><figcaption>av_dump_format<\/figcaption><\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 <strong>libav*<\/strong> \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u0432\u043e\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u0435\u0449\u0430\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong>\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/strong>, <strong>\u0442\u0440\u0430\u043d\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/strong>, <strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 <\/strong>\u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0443 \u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/599243\/\"> https:\/\/habr.com\/ru\/post\/599243\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"float full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u043e\u0442\u043a\u0440\u044b\u0442\u044c<br \/>\u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044e <strong>FFmpeg libav<\/strong> \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0443\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libav*<\/strong>, \u0433\u0434\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0438\u0442 <strong>\u0421++<\/strong>.<\/p>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443 \u0442\u043e, \u0447\u0442\u043e \u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c<br \/>\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u043e\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u0435 \u0438 \u043c\u043e\u0435\u0439 \u0446\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u0442\u0435\u043c, \u043a\u0442\u043e, \u043a\u0430\u043a \u0438 \u044f, \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0448\u0430\u0433\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438.<\/p>\n<h2>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e (\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f)<\/h2>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0443\u0434\u0438\u043e \u0438 \u0432\u0438\u0434\u0435\u043e \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u044f\u0437\u044b\u043a\u0430 <strong>\u0421++<\/strong> \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a <strong>libav*<\/strong>. \u041f\u043e\u0434 <strong>libav*<\/strong> \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e <strong>libavformat<\/strong>, <strong>libavcodec<\/strong>, <strong>libavutil<\/strong> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<p>\u0417\u0430 \u0432\u0440\u0435\u043c\u044f, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u043e\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044e, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0435\u043c\u0443. \u041c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043b\u0438\u0448\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u0438\u0440\u043e\u0434\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043d\u043e \u0438 \u043e\u043d\u0438 \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u0443\u0441\u0442\u0430\u0440\u0435\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0445\u043e\u0447\u0443 \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0441\u043e \u0432\u0441\u0435\u043c\u0438, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u0440\u043d\u0438\u0441\u0442\u0443\u044e \u0442\u0440\u043e\u043f\u0443.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u0430\u0436\u043d\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u043c\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0448\u0443 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u0432\u0435\u0449\u0430\u044e\u0442\u0441\u044f <a href=\"https:\/\/github.com\/leandromoreira\/ffmpeg-libav-tutorial\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<\/details>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 FFmpeg<\/h2>\n<p><strong>FFmpeg<\/strong> &#8212; \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0443\u0442\u0438\u043b\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0434\u0438\u0439\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432. \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b <strong>FFmpeg<\/strong> \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043c\u0435\u0434\u0438\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong>\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong> \u0438 <strong>\u0442\u0440\u0430\u043d\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>, <strong>\u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong> \u0438 <strong>\u0434\u0435\u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>, <strong>\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432<\/strong>, <strong>\u043e\u0431\u0440\u0435\u0437\u043a\u0430 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/strong>, <strong>\u0441\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0434\u0438\u0430 \u0444\u0430\u0439\u043b\u043e\u0432<\/strong> \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 <strong>FFmpeg<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0434\u0438\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0435\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u043c\u0435\u0434\u0438\u0430 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>FFmpeg (libav*)<\/strong> \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 <strong>\u0421++<\/strong>, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431\u043e \u0432\u0441\u0451\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/www.ffmpeg.org\/about.html\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a> (\u043f\u0440\u043e\u043c\u043e\u0442\u0430\u0439\u0442\u0435 \u0432 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437, \u0435\u0441\u043b\u0438 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0438\u0445 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435).<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e)<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e, \u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043d\u0430 <strong>Windows<\/strong>. \u042f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0434\u0430 <strong>Visual Studio Code<\/strong>, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u0432 <strong>MSYS2<\/strong> \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c <strong>GCC<\/strong> \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 <strong>mingw-w64<\/strong>.<\/p>\n<ol>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441 <a href=\"http:\/\/www.msys2.org\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <strong>MSYS2<\/strong> \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b: <code>$ pacman -Syu<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <strong>MSYS2<\/strong> \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b: <code>$ pacman -Su<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <strong>mingw-w64<\/strong> \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b (<strong>make<\/strong>, <strong>pkgconf<\/strong>):<br \/><code>$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 <strong>FFmpeg<\/strong>:<br \/><code>$ pacman -S mingw-w64-x86_64-ffmpeg<\/code><\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c <strong>Visual Studio Code<\/strong>. \u041f\u043e \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 <a href=\"https:\/\/code.visualstudio.com\/docs\/cpp\/config-mingw\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043a\u0430\u0436\u0443 \u043b\u0438\u0448\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435:<\/p>\n<p>1. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c (<strong>FFmpeg libav*<\/strong>) \u0432 <code>\"includePath\"<\/code> .<br \/>2. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 (<strong>mingw-w64 gcc<\/strong>) \u0432 <code>\"compilerPath\"<\/code>.<\/p>\n<figure class=\"full-width\"><figcaption>c_cpp_properties.json<\/figcaption><\/figure>\n<\/li>\n<\/ol>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 libav*<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043c\u0435\u0434\u0438\u0430\u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/Meystergod\/libavtutorial\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b, \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<pre><code class=\"cpp\">int main(int argc, char* argv[]) {     if(argc != 2)     {         av_log(NULL, AV_LOG_ERROR, \"Usage: &lt;input file>\\n\");         return ARGUMENTS_ERROR;     }     const char* input_file = argv[1];      return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>AVFormatContext<\/code> . \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u0441\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <code>AVFormatContext<\/code> \u0438 \u0435\u0433\u043e \u043f\u043e\u043b\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 <a href=\"https:\/\/libav.org\/documentation\/doxygen\/master\/structAVFormatContext.html\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e <code>format_context<\/code> , \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>avformat_alloc_context()<\/code> . \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>avformat_open_input()<\/code> \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>avformat_find_stream_info()<\/code> .<\/p>\n<pre><code class=\"cpp\">int open_input_media_file(AVFormatContext** format_context, const char* input_file) {     int response;      *format_context = avformat_alloc_context();     if(!(*format_context))     {         av_log(NULL, AV_LOG_ERROR, \"Could not allocate memory for the input format context.\\n\");         return ALLOCATE_FORMAT_CONTEXT_ERROR;     }      response = avformat_open_input(format_context, input_file, NULL, NULL);     if(response != 0)     {         av_log(NULL, AV_LOG_ERROR, \"Could not open the input file: %s.\\n\", input_file);         return OPEN_INPUT_FILE_ERROR;     }      response = avformat_find_stream_info(*format_context, NULL);     if(response &lt; 0)     {         av_log(NULL, AV_LOG_ERROR, \"Could not find the input stream information.\\n\");         return FIND_STREAM_INFO_ERROR;     }      return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>av_dump_format()<\/code> , \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>AVFormatContext<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <code>av_dump_format()<\/code>  \u0438 \u0435\u0451 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 <a href=\"https:\/\/libav.org\/documentation\/doxygen\/master\/group__lavf__misc.html#gae2645941f2dc779c307eb6314fd39f10\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>AVFormatContext<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438  <code>open_input_media_file()<\/code> \u0432 <code>main()<\/code> . <\/p>\n<p>\u041d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e \u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u043f\u0430\u043c\u044f\u0442\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>clean_memory()<\/code> \u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0451 \u0432\u044b\u0437\u043e\u0432 \u0432 <code>main()<\/code> .<\/p>\n<pre><code class=\"cpp\">void clean_memory(AVFormatContext* format_context) {     if(format_context != NULL)     {         avformat_close_input(&amp;format_context);         avformat_free_context(format_context);     } }<\/code><\/pre>\n<pre><code class=\"cpp\">int main(int argc, char* argv[]) {   AVFormatContext* format_context = NULL;      if(argc != 2)     {         av_log(NULL, AV_LOG_ERROR, \"Usage: &lt;input file>\\n\");         return ARGUMENTS_ERROR;     }     const char* input_file = argv[1];      int response = open_input_media_file(&amp;format_context, input_file);     if(response != EXIT_SUCCESS)     {       clean_memory(format_context);         return response;     }      av_dump_format(format_context, 0, input_file, 0);      clean_memory(format_context);     return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0421\u0431\u043e\u0440\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438:<br \/><code>g++ 1.cpp -o out -lavformat -lavutil<\/code> , \u0442\u0430\u043a \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Makefile (\u043e\u0431 \u044d\u0442\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435).<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0435\u0434\u0438\u0430\u0444\u0430\u0439\u043b\u0430, \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430\u0445.<\/p>\n<figure class=\"full-width\"><figcaption>av_dump_format<\/figcaption><\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 <strong>libav*<\/strong> \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u0432\u043e\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u0435\u0449\u0430\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong>\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/strong>, <strong>\u0442\u0440\u0430\u043d\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/strong>, <strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 <\/strong>\u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0443 \u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/599243\/\"> https:\/\/habr.com\/ru\/post\/599243\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-326997","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=326997"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326997\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}