Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File OpenCV 3.4.3-视频写入时未调用GStream_File_Opencv_Gstreamer_Pipeline_X264 - Fatal编程技术网

File OpenCV 3.4.3-视频写入时未调用GStream

File OpenCV 3.4.3-视频写入时未调用GStream,file,opencv,gstreamer,pipeline,x264,File,Opencv,Gstreamer,Pipeline,X264,我想用GStreamer成功地编写一个OpenCV编码的文件 因此我使用代码: VideoWriter.open("appsrc ! autovideoconvert ! omxh264enc ! matroskamux ! filesink location=test2.mkv sync=false", //cv::CAP_GSTREAMER, //set or not, I get the same problem 0, (double)25, //fourcc, fps cv::Size(

我想用GStreamer成功地编写一个OpenCV编码的文件

因此我使用代码:

VideoWriter.open("appsrc ! autovideoconvert ! omxh264enc ! matroskamux ! filesink location=test2.mkv sync=false",
//cv::CAP_GSTREAMER, //set or not, I get the same problem
0, (double)25, //fourcc, fps
cv::Size(1024, 1024), 
true);
和我的问题:

VideoWriter.open("appsrc ! autovideoconvert ! omxh264enc ! matroskamux ! filesink location=test2.mkv sync=false",
//cv::CAP_GSTREAMER, //set or not, I get the same problem
0, (double)25, //fourcc, fps
cv::Size(1024, 1024), 
true);
一个名为appsrc的视频文件!自动视频转换!天哪!马特罗斯卡莫!创建了filesink location=test2.mkv sync=false(而不是test2.mkv),并且为空。相同的问题已更正,并且似乎在以下线程中工作,对我没有任何影响:

我尝试过,但没有成功:

VideoWriter.open("appsrc ! autovideoconvert ! omxh264enc ! matroskamux ! filesink location=test2.mkv sync=false",
//cv::CAP_GSTREAMER, //set or not, I get the same problem
0, (double)25, //fourcc, fps
cv::Size(1024, 1024), 
true);
  • 在文件名test2中添加引号: “appsrc!autovideoconvert!omxh264enc!matroskamux!filesink location=\”test2.mkv\“sync=false”两者都不是
  • 使用不同格式编码:.flv而不是.mkv
  • 使用不同的编解码器编码:omxh265enc而不是omxh264en
我选中了:

VideoWriter.open("appsrc ! autovideoconvert ! omxh264enc ! matroskamux ! filesink location=test2.mkv sync=false",
//cv::CAP_GSTREAMER, //set or not, I get the same problem
0, (double)25, //fourcc, fps
cv::Size(1024, 1024), 
true);
  • GStreamer使用OpenCV进行了良好的编译;OpenCV项目的CMake输出:

    视频输入/输出:Windows视频:是 DC1394:没有 FFMPEG:是(预构建的二进制文件) avcodec:是(版本57.107.100) AVF格式:是(版本57.83.100) avutil:是(版本55.78.100) swscale:是(版本4.8.100) avresample:是(3.7.0版) GStreamer:

    基础:是(1.0版)

    视频:是(1.0版)

    应用程序:是(1.0版)

    riff:是(1.0版)

    pbutils:是(1.0版)

    DirectShow:是的

    媒体基金会:是的

  • FFMpeg安装在我的计算机上;为此,我使用了VLC:

    文件->流->添加文件,然后流 新目的地:RTP/MPEG传输流 简介:视频-H.264+MP3(MP4) 这样就不会发生错误;注意:视频-H.265+MP3出现错误 (MP4),但我在代码中使用的是omxh264enc,而不是265

我很抱歉,你知道吗? 非常感谢:)

祝你过得愉快

蒂鲍特

PS-完成OpenCV CMake输出:

Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.17763.
AVX_512F is not supported by C++ compiler

AVX512_SKX is not supported by C++ compiler

Dispatch optimization AVX512_SKX is not available, skipped

libjpeg-turbo: VERSION = 1.5.3, BUILD = opencv-3.4.3-libjpeg-turbo

Looking for Mfapi.h

Looking for Mfapi.h - found

found Intel IPP (ICV version): 2017.0.3 [2017.0.3]

at: E:/OpenCV/3.4.3/build-cuda92-gstreamer/3rdparty/ippicv/ippicv_win

found Intel IPP IW sources: 2017.0.3

at: E:/OpenCV/3.4.3/build-cuda92-gstreamer/3rdparty/ippicv/ippiw_win

CUDA detected: 9.2

CUDA NVCC target flags: -gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-D_FORCE_INLINES

Found apache ant: C:/NVPACK/apache-ant-1.8.2/bin/ant.bat (1.8.2)

Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)

VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file

Caffe: NO

Protobuf: NO

Glog: YES

freetype2: NO

harfbuzz: NO

Module opencv_ovis disabled because OGRE3D was not found

No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.

Found installed version of gflags: E:/Git/gflags/BUILD-VS2015

Detected gflags version: 2.2.1

Checking SFM deps... FALSE

Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags

Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp

Tesseract: NO


General configuration for OpenCV 3.4.3 =====================================

Version control: unknown


Extra modules:

Location (extra): E:/OpenCV/3.4.3/opencv_contrib-3.4.3/modules

Version control (extra): unknown


Platform:

Timestamp: 2018-11-07T16:57:18Z

Host: Windows 10.0.17763 AMD64

CMake: 3.12.0-rc2

CMake generator: Visual Studio 14 2015 Win64

CMake build tool: C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe

MSVC: 1900


CPU/HW features:

Baseline: SSE SSE2 SSE3

requested: SSE3

Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2

requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX

SSE4_1 (5 files): + SSSE3 SSE4_1

SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2

FP16 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX

AVX (6 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX

AVX2 (11 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2


C/C++:

Built as dynamic libs?: YES

C++11: YES

C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe (ver 19.0.24215.1)

C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP16 /MD /O2 /Ob2 /DNDEBUG

C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP16 /MDd /Zi /Ob0 /Od /RTC1

C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe

C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /MP16 /MD /O2 /Ob2 /DNDEBUG

C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /MP16 /MDd /Zi /Ob0 /Od /RTC1

Linker flags (Release): /machine:x64 /INCREMENTAL:NO

Linker flags (Debug): /machine:x64 /debug /INCREMENTAL

ccache: NO

Precompiled headers: YES

Extra dependencies: cudart.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cublas.lib cufft.lib -LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/lib/x64

3rdparty dependencies:


OpenCV modules:

To be built: aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dpm face features2d flann fuzzy hfs highgui img_hash imgcodecs imgproc java java_bindings_generator line_descriptor ml objdetect optflow phase_unwrapping photo plot python_bindings_generator reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto

Disabled: js world

Disabled by dependency: -

Unavailable: cnn_3dobj cvv freetype hdf matlab ovis python2 python3 sfm viz

Applications: tests perf_tests apps

Documentation: NO

Non-free algorithms: NO


Windows RT support: NO


GUI:

Win32 UI: YES

VTK support: NO


Media I/O:

ZLib: build (ver 1.2.11)

JPEG: build-libjpeg-turbo (ver 1.5.3-62)

WEBP: build (ver encoder: 0x020e)

PNG: build (ver 1.6.34)

TIFF: build (ver 42 - 4.0.9)

JPEG 2000: build (ver 1.900.1)

OpenEXR: build (ver 1.7.1)

HDR: YES

SUNRASTER: YES

PXM: YES


Video I/O:

Video for Windows: YES

DC1394: NO

FFMPEG: YES (prebuilt binaries)

avcodec: YES (ver 57.107.100)

avformat: YES (ver 57.83.100)

avutil: YES (ver 55.78.100)

swscale: YES (ver 4.8.100)

avresample: YES (ver 3.7.0)

GStreamer:

base: YES (ver 1.0)

video: YES (ver 1.0)

app: YES (ver 1.0)

riff: YES (ver 1.0)

pbutils: YES (ver 1.0)

DirectShow: YES

Media Foundation: YES


Parallel framework: Concurrency


Trace: YES (with Intel ITT)


Other third-party libraries:

Intel IPP: 2017.0.3 [2017.0.3]

at: E:/OpenCV/3.4.3/build-cuda92-gstreamer/3rdparty/ippicv/ippicv_win

Intel IPP IW: sources (2017.0.3)

at: E:/OpenCV/3.4.3/build-cuda92-gstreamer/3rdparty/ippicv/ippiw_win

Custom HAL: NO

Protobuf: build (3.5.1)


NVIDIA CUDA: YES (ver 9.2, CUFFT CUBLAS NVCUVID)

NVIDIA GPU arch: 30 35 37 50 52 60 61 70

NVIDIA PTX archs:


OpenCL: YES (no extra features)

Include path: E:/OpenCV/3.4.3/opencv-3.4.3/3rdparty/include/opencl/1.2

Link libraries: Dynamic load


Python (for build): C:/ProgramData/Miniconda3/python.exe


Java:

ant: C:/NVPACK/apache-ant-1.8.2/bin/ant.bat (ver 1.8.2)

JNI: C:/NVPACK/jdk1.8.0_77/include C:/NVPACK/jdk1.8.0_77/include/win32 C:/NVPACK/jdk1.8.0_77/include

Java wrappers: YES

Java tests: YES


Matlab: NO


Install to: E:/OpenCV/3.4.3/build/install

-----------------------------------------------------------------


Configuring done
选择Windows SDK版本10.0.17134.0以Windows 10.0.17763为目标。
C++编译器不支持AVXY512F
C++编译器不支持AVX512YSKX
调度优化AVX512_SKX不可用,已跳过
libjpeg-turbo:VERSION=1.5.3,BUILD=opencv-3.4.3-libjpeg-turbo
正在查找Mfapi.h
正在查找Mfapi.h-找到
发现英特尔IPP(ICV版本):2017.0.3[2017.0.3]
网址:E:/OpenCV/3.4.3/build-cuda92-gstreamer/3rdparty/ippicv/ippicv\u-win
找到英特尔IPP IW来源:2017.0.3
网址:E:/OpenCV/3.4.3/build-cuda92-gstreamer/3rdparty/ippicv/ippiw\u-win
检测到CUDA:9.2
CUDA NVCC目标标志:-gencode;arch=compute_30,code=sm_30-根代码;arch=compute_35,code=sm_35-根代码;arch=compute_37,code=sm_37-根代码;arch=compute_50,code=sm_50-根代码;arch=compute_52,code=sm_52-根代码;arch=compute_60,code=sm_60-根代码;arch=compute_61,code=sm_61-根代码;arch=compute_70,code=sm_70-D_力线
找到apacheant:C:/NVPACK/apache-ant-1.8.2/bin/ant.bat(1.8.2)
找不到Matlab(缺少:Matlab\u MEX\u脚本Matlab\u包含\u目录Matlab\u根目录Matlab\u目录Matlab\u库Matlab\u目录Matlab\u MEXEXT Matlab\u ARCH Matlab\u BIN)
找不到VTK。请将CMake中的-DVTK_DIR设置为VTK build目录,或使用VTKConfig.CMake文件设置为VTK install子目录
咖啡馆:没有
普罗托夫:没有
格洛格:是的
freetype2:没有
哈夫布兹:没有
模块opencv_ovis已禁用,因为找不到OGRE3D
没有使用导出的gflags CMake配置集的首选项,也没有提供包含/库目录的提示。默认为首选已安装/导出的gflags CMake配置(如果可用)。
找到gflags的安装版本:E:/Git/gflags/BUILD-VS2015
检测到gflags版本:2.2.1
正在检查SFM部门。。。错误的
模块opencv_sfm已禁用,因为未找到以下依赖项:特征Glog/Gflags
从源文件列表中排除:/modules/dnn/layers/layers\u common.avx512\u skx.cpp
特塞拉特:没有
OpenCV 3.4.3的一般配置=====================================
版本控制:未知
额外模块:
位置(额外):E:/OpenCV/3.4.3/OpenCV_contrib-3.4.3/模块
版本控制(额外):未知
站台:
时间戳:2018-11-07T16:57:18Z
主机:Windows 10.0.17763 AMD64
CMake:3.12.0-rc2
CMake生成器:Visual Studio 14 2015 Win64
CMake生成工具:C:/Program Files(x86)/MSBuild/14.0/bin/MSBuild.exe
MSVC:1900
CPU/HW功能:
基线:SSE2 SSE3
请求:SSE3
调度代码生成:SSE4_1 SSE4_2 FP16 AVX AVX2
请求:SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
SSE4_1(5个文件):+SSSE3 SSE4_1
SSE4_2(2个文件):+SSSE3 SSE4_1 POPCNT SSE4_2
FP16(2个文件):+SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX(6个文件):+SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2(11个文件):+SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
C/C++:
构建为动态库?:是
C++11:是的
C++编译器:C//程序文件(x86)/微软Visual Studio 140/Vc/BI/x86YAMD64/CL .EXE(VER 19.0.2427.1)
C++标志(释放):/dWi32/D4W/G4/D;
C++FLAGS(Debug):/dWi2/d4/D4W/GR/D,CRTYSEC++,No.DePrCeDe/D.O.StCl,No.Eng/BiObj/OI/EHa/WD4127/WD4251/WD4324/WD4125/WD45 12/WD45 89/MP16/MDD/ZI/OB0/OD/RTC1
C编译器:C:/ProgramFiles(x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
C标志(发布):/DWIN32/D_WINDOWS/W3/D_CRT_SECURE_NO_DEPRECATE/D_CRT_nonsdc_NO_DEPRECATE/D_SCL_SECURE_NO_WARNINGS/Gy/bigobj/Oi/MP16/MD/O2/Ob2/DNDEBUG
C标志(调试):/DWIN32/D_WINDOWS/W3/D_CRT_SECURE_NO_DEPRECATE/D_CRT_nonsdc_NO_DEPRECATE/D_SCL_SECURE_NO_WARNINGS/Gy/bigobj/Oi/MP16/MDd/Zi/Ob0/Od/RTC1
链接器标志(发布):/machine:x64/INCREMENTAL:NO
链接器标志(调试):/machine:x64/Debug/INCREMENTAL
卡切:没有
预编译头:是
额外依赖项:cudart.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.l