Skip to content

I try to enable srt in ffmpeg but i cannot compile ffmpeg #109

@ciccio14

Description

@ciccio14

I tried to enable libsrt for ffmpeg using the istructions:

i added this line:

  --enable-libsrt | -srt)
    EXTERNAL_LIBRARIES+=("libsrt")
    ;;

to parse-arguments.sh

i created libsrt directory under scripts
i create download.sh like this:

#!/usr/bin/env bash

# Script to download SRT's source code
# Relies on SRT_SOURCE_TYPE and SRT_SOURCE_VALUE variables
# to choose the valid origin and version

# Exports SOURCES_DIR_srt - path where actual sources are stored

# Getting sources of a particular SRT release.
# Same argument (SRT version) produces the same source set.
function ensureSourcesTar() {
  source ${SCRIPTS_DIR}/common-functions.sh

  downloadTarArchive \
    "srt" \
    "https://github.com/Haivision/srt/archive/refs/tags/${SRT_SOURCE_VALUE}.tar.gz"
}

# Getting sources of a particular branch or a tag of SRT's git repository.
# Same branch name may produce different source sets,
# as the branch in the origin repository may be updated in the future.
# Git tags lead to stable states of the source code.
function ensureSourcesGit() {
  NAME_TO_CHECKOUT=${SRT_SOURCE_VALUE}
  GIT_DIRECTORY=srt-git
  SRT_SOURCES=$(pwd)/${GIT_DIRECTORY}

  if [[ ! -d "$SRT_SOURCES" ]]; then
    git clone https://github.com/Haivision/srt.git ${GIT_DIRECTORY}
  fi

  cd ${GIT_DIRECTORY}
  git reset --hard

  git checkout $NAME_TO_CHECKOUT
  if [ ${SRT_SOURCE_TYPE} = "GIT_BRANCH" ]; then
    # Forcing the update of a branch
    git pull origin $NAME_TO_CHECKOUT
  fi

  # Additional logging to keep track of the exact commit to build
  echo "Commit to build:"
  git rev-parse HEAD

  export SOURCES_DIR_srt=${SRT_SOURCES}
}

# Actual code
case ${SRT_SOURCE_TYPE} in
  GIT_TAG)
    echo "Using SRT git tag: ${SRT_SOURCE_VALUE}"
    ensureSourcesGit
    ;;
  GIT_BRANCH)
    echo "Using SRT git repository and its branch: ${SRT_SOURCE_VALUE}"
    ensureSourcesGit
    ;;
  TAR)
    echo "Using SRT source archive: ${SRT_SOURCE_VALUE}"
    ensureSourcesTar
    ;;
esac

then i created the build.sh script:

#!/usr/bin/env bash

cmake -DENABLE_SHARED=1 -DCMAKE_INSTALL_PREFIX=/home/tommaso/lavoro/mine/progetti/ffmpeg-android/ffmpeg-android-maker/scripts/libsrt

${MAKE_EXECUTABLE} clean
${MAKE_EXECUTABLE} -j${HOST_NPROC}
${MAKE_EXECUTABLE} install

but when i try to compile the compiler seems to ignore my configuration.
i also already installed libsrt in my ubuntu machine but if i try to add --enable-libsrt \ to build.sh of ffmpeg, the compile fails

Building the component: ffmpeg
ERROR: srt >= 1.3.0 not found using pkg-config

even if pkgconf finds the library installed:

pkgconf --modversion srt
1.5.4

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