ubuntu 源码编译ffmpeg

news/2025/2/23 16:09:54

文章大概就是源码编译 ffmpeg,支持H265 264 编码和gdb 调试

  1. 下载ffmpeg 源码 git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
  2. 下载依赖库 sudo apt-get install libx264-dev libx265-dev
  3. 编译选项
./configure   --enable-gpl   --enable-libx264   --enable-libx265   --enable-shared   --enable-debug   --disable-stripping   --extra-cflags="-g"   --extra-ldflags="-g"  --prefix=`pwd`/builddir
  1. make -j8
  2. 生成文件如下
builddir   compat      config_components.h  configure        COPYING.GPLv2  COPYING.LGPLv2.1  CREDITS  ffbuild  ffmpeg_g  ffprobe_g  INSTALL.md  libavdevice  libavformat  libpostproc    libswscale  MAINTAINERS  presets    RELEASE  tools
Changelog  config.asm  config.h             CONTRIBUTING.md  COPYING.GPLv3  COPYING.LGPLv3    doc      ffmpeg   ffprobe   fftools    libavcodec  libavfilter  libavutil    libswresample  LICENSE.md  Makefile     README.md  test
  1. make install
  2. 在调试之前需要配置ffmpeg库的依赖路径
  3. export LD_LIBRARY_PATH=/home/hdp/Documents/OpenSource/ffmpeg/builddir/lib
hdp@hdp-DHC88:~/Documents/OpenSource/ffmpeg$ gdb ./ffprobe_g 
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./ffprobe_g...
(gdb) r
Starting program: /home/hdp/Documents/OpenSource/ffmpeg/ffprobe_g 

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
ffprobe version N-118520-g392aa9daf2 Copyright (c) 2007-2025 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
  configuration: --enable-gpl --enable-libx264 --enable-libx265 --enable-shared --enable-debug --disable-stripping --extra-cflags=-g --extra-ldflags=-g --prefix=/home/hdp/Documents/OpenSource/ffmpeg/builddir
  libavutil      59. 57.100 / 59. 57.100
  libavcodec     61. 33.102 / 61. 33.102
  libavformat    61.  9.107 / 61.  9.107
  libavdevice    61.  4.100 / 61.  4.100
  libavfilter    10.  9.100 / 10.  9.100
  libswscale      8. 13.100 /  8. 13.100
  libswresample   5.  4.100 /  5.  4.100
  libpostproc    58.  4.100 / 58.  4.100
Simple multimedia streams analyzer
usage: ffprobe [OPTIONS] INPUT_FILE

You have to specify one input file.
Use -h to get full help or, even better, run 'man ffprobe'.
[Inferior 1 (process 62429) exited with code 01]
(gdb) 

在这里插入图片描述


http://www.niftyadmin.cn/n/5863571.html

相关文章

【推荐项目】009-学校宿舍管理系统

系统角色与功能优化整理如下&#xff1a; 系统角色&#xff1a; 学生 宿舍管理员 系统管理员 系统功能&#xff1a; 首页&#xff1a;提供系统概览及快速导航。 用户管理&#xff1a;对用户信息进行增删改查等操作&#xff08;系统管理员专有&#xff09;。 宿舍管理&#x…

Qt中QRadioButton的使用

QRadioButton 是 Qt 框架中的一个控件&#xff0c;用于创建单选按钮。单选按钮通常用于让用户从一组互斥的选项中选择一个选项。以下是如何在 C 中使用 QRadioButton 的基本示例。 1. 包含必要的头文件 首先&#xff0c;确保包含 QRadioButton 和其他必要的 Qt 头文件。 #inc…

python-leetcode-二叉树的中序遍历

94. 二叉树的中序遍历 - 力扣&#xff08;LeetCode&#xff09; 方法1:递归实现 # Definition for a binary tree node. # class TreeNode: # def __init__(self, val0, leftNone, rightNone): # self.val val # self.left left # self.right …

linux常用基础命令_最新版

常用命令 查看当前目录下个各个文件大小查看当前系统储存使用情况查看当前路径删除当前目录下所有包含".log"的文件linux开机启动jar更改自动配置文件后操作关闭自启动linux静默启动java服务查询端口被占用查看软件版本重启关机开机启动取别名清空当前行创建文件touc…

MySQL(高级特性篇)11章——数据库的设计规范

一、为什么需要数据库设计 设计数据表时需考虑的问题&#xff1a; 数据需求&#xff1a;明确用户需要的数据以及需要在数据表中保存的数据数据正确性&#xff1a;在插入、删除、更新数据时&#xff0c;确定进行怎样的约束检查来保证数据的正确性数据冗余&#xff1a;思考如何降…

Java EE初阶-计算机导论

一、cpu的重要指标 核心参数 核心数&#xff08;Cores&#xff09; 含义&#xff1a;核心是 CPU 中执行指令的运算单元&#xff0c;核心数代表了 CPU 内独立运算核心的数量。影响&#xff1a;核心数越多&#xff0c;CPU 在同一时间内能够并行处理的任务就越多。例如&#xff…

链表-基础训练(二)链表 day14

两两交换链表中的节点 题目示意&#xff1a; 给定一个链表&#xff0c;两两交换其中相邻的节点&#xff0c;并返回交换后的链表。 你不能只是单纯的改变节点内部的值&#xff0c;而是需要实际的进行节点交换。 原先我的思路是图像上的思路&#xff0c;但是我感觉还是很复杂…

使用docker开发镜像编译

前言 搭建参考的是官网文档 环境 wsl2 wsl2内存分配和禁用swap 在window主机中,按下快捷键win+r,输入%UserProfile%,会跳转到用户目录,在该目录下,如果没有wsl配置文件,则创建一个.wslconfig,文件类型应为WSLCONFIG,而不是文档类型 我是用vscode来创建的,进入到.wslco…