mirror of https://github.com/opencv/opencv.git
Page:
MediaSDK encode decode backend
Pages
.clang_format
2018
2019
2020
2021
2022
2023
2024
Archive
Branches
BuildOpenCV4OpenVINO
CI configuration
CPU optimizations build options
ChangeLog
CiteOpenCV
Coding_Style_Guide
Compact build advice
Contributing to G API: PRs
Custom OpenCV Android SDK and AAR package build
DNN Efficiency
Deep Learning in OpenCV
Documentation improvement plan
Enabling GStreamer source in G API
Enabling oneVPL source in G API
Evolution Proposals
FAQ
G API Ideas towards OpenCV 5.0
G API Python Bindings
GSoC_2017
GSoC_2018
GSoC_2019
GSoC_2020
GSoC_2021
GSoC_2022
GSoC_2023
GSoC_2024
Graph API
Home
HowToUsePerfTests
HowToWritePerfTests
How_to_contribute
Huawei CANN Backend
Intel OpenVINO backend
Linux_contribution_guide
MediaSDK encode decode backend
OE 0. Template
OE 1. Old C API
OE 10. FP16
OE 11. Logging
OE 12. Lapack
OE 13. DNN ONNX Importer
OE 14. DNN FP16
OE 15. Bit Exactness
OE 16. Mini Halide
OE 17. New Filter Engine
OE 18. Module Optflow
OE 19. Module Stereo
OE 2. OpenCV 2
OE 20. Module Calibration
OE 21. Module Tracking
OE 21. Tracking API
OE 22. Module Point Cloud
OE 23. Module GAPI
OE 24. Module HighGUI
OE 25. Fast VideoIO
OE 26. Samples
OE 27. Wide Universal Intrinsics
OE 28. Image Stitching
OE 29. Adding AVX512 Support
OE 3. OpenCV 3
OE 30. Color Calibration
OE 31. Julia Bindings
OE 32. Change OpenCV License to Apache 2
OE 33. 3D Module
OE 34. Named Parameters
OE 35. TFLite support
OE 4. OpenCV 4
OE 5. OpenCV 5
OpenCL optimizations
OpenCV 5
OpenCV Debugging Facilities
OpenCV Platforms
OpenCV RISC V
OpenCVLogo
OpenCV_GSoC
OpenCV_GSoC_Application
Opencv3
Opencv4
Profiling OpenCV Applications
QA_in_OpenCV
Running native OpenCV code with Hardware Address Sanitizer
TIM VX Backend For Running OpenCV On NPU
Template
TensorFlow Object Detection API
TensorFlow text graphs
Using G API with MS ONNX Runtime
Using G API with OpenCV AI Kit (OAK)
Using G API with OpenVINO Toolkit
Using G API with PlaidML backend
Video IO hardware acceleration
Video capture and write benchmark
[Deprecated] Tengine based acceleration
3
MediaSDK encode decode backend
Maksim Shabunin edited this page 2017-11-01 15:10:36 +03:00
Table of Contents
Building OpenCV with MediaSDK support
- Install MediaSDK
- Make sure corresponding environment variable is set, Windows: INTELMEDIASDKROOT, Linux: MFX_HOME
- Build with
-DWITH_MFX
option turned on:cmake -DWITH_MFX=ON <path-to-opencv-sources> cmake --build .
Decoding
Media containers are not supported yet, so it is only possible to decode raw video stream stored in a file. It can be extracted from a container manually using the FFmpeg tool (source1, source2) or any other tools:
# H264
ffmpeg -i video.avi -vcodec copy -an -bsf:v h264_mp4toannexb video.264
# H265
ffmpeg -i in.mkv -c:v copy -bsf hevc_mp4toannexb out.h265
Then you can use VideoCapture object to decode the resulting file:
VideoCapture cap(“video.264”, CAP_INTEL_MFX);
Note!
The file extension is important, because it will be used to determine the codec. It can be one of .264
, .h264
, .mp2
, .mpeg2
, .265
or .hevc
.
Encoding
Use the VideoWriter object:
int fourcc = VideoWriter::fourcc('H', '2', '6', '4');
VideoWriter writer(filename, CAP_INTEL_MFX, fourcc, fps, frameSize, isColor);
Where fourcc
can be one of MPG2
, H264
, X264
, AVC
, H265
or HEVC
.
- Home
- Deep Learning in OpenCV
- Running OpenCV on Various Platforms
- OpenCV 5
- OpenCV 4
- OpenCV 3
- Development process
- OpenCV GSoC
- Archive
© Copyright 2024, OpenCV team