`
lobin
  • 浏览: 417444 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

FFmpeg: 安装

 
阅读更多

FFmpeg 

Cygwin下FFmpeg安装

./configure --enable-shared --prefix=/usr/local/ffmpeg

 

Cygwin下安装FFmpeg过程中出现大量的提示和警告

 

gcc: 无法识别的选项‘-pthread’

 

这些都可以先忽略。

 

make

make install

 

写道
├─bin
│ cygavcodec-56.dll
│ cygavdevice-56.dll
│ cygavfilter-5.dll
│ cygavformat-56.dll
│ cygavutil-54.dll
│ cygswresample-1.dll
│ cygswscale-3.dll
│ ffmpeg.exe
│ ffprobe.exe
│ ffserver.exe

├─include
│ ├─libavcodec
│ │ avcodec.h
│ │ avfft.h
│ │ d3d11va.h
│ │ dv_profile.h
│ │ dxva2.h
│ │ old_codec_ids.h
│ │ qsv.h
│ │ vaapi.h
│ │ vda.h
│ │ vdpau.h
│ │ version.h
│ │ vorbis_parser.h
│ │ xvmc.h
│ │
│ ├─libavdevice
│ │ avdevice.h
│ │ version.h
│ │
│ ├─libavfilter
│ │ asrc_abuffer.h
│ │ avcodec.h
│ │ avfilter.h
│ │ avfiltergraph.h
│ │ buffersink.h
│ │ buffersrc.h
│ │ version.h
│ │
│ ├─libavformat
│ │ avformat.h
│ │ avio.h
│ │ version.h
│ │
│ ├─libavutil
│ │ adler32.h
│ │ aes.h
│ │ attributes.h
│ │ audioconvert.h
│ │ audio_fifo.h
│ │ avassert.h
│ │ avconfig.h
│ │ avstring.h
│ │ avutil.h
│ │ base64.h
│ │ blowfish.h
│ │ bprint.h
│ │ bswap.h
│ │ buffer.h
│ │ camellia.h
│ │ cast5.h
│ │ channel_layout.h
│ │ common.h
│ │ cpu.h
│ │ crc.h
│ │ dict.h
│ │ display.h
│ │ downmix_info.h
│ │ error.h
│ │ eval.h
│ │ ffversion.h
│ │ fifo.h
│ │ file.h
│ │ frame.h
│ │ hash.h
│ │ hmac.h
│ │ imgutils.h
│ │ intfloat.h
│ │ intreadwrite.h
│ │ lfg.h
│ │ log.h
│ │ lzo.h
│ │ macros.h
│ │ mathematics.h
│ │ md5.h
│ │ mem.h
│ │ motion_vector.h
│ │ murmur3.h
│ │ old_pix_fmts.h
│ │ opt.h
│ │ parseutils.h
│ │ pixdesc.h
│ │ pixelutils.h
│ │ pixfmt.h
│ │ random_seed.h
│ │ rational.h
│ │ replaygain.h
│ │ ripemd.h
│ │ samplefmt.h
│ │ sha.h
│ │ sha512.h
│ │ stereo3d.h
│ │ threadmessage.h
│ │ time.h
│ │ timecode.h
│ │ timestamp.h
│ │ twofish.h
│ │ version.h
│ │ xtea.h
│ │
│ ├─libswresample
│ │ swresample.h
│ │ version.h
│ │
│ └─libswscale
│ swscale.h
│ version.h

├─lib
│ │ libavcodec.a
│ │ libavcodec.dll.a
│ │ libavdevice.a
│ │ libavdevice.dll.a
│ │ libavfilter.a
│ │ libavfilter.dll.a
│ │ libavformat.a
│ │ libavformat.dll.a
│ │ libavutil.a
│ │ libavutil.dll.a
│ │ libswresample.a
│ │ libswresample.dll.a
│ │ libswscale.a
│ │ libswscale.dll.a
│ │
│ └─pkgconfig
│ libavcodec.pc
│ libavdevice.pc
│ libavfilter.pc
│ libavformat.pc
│ libavutil.pc
│ libswresample.pc
│ libswscale.pc

└─share
├─ffmpeg
│ │ ffprobe.xsd
│ │ libvpx-1080p.ffpreset
│ │ libvpx-1080p50_60.ffpreset
│ │ libvpx-360p.ffpreset
│ │ libvpx-720p.ffpreset
│ │ libvpx-720p50_60.ffpreset
│ │
│ └─examples
│ avio_list_dir.c
│ avio_reading.c
│ decoding_encoding.c
│ demuxing_decoding.c
│ extract_mvs.c
│ filtering_audio.c
│ filtering_video.c
│ filter_audio.c
│ Makefile
│ metadata.c
│ muxing.c
│ qsvdec.c
│ README
│ remuxing.c
│ resampling_audio.c
│ scaling_video.c
│ transcode_aac.c
│ transcoding.c

└─man
├─man1
│ ffmpeg-all.1
│ ffmpeg-bitstream-filters.1
│ ffmpeg-codecs.1
│ ffmpeg-devices.1
│ ffmpeg-filters.1
│ ffmpeg-formats.1
│ ffmpeg-protocols.1
│ ffmpeg-resampler.1
│ ffmpeg-scaler.1
│ ffmpeg-utils.1
│ ffmpeg.1
│ ffprobe-all.1
│ ffprobe.1
│ ffserver-all.1
│ ffserver.1

└─man3
libavcodec.3
libavdevice.3
libavfilter.3
libavformat.3
libavutil.3
libswresample.3
libswscale.3

 

FFmpeg安装后在bin目录下提供了几个工具:ffmpeg,ffprobe,ffserver。其实还有个ffplayer,这里没有安装。

其中ffmpeg,ffprobe这两个工具比较常用。

 

ffmpeg

对视频、音频包括图像处理的命令行工具。

ffprobe

对视频、音频包括图像探测的命令行工具。

./ffprobe.exe /cygdrive/h/IMG_0024.mp4

ffprobe version 2.7.2 Copyright (c) 2007-2015 the FFmpeg developers

  built with gcc 4.5.3 (GCC)

  configuration: --enable-shared --prefix=/usr/local/ffmpeg

  libavutil      54. 27.100 / 54. 27.100

  libavcodec     56. 41.100 / 56. 41.100

  libavformat    56. 36.100 / 56. 36.100

  libavdevice    56.  4.100 / 56.  4.100

  libavfilter     5. 16.101 /  5. 16.101

  libswscale      3.  1.101 /  3.  1.101

  libswresample   1.  2.100 /  1.  2.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/cygdrive/h/IMG_0024.mp4':

  Metadata:

    major_brand     : mp42

    minor_version   : 1

    compatible_brands: isommp41mp42

    creation_time   : 2020-08-25 17:54:46

  Duration: 00:03:00.05, start: 0.000000, bitrate: 836 kb/s

    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)

    Metadata:

      creation_time   : 2020-08-25 17:54:46

      handler_name    : Core Media Audio

    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 320x568, 706 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 23976 tbc (default)

    Metadata:

      creation_time   : 2020-08-25 17:54:46

      handler_name    : Core Media Video

 

其中Input #部分其实就是调用av_dump_format函数输出:

void av_dump_format(AVFormatContext *ic,

                    int index,

                    const char *url,

 

                    int is_output);

Input #0在调用时index参数传0,是#1的话就传1,...依次类推。

 

#include<stdio.h>
#include<libavformat/avformat.h>

int main(int argc, char** argv)
{
  char *filename;
  AVFormatContext *av_format_context = NULL;
  AVInputFormat *av_input_format = NULL;
  AVDictionary **av_dictionary = NULL;
  if (argc != 2)
  {
    fprintf(stderr, "invalid args\n");
    return 1;
  }
  filename = argv[1];

  av_register_all();

  if (avformat_open_input(&av_format_context, filename, av_input_format, av_dictionary))
  {
    fprintf(stderr, "open input err: %s\n", filename);
    return 1;
  }
  if (av_format_context == NULL)
  {
    fprintf(stderr, "open input err: %s, format=null\n", filename);
    return 1;
  }

  if (avformat_find_stream_info(av_format_context, av_dictionary) < 0)
  {
    fprintf(stderr, "find stream info err\n");
    return 1;
  }

  av_dump_format(av_format_context, 0, av_format_context->filename, 0);
  return 0;
}

编译链接

编译的时候注意通过“-I”指定头文件目录,在链接的时候通过“-L”指定要链接的静态库文件目录,以及通过“-l”指定要链接的静态库。

gcc -I D:\sbin\usr\local\ffmpeg\include -L D:\sbin\usr\local\ffmpeg\lib ffmpeg_format_test.c -o ffmpeg_format_test -lavformat

 

.\ffmpeg_format_test h:\\IMG_0024.mp4

.\ffmpeg_format_test h:\\IMG_0024-vcodec_copy-an-f-mpeg1video.mpg

 

 

 

 

0
0
分享到:
评论

相关推荐

    安装opencv所需文件(xvid,x264,ffmpeg等)

    对于linux下使用opencv不像windows那么方便,尤其整个安装过程,更甚者对于linux下opencv安装过程中要包含进去视频开发部分对于初学者来说是比较困难的。 这里是安装linux下opencv,并要使opencv包含视频开发(如使用...

    ffmpeg:在Ubuntu Alpine Centos 7 Scratch上为FFmpeg构建Docker

    您可以通过运行docker pull jrottenberg/ffmpeg安装此映像的最新版本。 此图像可用作编码场的基础。建物您可以使用jrottenberg / ffmpeg或jrottenberg / ffmpeg:3.3来获取基于ubuntu的最新版本。 注意:我在3.1...

    ffmpeg安装配置以及测试

    ffmpeg 安装配置和测试 FFmpeg 是一个免费的开源计算机程序,可以记录、转换和流媒体视频和音频。下面是 FFmpeg 的安装配置和测试步骤。 安装 1. 下载 FFmpeg 首先,需要下载 FFmpeg 的安装包,可以从官网下载,...

    ffmpeg的安装和使用攻略

    4. **编译和安装**:使用`make`命令编译源代码,然后使用`sudo make install`将FFmpeg安装到系统路径。 5. **验证安装**:安装完成后,可以通过在终端输入`ffmpeg -version`来查看FFmpeg的版本信息,确认安装成功。...

    ffmpeg以及安装方法

    下面将详细介绍FFmpeg的特性、安装过程以及如何在E盘上配置环境。 FFmpeg 的主要特点: 1. **跨平台**:FFmpeg 支持Windows、Linux、Mac OS X等多个操作系统。 2. **全面的编码和解码支持**:FFmpeg 支持几乎所有的...

    FFMPEG:3.3.6安卓SO动态库

    FFmpeg是一个开源项目,主要由C语言编写,用于处理音视频数据。它的功能非常强大,包括音频和视频的编码、解码、转码、封装、流媒体处理等。3.3.6是FFmpeg的一个版本号,这表示你获得的是FFmpeg在2017年中期的一个...

    ffmpeg 自动安装脚本

    5. 编译和安装:使用`./configure`、`make`和`make install`命令编译源代码并将其安装到系统路径中。 6. 清理:为了保持系统的整洁,脚本可能还会清除编译过程中产生的临时文件。 自动安装脚本的使用方法通常是将...

    ffmpeg:win10 64位 Static版

    在Windows 10上使用FFmpeg Static版,用户可以直接执行可执行文件进行操作,无需安装额外的软件或库。这使得在不同机器间复制和使用FFmpeg变得简单,特别适合开发人员和系统管理员在不同环境中快速部署。 为了使用...

    FFmpeg-安装过程

    5. **安装**:编译成功后,使用`make install`将FFmpeg安装到系统路径: ``` sudo make install ``` 三、注意事项 1. **权限**:在执行`make install`时可能需要管理员权限。 2. **编译选项**:配置选项可以根据...

    ffmpeg在redhat上的安装步骤

    完成以上步骤后,可以通过以下命令检查ffmpeg是否正确安装: ```bash ffmpeg -version ``` 如果看到版本信息,说明ffmpeg已经成功安装。此外,还可以测试ffmpeg的功能,例如通过以下命令将一个视频文件转码为另一...

    opencv+ camke + opencv_ffmpeg缺失包

    本文将详细介绍如何在Windows上安装OpenCV 3.2版本,并解决其中可能遇到的opencv_ffmpeg缺失包的问题,同时也会提及与Qt5的集成。 首先,我们需要准备的软件工具有: 1. **CMake**: CMake是一个跨平台的开源构建...

    docker-centos-ffmpeg:用于构建 FFmpeg 的 Docker 镜像

    rpmforge 上 ffmpeg 的 RPM 非常过时,安装其中几个 RPM 最终会增加很多垃圾(minidlna 对我来说是 ffmpeg 的唯一消费者),所以它的存在是为了解决这个问题。 ffmpeg 库主要包含解码器而不是编码器。 大多数依赖...

    docker-ffmpeg:来自源代码的Dockerfile FFmpeg。 建立在Alpine Linux上

    码头工人 从源代码构建的FFmpeg Dockerfile。 基于Alpine Linux构建。 ffmpeg 4.4(从源代码编译... 使用已安装卷的示例: docker run -v ${PWD}:/opt/tmp/ -it --rm alfg/ffmpeg ffmpeg -i /opt/tmp/input.mp4 -c c

    ffmpeg最新版本0.6.2版源码

    编译FFmpeg源码通常涉及以下步骤:配置(configure)、编译(make)和安装(make install)。在配置阶段,可以根据需要选择要编译的组件和特性。编译完成后,可以使用编译出的工具进行音视频处理操作。 6. 开发者...

    docker-python-opencv-ffmpeg:基于Ubuntu的包含ffmpeg,opencv3和python23的干净Dockerfile的存储库

    首先,您需要在本地计算机上安装docker,请参阅以下。 请注意,为了正确运行docker,您已经以超级用户身份登录,否则您将面临很多局部问题,有时这没有多大意义。 您可以自己构建它,请注意这需要花费很多时间,请...

    Linux安装ffmpeg脚本

    在Linux环境下,通过脚本安装FFmpeg可以自动化整个过程,提高效率并确保安装正确无误。以下是一份详细的FFmpeg在Linux上的安装教程。 首先,我们需要准备必要的依赖库和编译工具。在大多数Linux发行版中,这通常...

    cmake_opencv3.2需要手动下载的ippicv_windows_20151201.zip;opencv_ffmpeg.dll;opencv_ffmpe

    opencv_ffmpeg.dll;opencv_ffmpeg_64.dll 下载后将 opencv3.2.0\opencv\sources\3rdparty\ippicv\downloads\windows-04e81ce5d0e329c3fbc606ae32cad44d\ippicv_windows_20151201.zip;\opencv3.2.0\opencv\...

    activejob-ffmpeg:ffmpeg 的 ActiveJob 作业定义

    宝石安装: $ gem install activejob-ffmpeg 将此行添加到应用程序的 Gemfile 中: gem 'activejob-ffmpeg', github: "joker1007/activejob-ffmpeg" 然后执行: $ bundle 用法 class EncodeJob &lt; ...

    ffmpeg-latest-0818

    2. **配置环境**:安装必要的编译依赖,如zlib、libogg、libvorbis、libx264等。 3. **配置项目**:在VS2010中创建一个新的解决方案,然后添加FFmpeg的每个组件为子项目。需要配置编译选项,比如选择支持的编码器、...

Global site tag (gtag.js) - Google Analytics