Giter VIP home page Giter VIP logo

Comments (6)

Canta avatar Canta commented on May 22, 2024 15

Instructions for Ubuntu 20.04, using ffmpeg from master branch on git repo (as of 2021-02-28).
Asuming a "ffmpeg" directory created inside home.

  1. ffmpeg repo:
    • cd ~/ffmpeg
    • git clone https://git.ffmpeg.org/ffmpeg.git repo
    • cd repo
    • ./configure --enable-gpl --disable-programs (this may vary, but the point of "disable programs" is to not replace the ffmpeg executable from ubuntu repos: we just need the libs for this tutorial).
    • make
    • sudo make install
  2. ffmpeg-libav-tutorial "hello world" compilation:
    • cd ~/ffmpeg
    • git clone https://github.com/leandromoreira/ffmpeg-libav-tutorial
    • cd ffmpeg-libav-tutorial
    • gcc -g -Wall 0_hello_world.c $(pkg-config --libs libavformat libavcodec libavdevice libavfilter libavutil libswscale libswresample) -lz -o build/hello

from ffmpeg-libav-tutorial.

ginaluca avatar ginaluca commented on May 22, 2024 10

Hi,

I'm compiling with a different setup (on Ubuntu16 and not from ffmpeg sources) but I had a similar error, so my solution might work for you as well.

I moved all the library parameters after the source file name, like this:
gcc -g -Wall -o build/hello_world 0_hello_world.c -lavformat -lavcodec -lswscale -lavutil -lz

and I could compile successfully.

from ffmpeg-libav-tutorial.

hustzhao avatar hustzhao commented on May 22, 2024 4

Hi
I use Ubuntu18.04, and ffmpeg-4.0.1 source code, and use
./configure --disable-x86asm --disable-doc --prefix=output to make, make install

I use
gcc -o build/hello_world -g -Wall 0_hello_world.c -I./include -L./lib -lavformat -lavcodec -lswscale -lavutil -lswresample -lz -lm -lpthread
It could compile well

from ffmpeg-libav-tutorial.

vandanachadha avatar vandanachadha commented on May 22, 2024 4

For me, the following worked:
gcc -g -Wall -L/home/vandana/ffmpeg/ /home/vandana/ipdecoder/ffmpeg_custom/transcoding.c /home/vandana/ipdecoder/ffmpeg_custom/video_debugging.c -lavformat -lavcodec -lx264 -lavdevice -lavfilter -lavutil -lswscale -lswresample -lm -lz -lpthread -o /home/vandana/ipdecoder/ffmpeg_custom/build/transcoding

from ffmpeg-libav-tutorial.

hxtruong6 avatar hxtruong6 commented on May 22, 2024 3

I have same errors. How to build with CMakeLists.txt in Clion IDE of intellij?
I add -lavformat -lavcodec -lswscale -lavutil -lz to target_link_libraries but the output like /usr/bin/ld: cannot find -lavformat_alloc_context.

from ffmpeg-libav-tutorial.

hxtruong6 avatar hxtruong6 commented on May 22, 2024 3

I have same errors. How to build with CMakeLists.txt in Clion IDE of intellij?
I add -lavformat -lavcodec -lswscale -lavutil -lz to target_link_libraries but the output like /usr/bin/ld: cannot find -lavformat_alloc_context.

I solved:
target_link_libraries(avformat avutil). Adding other if necessary. I think with lavformat, I can drop l characer.

from ffmpeg-libav-tutorial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.