Comments (14)
hevc dec out stride is MPP_ALIGN(val, 256) | 256; so 2560 the dec out stride is 2816 and 800 out stride is 1280 , you should get stride from get frame, no set by yourself
from mpp.
@zinsayon
if use MPP_ALIGN(val, 256) | 256, it will display with exception. so I change the code, and now 2560x1440 display is ok.
and use AVC(h264),the display is both ok(2560x1440,800x600)
AVC log below:
decode_get_frame get info changed found.
decoder require buffer w:h [2560:1440] stride [2560:1440]
decode_get_frame get info changed found.
decoder require buffer w:h [800:600] stride [800:608]
decode_get_frame get info changed found.
from mpp.
the min stride for hevc is 64 align,avc min stride is 16,so you can't set stride small then 64 in hevc decode,if stride big then need, you can used setcrop to crop exception part
from mpp.
@zinsayon
with 1600x900 resolution,the avc decode and display well
decoder require buffer w:h [1600:900] stride [1600:912]
but change to hevc, it displayed with exception,I find the SPS info 1600x928
use H264BSAnalyzer.exe to play,it's ok
from mpp.
if hevc_hor_align is 64 ,hevc_ver defaut 8 align, so the stride is [1600:904] you should check the stride you set to display is right, if displayed with exception,you can dump yuv, used yuview tool to check the data
from mpp.
@zinsayon
Nvidia NVENC:
There is no B-Frame support for HEVC encoding, and the maximum CU size is 32×32.
Does this matter?
from mpp.
no matter
from mpp.
@zinsayon
I test with ffplay,it play ok.
but with mpp dump to YUV420SP, use 7yuv,it had some problem.
from mpp.
which value you set to hor_stride ? show the code how do you write 420sp
from mpp.
hi @zinsayon
I had not set hor_stride,I check the code ,find that it was set by libmpp,and get the stride info from SPS.
int Codec::dump_mpp_frame_to_file(MppFrame frame, FILE *fp)
{
RK_U32 width = 0;
RK_U32 height = 0;
RK_U32 h_stride = 0;
RK_U32 v_stride = 0;
MppFrameFormat fmt = MPP_FMT_YUV420SP;
MppBuffer buffer = NULL;
RK_U8 *base = NULL;
if (!fp || !frame)
return -1;
width = mpp_frame_get_width(frame);
height = mpp_frame_get_height(frame);
h_stride = mpp_frame_get_hor_stride(frame);
v_stride = mpp_frame_get_ver_stride(frame);
fmt = mpp_frame_get_fmt(frame);
buffer = mpp_frame_get_buffer(frame);
if(!buffer)
return -2;
base = (RK_U8 *)mpp_buffer_get_ptr(buffer);
{
RK_U32 i;
RK_U8 *base_y = base;
RK_U8 *base_u = base + h_stride * v_stride;
RK_U8 *base_v = base_u + h_stride * v_stride / 4;
for (i = 0; i < height; i++, base_y += h_stride)
fwrite(base_y, 1, width, fp);
for (i = 0; i < height / 2; i++, base_u += h_stride / 2)
fwrite(base_u, 1, width / 2, fp);
for (i = 0; i < height / 2; i++, base_v += h_stride / 2)
fwrite(base_v, 1, width / 2, fp);
}
return 0;
}
from mpp.
due to the output is 420sp so you dump uv is no right
RK_U8 *base_uv = base + h_stride * v_stride;
for (i = 0; i < height / 2; i++, base_uv += h_stride )
fwrite(base_uv , 1, width, fp);
from mpp.
You know how I can fix this?
If I play any H265 video in Android and the height is not divisible by 16, the video doesn't play.
It is something to do with stride, same as on Linux.
Video having a problem
Video Resolution 1920x952p, Buffer Resolution 1920x960p, they don't match because of stride.
https://mega.nz/file/Q7QVFKJA#DGRBWtU2jVnKqBUdWJ_xGq_OGcQTut3mhUppxe-En3s
Video that can play correctly
960 height, 16 aligned - Video resolution and Video dimension is 1920x960p
https://mega.nz/file/A3IXwAzA#hnyYLtzXzpFBM2zxAgc-8_fUD5iDGCpzTEL9APpdeSg
What file did you modify and what changed, can you help?
from mpp.
Can you run mpi_dec_test and try input the raw steam?
from mpp.
Can you run mpi_dec_test and try input the raw steam?
Is there an easy command to try mpi_dec_test on Android or Linux?
Both these videos can't play but if I re-encode them and change the height to 960 then they both play correctly.
Height 808 pixels
https://mega.nz/file/gyw2iSyJ#PVkglqGQYg8xGTb10aYJr52YlyZh3nQEFKWbg5SPYp4
Height 792 pixles
https://mega.nz/file/s6ZWmDYQ#NfvKsU-dN3Dg5_Qdd34ac6JFjGwMiYWpP6_4ZORbhVs
If in below 2 files I change the alignment from 64 to 32 then the 2 videos start playing in Android 11 but the whole videos are green and show a double image.
h265d_refs.c
mpp_frame_set_hor_stride(frame->frame,
(MPP_ALIGN(s->h265dctx->coded_width, 32) * s->h265dctx->nBitDepth) >> 3);
static RK_U32 hor_align_64(RK_U32 val)
{
return MPP_ALIGN(val, 32);
hal_h265d_rkv.c
stride_y = ((MPP_ALIGN(width, 32)
* (dxva_cxt->pp.bit_depth_luma_minus8 + 8)) >> 3);
stride_uv = ((MPP_ALIGN(width, 32)
* (dxva_cxt->pp.bit_depth_chroma_minus8 + 8)) >> 3);
from mpp.
Related Issues (20)
- RK3568 mpp decode h264 failed HOT 1
- [h264e_vepu580]: Add dpb hal func and more buffer]实现也应该同时实现h264e_vepu541 HOT 5
- RK3399 解码速度控制 HOT 4
- Missing linux/dma-buf.h with older Linux headers HOT 1
- rv1126解码h264视频显示到显示屏幕上看,画面一卡一卡的,有时短暂时间又会流畅 HOT 5
- mpp_log: can not found match soc name: radxa,radxa-cm3-io rockchip,rk3566 HOT 1
- Build mpp, and gets Segmentation Fault HOT 2
- rv1126使用rkmedia的vdec接口进行解码jpeg图片时段错误,解码h264/h265没有问题(但是有内存泄漏问题) HOT 8
- rv1126解码h264有内存泄漏 HOT 3
- build mpp,but test log show Rk3588 does not support HOT 1
- RK3566 H264解码性能较差,实测到到不了60fps HOT 13
- 请教下,测试RK3588 H264硬件编码出来的帧都是I帧,是什么原因呢? HOT 7
- 能否修改mpp目录以及mpp/legacy目录下的CMakeLists.txt,使得能否同时生成同名的动态库以及静态库? HOT 1
- 解码后的数据拷贝很慢 HOT 4
- void os_log_error(const char* tag, const char* msg, va_list list)会崩 HOT 3
- 解码 hevc 码流一直报错 PPS id out of range: 0 HOT 5
- jpeg decode stuck using test/mpi_dec_mt_test
- MPP can't be initialized on RK3568B2 HOT 4
- 如何绑定纹理指针,让MPP解码直接将数据赋值给纹理指针? HOT 2
- 最新包 aarch64崩溃问题 HOT 10
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 mpp.