Skip to content

fatal error: libavcodec/defs.h: No such file or directory #181

@chrplr

Description

@chrplr

Hello

I wrote a small go program which relies on go-astiav to extracts frames from videos.

This programs compiles and runs well on a Linux machine under Ubuntu 25.10 which has libavcodec version 61 installed with apt install.

However, I cannot build it on a Ubuntu 22.04 LTS machine where the libavcodec version installed by apt install is 58. The compilation crashes with the message:

# github.com/asticode/go-astiav
../../../go/pkg/mod/github.com/asticode/go-astiav@v0.39.0/discard.go:3:10: fatal error: libavcodec/defs.h: No such file or directory
    3 | //#include <libavcodec/defs.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

My current solutions are : avoid using ubuntu 22.04, or manually install a more recent version of libavcodec-dev on the ubuntu 22.04 machine. However, I wonder if it would e easy (?) to make your code robust to this difference between versions of libavcodec.

Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions