【问题标题】:Webm-tools issue with setting upWebm-tools 设置问题
【发布时间】:2016-11-28 19:49:00
【问题描述】:

我已经尝试设置了半天了,我越来越绝望,请帮助。 我正在关注https://developer.mozilla.org/en-US/docs/Web/HTML/DASH_Adaptive_Streaming_for_HTML_5_Video,但我被困在第 3 步,因为我无法设置 dash_manifest(来自 webm-tools)。运行 cmake path/to/webmtools 时出现的错误是:

CMake Error at CMakeLists.txt:24 (add_executable):
  add_executable cannot create target "webm_info" because another target with
  the same name already exists.  The existing target is an executable created
  in source directory "/home/relja/Desktop/applicationsAndServices/libwebm".
  See documentation for policy CMP0002 for more details.


CMake Error at CMakeLists.txt:31 (target_link_libraries):
  Attempt to add link library "webm" to target "webm_info" which is not built
  in this directory.


-- Configuring incomplete, errors occurred!
See also "/home/relja/Desktop/applicationsAndServices/webm-tools/CMakeFiles/CMakeOutput.log".
See also "/home/relja/Desktop/applicationsAndServices/webm-tools/CMakeFiles/CMakeError.log".

正如我之前提到的,我在流程的第 2 步中使用了 libwebm。 我尝试删除 libwebm,但我得到的响应是 libwebm 不存在,因此无法执行操作。我尝试过使用 CMakeLists.txt,但由于我不了解这里的根本原因,因此一无所获。文档不存在(或者我找不到)所以我不得不求助于这个。如果我忘了添加什么,请询问。

编辑 1: 忘了说,我用的是ubuntu 编辑2: 通过使用 unix makefile 而不是 cmake 避免了这个问题,工作正常

【问题讨论】:

    标签: cmake webm mpeg-dash


    【解决方案1】:

    我花了一段时间摆弄这个并想出了一个有效的 CMakeLists.txt:

    ##  Copyright (c) 2015 The WebM project authors. All Rights Reserved.
    ##
    ##  Use of this source code is governed by a BSD-style license
    ##  that can be found in the LICENSE file in the root of the source
    ##  tree. An additional intellectual property rights grant can be found
    ##  in the file PATENTS.  All contributing project authors may
    ##  be found in the AUTHORS file in the root of the source tree.
    cmake_minimum_required(VERSION 2.8)
    project(WEBMTOOLS)
    
    set(WEBMTOOLS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
    # TODO(tomfinegan): The libwebm source directory must be configurable.
    set(LIBWEBM_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../libwebm")
    # This is where LIBWEBM targets are built.
    set(LIBWEBM_BUILD_DIR "${CMAKE_BINARY_DIR}/libwebm_build")
    
    # Libwebm section.
    # Add the libwebm CMakeLists.txt and set the binary dir to allow access to
    # libwebm build output.
    add_subdirectory("${LIBWEBM_SRC_DIR}" "${LIBWEBM_BUILD_DIR}")
    include_directories("${LIBWEBM_SRC_DIR}"
                        "${WEBMTOOLS_SRC_DIR}/shared")
    
    add_executable(dash_manifest
      "${WEBMTOOLS_SRC_DIR}/shared/indent.cc"
      "${WEBMTOOLS_SRC_DIR}/shared/webm_file.cc"
      "${WEBMTOOLS_SRC_DIR}/shared/webm_incremental_reader.cc"
      "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/adaptation_set.cc"
      "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/dash_model.cc"
      "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/period.cc"
      "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/representation.cc"
      "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/webm_dash_manifest.cc")
    
    target_link_libraries(dash_manifest LINK_PUBLIC webm)
    

    为了编译 webm_dash_manifest:

    cd webm_dash_manifest/
    make
    

    另请注意,sample_muxer 现在称为 mkvmuxer_sample。

    【讨论】:

    • 太好了,我很久以前就解决了我的问题(我只是需要这个来进行实验),在第二次编辑中提到。您也可以将此通知github.com/webmproject/webm-tools 上的工作人员。
    • 是的,我不是为了帮助你(因为你表示你已经解决了这个问题),而是为了帮助任何可能遇到这个问题的人。
    猜你喜欢
    • 2014-09-05
    • 2021-10-15
    • 2018-03-08
    • 2014-12-22
    • 2012-11-28
    • 1970-01-01
    • 1970-01-01
    • 2012-06-20
    • 1970-01-01
    相关资源
    最近更新 更多