Re: tigervnc needs ffmpeg

"Xi Ruoyao" ([email protected] via blfs-dev Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.beyond.devel
Message-ID <[email protected]>
On Sun, 2025-08-31 at 13:24 +0800, Xi Ruoyao wrote:
> On Tue, 2025-08-26 at 22:04 +0200, Thomas Trepl wrote:
> > Hi,
> > 
> > i just tried to compile the tigervnc suite but failed because it
> > cannot
> > link to libavcodec.so. This library is provided by ffmpeg.
> > I'd suggest to add ffmpeg to the 'required' list of dependencies of
> > tigervnc.
> 
> BUILDING.txt in the tarball says:
> 
> -- Optional ffmpeg development kit support (libav)
>    * You might have to enable additional repositories for this. E.g.,
>      on RHEL, EPEL and RPMFusion (free + nonfree) need to be enabled.
> 
> So is the word "optional" simply wrong here?

trioption(ENABLE_H264 "Enable H.264 RFB encoding")
if(ENABLE_H264)
  if(WIN32)
    add_definitions("-DHAVE_H264")
    set(H264_LIBS "WIN")  # may be LIBAV in the future
    set(H264_LIBRARIES ole32 mfplat mfuuid wmcodecdspuuid)

    set(CMAKE_REQUIRED_LIBRARIES ${H264_LIBRARIES})
    check_variable_exists(CLSID_VideoProcessorMFT HAVE_VIDEO_PROCESSOR_MFT)
    set(CMAKE_REQUIRED_LIBRARIES)
    if(HAVE_VIDEO_PROCESSOR_MFT)
      add_definitions("-DHAVE_VIDEO_PROCESSOR_MFT")
    endif()
  else()
    if(ENABLE_H264 STREQUAL "AUTO")
      find_package(Ffmpeg)
    else()
      find_package(Ffmpeg REQUIRED)
    endif()
    if (AVCODEC_FOUND AND AVUTIL_FOUND AND SWSCALE_FOUND)
      set(H264_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS} ${SWSCALE_INCLUDE_DIRS})
      set(H264_LIBRARIES ${AVCODEC_LIBRARIES} ${AVUTIL_LIBRARIES} ${SWSCALE_LIBRARIES})
      set(H264_LIBRARY_DIRS ${AVCODEC_LIBRARY_DIRS} ${AVUTIL_LIBRARY_DIRS} ${SWSCALE_LIBRARY_DIRS})
      add_definitions("-D__STDC_CONSTANT_MACROS")
      add_definitions("-DHAVE_H264")
      set(H264_LIBS "LIBAV")
    else()
      set(H264_LIBS "NONE")
      message(WARNING "FFMPEG support can't be found")
    endif()
  endif()
  add_definitions("-DH264_${H264_LIBS}")
endif()

Per https://cmake.org/cmake/help/latest/command/option.html, the default
of trioption is OFF.  Thus ffmpeg shouldn't be required by default.

I'll add it to optional.

-- 
Xi Ruoyao <[email protected]>

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-dev
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.