Comments (3)
I have same issue.
from libwebrtc.
Hi @nikohpng Can you test this code block below for your case?
I can get the yuv data buffer successfully but still have rendering issue...
I found the MSDK
produces NV12(see intel media-sdk manual) pixel format, the mfxFrameData
stores the yuv data (see the mfxFrameData definition), change these code to code below see if you can retrieve yuv data.
mfxFrameData frame_data = pOutputSurface->Data;
mfxMemId dxMemId = frame_data.MemId;
mfxFrameInfo frame_info = pOutputSurface->Info;
m_pmfx_allocator_->LockFrame(dxMemId, &frame_data);
// always nv12
int w = frame_info.Width;
int h = frame_info.Height;
int stride_uv = (w + 1) / 2;
uint8_t* data_y = frame_data.Y;
uint8_t* data_u = frame_data.U;
uint8_t* data_v = frame_data.V;
rtc::scoped_refptr<NV12Buffer> nv12_buffer = webrtc::NV12Buffer::Create(w, h);
if (nv12_buffer.get()) {
libyuv::I420ToNV12(data_y, w, data_u, stride_uv, data_v, stride_uv,
nv12_buffer->MutableDataY(),
nv12_buffer->StrideY(),
nv12_buffer->MutableDataUV(),
nv12_buffer->StrideUV(), w, h);
rtc::scoped_refptr<VideoFrameBuffer> buffer = std::move(nv12_buffer);
if (callback_) {
webrtc::VideoFrame decoded_frame(buffer, inputImage.Timestamp(), 0,
webrtc::kVideoRotation_0);
decoded_frame.set_ntp_time_ms(inputImage.ntp_time_ms_);
decoded_frame.set_timestamp(inputImage.Timestamp());
callback_->Decoded(decoded_frame);
}
}
m_pmfx_allocator_->UnlockFrame(dxMemId, &frame_data);
from libwebrtc.
After calling m_pmfx_allocator_->LockFrame(dxMemId, &frame_data);
, the yuv data can be retrieved, but the code above for converting i420ToNV12 is WRONG, please see the correct way for coverting nv12 -> i420.
from libwebrtc.
Related Issues (20)
- 请问目前libwebrtc的master分支是对应webrtc m97_release分支代码吗? HOT 1
- Seems like code is either broken or need some information for compilation error. Can't find class "webrtc::AudioDeviceSink" anywhere. HOT 2
- 使用jpeg库时,boolean会重复定义 HOT 3
- 参数控制抓屏画面是否携带鼠标 HOT 2
- JPEG parameter struct mismatch HOT 3
- Recommand to move all threads to rtc_peerconnection_factory HOT 1
- How to listen for window closing HOT 5
- Please clarify which branch or start tagging build versions HOT 1
- How to compile Android version by myself
- When i dispose videorender, it crashed HOT 1
- Conan support HOT 3
- RTP Forwarding
- Audio MediaRecord support HOT 1
- Implementing Custom Capture in Libwebrtc? HOT 1
- segfault trying to establish audio connection HOT 2
- Building LibWebRTC for windows leads to error HOT 2
- Libwebrtc sample files
- Compilation with Conan on Ubuntu 20.04
- Create documentation showing how to setup a simple hello webrtc project with the library
- How should I use frame encryption on Android, is there any demo code?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libwebrtc.