Webm工具设置问题

时间:2016-11-28 19:49:01

标签: cmake webm mpeg-dash

我一直试图将此设置为半天,我正在绝望,请帮忙。 我正在关注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".

正如我之前提到的,我使用libwebm进行了该过程的第2步。 我已经尝试删除libwebm,我得到的反应是libwebm不存在,因此无法执行操作。我曾尝试过使用CMakeLists.txt,但由于我不明白其中的根本原因,因此没有取得任何成果。文档不存在(或者我找不到)所以我不得不求助于此。如果我忘记添加内容,请询问。

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

1 个答案:

答案 0 :(得分:0)

我花了一些时间摆弄这个并想出了一个有效的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。