ffmpeg4.4.2编译
build_ffmpeg.sh脚本
# export DISPLAY=:0
# --pkg-config="pkg-config --static" \
# export LD_LIBRARY_PATH=/home/share/prj/ffmpeg_prj/ffmpeg_build/lib:$LD_LIBRARY_PATH
# PKG_CONFIG_PATH="/home/share/prj/ffmpeg_prj/ffmpeg_build/lib/pkgconfig"
# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig:/home/share/prj/ffmpeg_prj/ffmpeg_build/lib/pkgconfig
./configure --extra-libs="-lpthread -lm" \
--bindir="/home/share/prj/ffmpeg_prj/ffmpeg_build/bin6.0" \
--extra-cflags="-I/home/share/prj/ffmpeg_prj/ffmpeg_build/include" \
--extra-cflags="-I/home/share/prj/ffmpeg_prj/ffmpeg_build/include/fdk-aac" \
--extra-ldflags="-L/home/share/prj/ffmpeg_prj/ffmpeg_build/lib" \
--enable-gpl \
--enable-libfreetype \
--enable-libvorbis \
--enable-pic \
--disable-static --enable-shared \
--enable-nonfree \
--enable-libx264 \
--enable-libx265 \
--enable-libfdk-aac \
--enable-libmp3lame \
--enable-debug=3 \
--extra-cflags="-I$VPUHOST_CODE_DIR/include -g3 -O0 -w" \
--enable-sdl2 \
--enable-ffplay \
--disable-optimizations \
--disable-stripping \
--prefix="/home/share/prj/ffmpeg_prj/ffmpeg_build" \
--ignore-tests=TESTS
# --enable-indev=alsa \
# --enable-outdev=alsa \
launch.json配置
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"stopAtEntry": false,
"externalConsole": false,
"cwd": "/home/share/prj/ffmpeg_prj/ffmpeg",
"program": "/home/share/prj/ffmpeg_prj/ffmpeg/ffmpeg_g",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
// ffmpeg -re -i myj.mp4 -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test
//ffmpeg_g -i /home/share/prj/ffmpeg_prj/myj.mp4 -c:v h264 -preset veryfast -c:a copy out.mp4
// "args":[
// "-i",
// "/home/share/prj/ffmpeg_prj/myj.mp4",
// "-c:v",
// "h264",
// "-preset",
// "veryfast",
// "-c:a",
// "copy",
// "/home/share/prj/ffmpeg_prj/out.mp4"
// ],
"args":[
"-re",
"-i",
"/home/share/prj/ffmpeg_prj/myj.mp4",
"-f",
"rtsp",
"-rtsp_transport",
"tcp",
"rtsp://127.0.0.1/live/test"
],
"environment": [
{"name": "LD_LIBRARY_PATH", "value": "/home/share/prj/ffmpeg_prj/ffmpeg_build/lib:"}
],
"preLaunchTask": "build" //调试开始前执行的任务,一般为编译程序
}
]
}