这是对的吗?有没有人知道新的x264 [英] is this right ?does any one know the new x264

查看:53
本文介绍了这是对的吗?有没有人知道新的x264的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是使用新的x264 api的权利,我想获得一个帧,并用x264编码,然后将其保存为.264文件?

但我不知道是这个是对吗?

is this right to use the new x264 api ,i want to get a frame ,and encode it with x264,then save it to a .264 file?
but i do not know is this is right ?

picIn.img.plane[0] = pInBuffer ;
picIn.img.plane[1] = pInBuffer +m_VideoEncParam.nWidth*m_VideoEncParam.nHeight ;
picIn.img.plane[2] = pInBuffer +m_VideoEncParam.nWidth*m_VideoEncParam.nHeight*5/4 ;

picIn.img.i_stride[0] = m_VideoEncParam.nWidth ;
picIn.img.i_stride[1] = m_VideoEncParam.nWidth /2 ;
picIn.img.i_stride[2] = m_VideoEncParam.nWidth /2 ;

nRet = x264_encoder_encode(
    m_pX264Handle,
    &pNal,
    &nNalCount,
    &picIn,
    &picOut);
if (nRet<0)
{
    return -1 ;
}
	
for (int i = 0 ;i<nNalCount;i++);	
{
    
    x264_nal_encode(m_pX264Handle,pOutBuffer+nLenOut,&pNal[i]);
    nLenOut += pNal[i].i_payload ;
}
int nSize = 0 ;
FILE *pFile = fopen(pchFileName,"w") ;
if (!pFile)
{
    return -1 ;
}
nSize = fwrite(pOutBuffer,1,nLenOut,pFile) ;
fclose(pFile) ;







推荐答案

我已经解决了这个问题谢谢大家
i have solve this problem thank you everyone


这篇关于这是对的吗?有没有人知道新的x264的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆