cpf

cpf

0个粉丝

4

问答

0

专栏

0

资料

cpf  发布于  2015-06-01 18:32:46
采纳率 0%
4个问答
8843

如何让把指定的一组YUV图片编码成h264的,hi3516A平台,求助

在venc里怎么修改可以把指定的一组YUV图片编码成h264的,请各位指教。YUV图片是的格式一样都是1920*1080的。
我来回答
回答17个
时间排序
认可量排序

LinJoy

0个粉丝

1

问答

0

专栏

0

资料

LinJoy 2015-06-01 23:07:42
认可0
你要先了解 Hisi YUV 的存放格式, 建議自己先 GetFrame 研究看看
然後 從 Hisi 那邊配置記憶體, 自己模擬 Frame 的資料設定結構
然後丟給 venc 就好了

cpf

0个粉丝

4

问答

0

专栏

0

资料

cpf 2015-06-02 09:23:03
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=16692&ptid=7763]LinJoy 发表于 2015-6-1 23:07[/url]
你要先了解 Hisi YUV 的存放格式, 建議自己先 GetFrame 研究看看
然後 從 Hisi 那邊配置記憶體, 自己模擬  ...[/quote]

已经getframe得到YUV的图片了,现在想把得到的图片编码成h264的,不知道怎么做了。。

cpf

0个粉丝

4

问答

0

专栏

0

资料

cpf 2015-06-02 09:51:31
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=16692&ptid=7763]LinJoy 发表于 2015-6-1 23:07[/url]
你要先了解 Hisi YUV 的存放格式, 建議自己先 GetFrame 研究看看
然後 從 Hisi 那邊配置記憶體, 自己模擬  ...[/quote]

VIDEO_FRAME_INFO_S yuv_pstVideoFrame;
        HI_U32 *pu32PhyAddr;
        unsigned char **ppVitAddr;
        //const HI_CHAR *pstrMmb;
        //const HI_CHAR *pstrZone;
        HI_U32 u32Len;
       
        int kk0 =  HI_MPI_SYS_MmzAlloc(pu32PhyAddr, ppVitAddr, "","",1920*1080*3/2);
        printf("kk0 = %d",kk0);
        unsigned char *Ybuf= (unsigned char *) malloc(1920*1080*3/2);
        Ybuf = (unsigned char *)HI_MPI_SYS_Mmap(*pu32PhyAddr,1920*1080*3/2);
        printf("Ybuf = %x\n",Ybuf);
         FILE *yuvfile;
         yuvfile = fopen("vpss_file.yuv","rb");
         fread(Ybuf,1,1920*1080*3/2,yuvfile);

         yuv_pstVideoFrame.stVFrame.u32Width = 1080;
         yuv_pstVideoFrame.stVFrame.u32Height= 1920;
         yuv_pstVideoFrame.stVFrame.enPixelFormat = 23;
         
         yuv_pstVideoFrame.stVFrame.u32PhyAddr[0] = *pu32PhyAddr;
         yuv_pstVideoFrame.stVFrame.u32PhyAddr[1] = *pu32PhyAddr + 1920*1080;

这种格式的,然后
int kk = HI_MPI_VENC_SendFrame(0,&yuv_pstVideoFrame,-1);
         printf("kk = %d\n",kk);

运行出现错误,显示通道不存在,是什么原因。0通道的确是存在的

LinJoy

0个粉丝

1

问答

0

专栏

0

资料

LinJoy 2015-06-02 15:12:02
认可0
喔...0 通道要經由 HI_MPI_VENC_CreateChn HI_MPI_VENC_RegisterChn HI_MPI_VENC_StartRecvPic 等程序去建立使用
直接 HI_MPI_VENC_SendFrame 是會回說不存在

cpf

0个粉丝

4

问答

0

专栏

0

资料

cpf 2015-06-02 15:30:17
认可0
应经创建0 通道了,现在的错误提示是HI_ERR_VENC_ILLEGAL_PARAM 参数超出合法范围,怎么往下做呢。。

cpf

0个粉丝

4

问答

0

专栏

0

资料

cpf 2015-06-02 15:31:14
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=16715&ptid=7763]LinJoy 发表于 2015-6-2 15:12[/url]
喔...0 通道要經由 HI_MPI_VENC_CreateChn HI_MPI_VENC_RegisterChn HI_MPI_VENC_StartRecvPic 等程序去建 ...[/quote]


应经创建0 通道了,现在的错误提示是HI_ERR_VENC_ILLEGAL_PARAM 参数超出合法范围,怎么往下做呢。。

cpf

0个粉丝

4

问答

0

专栏

0

资料

cpf 2015-06-02 15:32:29
认可0
是不是  HI_MPI_SYS_MmzAlloc,和HI_MPI_SYS_Mmap函数用在这里不正确,求大家指教

LinJoy

0个粉丝

1

问答

0

专栏

0

资料

LinJoy 2015-06-04 02:07:06
认可0
會出現這個 HI_ERR_VENC_ILLEGAL_PARAM 訊息...代表參數錯誤
比對一下 venc 建立的結構, 看有那邊是無效或是超出範圍的, 要查
HiMPP 媒體處理軟件開發參考 文件

lovehaihong

0个粉丝

0

问答

0

专栏

0

资料

lovehaihong 2015-06-04 16:18:25
认可0
楼主你好,请问你的HI3516A平台从哪弄到的啊

cpf

0个粉丝

4

问答

0

专栏

0

资料

cpf 2015-06-04 18:49:28
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=16806&ptid=7763]LinJoy 发表于 2015-6-4 02:07[/url]
會出現這個 HI_ERR_VENC_ILLEGAL_PARAM 訊息...代表參數錯誤
比對一下 venc 建立的結構, 看有那邊是無效或 ...[/quote]

void thr_fn(VIDEO_FRAME_INFO_S *yuv_pstVideoFrame)
{
        printf("------------in pthread------\n");
        int kk,i = 0;
        while(i<10)
        {
                kk = HI_MPI_VENC_SendFrame(0,yuv_pstVideoFrame,-1);
                printf("i = %d,kk = %d\n",i,kk);
                i++;
                sleep(5);
        }
       
}

***********************************************************************

        VIDEO_FRAME_INFO_S yuv_pstVideoFrame;
        VIDEO_FRAME_S *pstVFrame;
        pthread_t pthreadid;
       
        HI_U32 my_u32BlkSize = 1920*1080*3/2;
        HI_U32 my_u32BlkCnt = 12;
        int ii = 0,kk = 0;
        VB_BLK VbBlk;
        VB_POOL VbPool = HI_MPI_VB_CreatePool(my_u32BlkSize,my_u32BlkCnt,NULL);

        printf("VbPool = %d\n",VbPool);
        if ( VB_INVALID_POOLID == VbPool )
        {
                printf("create vb err\n");
        }
//for(ii = 0;(ii < 10)&&(kk == 0);ii++)       

       
        VbBlk = HI_MPI_VB_GetBlock(VbPool,my_u32BlkSize,"");

        if (VB_INVALID_HANDLE == VbBlk )
        {
                printf("get vb block err\n");
                (void)HI_MPI_VB_DestroyPool(VbPool);
        }
       
       
        HI_U32 u32PhyAddr = HI_MPI_VB_Handle2PhysAddr(VbBlk);
       
        //HI_S32 HI_MPI_VB_MunmapPool(VbPool);

        //HI_S32 HI_MPI_VB_GetBlkVirAddr(VbPool,u32PhyAddr, ppVirAddr);
        unsigned char *Ybuf= (unsigned char *) malloc(1920*1080*3/2);
        Ybuf = (unsigned char *)HI_MPI_SYS_Mmap(u32PhyAddr,1920*1080*3/2);
        printf("Ybuf = %x\n",Ybuf);

       


         FILE *yuvfile;

         yuvfile = fopen("vpss_file.yuv","rb");


         int readret = fread(Ybuf,1,1920*540*3,yuvfile);
         printf("readret = %d\n",readret);
         fclose(yuvfile);

         pstVFrame = (VIDEO_FRAME_S *) malloc(sizeof(VIDEO_FRAME_S));
         pstVFrame->u32Width = 1920;
         pstVFrame->u32Height= 1080;
         pstVFrame->enPixelFormat = 23;
         pstVFrame->enVideoFormat = 0;
         pstVFrame->u32Field = 4;
         pstVFrame->enCompressMode = 0;
         pstVFrame->u32Stride[0] = 1920;
         pstVFrame->u32Stride[1] = 1920;
         pstVFrame->u32Stride[2] = 1920;
         pstVFrame->u32TimeRef = ii;

         pstVFrame->u32PhyAddr[0] = u32PhyAddr;
         pstVFrame->u32PhyAddr[1] = u32PhyAddr + 1920*1080;
         
         
         yuv_pstVideoFrame.stVFrame = *pstVFrame;
         yuv_pstVideoFrame.u32PoolId = VbPool;
       

        VENC_FRAME_RATE_S pstFrameRate;
        VENC_FRAME_RATE_S pstFrameRate2;
        pstFrameRate.s32SrcFrmRate = 1;
        pstFrameRate.s32DstFrmRate = 1;
       
        printf("start setframerate-----\n");
        int setframerateret = HI_MPI_VENC_SetFrameRate(0,&pstFrameRate);
        printf("setframerateret = %d",setframerateret);
        HI_MPI_VENC_GetFrameRate(0,&pstFrameRate2);
        printf("pstFrameRate.s32SrcFrmRate = %d\n",pstFrameRate2.s32SrcFrmRate);
        printf("pstFrameRate.s32DstFrmRate = %d\n",pstFrameRate2.s32DstFrmRate);
      



        int pthreadcrtret = pthread_create(&pthreadid, NULL,thr_fn,&yuv_pstVideoFrame);
        printf("pthreadcrtret = %d\n",pthreadcrtret);
               
        sleep(5);

        kk = HI_MPI_VENC_SendFrame(0,&yuv_pstVideoFrame,-1);
        printf("kk = %d,",kk);

        int kk2 = HI_MPI_VENC_SendFrame(0,&yuv_pstVideoFrame,-1);
        printf("kk2 = %d\n",kk2);
       
             //HI_MPI_SYS_Munmap(Ybuf,1920*540*3);

        //int relieaseblockret = HI_MPI_VB_ReleaseBlock(VbBlk);
        //printf("relieaseblockret = %d\n",relieaseblockret);

        //HI_S32 destroypoolret = HI_MPI_VB_DestroyPool(VbPool);

        //printf("destroypoolret = %d\n",destroypoolret);

        int maxstrmcnt;
        HI_S32 getmaxstreamret = HI_MPI_VENC_GetMaxStreamCnt(0,&maxstrmcnt);
        printf("getmaxstreamret = %d------maxstrmcnt = %d\n",getmaxstreamret,maxstrmcnt);
       
         printf("ii = %d\n",ii);


线程只能运行一次,也就是 HI_MPI_VENC_SendFrame只能运行一次,第二次就出现参数超出范围的错误,怎么解决。



       

cpf

0个粉丝

4

问答

0

专栏

0

资料

cpf 2015-06-04 18:50:10
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=16817&ptid=7763]lovehaihong 发表于 2015-6-4 16:18[/url]
楼主你好,请问你的HI3516A平台从哪弄到的啊[/quote]

公司买的。。。。。。。。。。。。。。

lovehaihong

0个粉丝

0

问答

0

专栏

0

资料

lovehaihong 2015-06-05 10:06:33
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=16824&ptid=7763]cpf 发表于 2015-6-4 18:50[/url]
公司买的。。。。。。。。。。。。。。[/quote]

知道公司从什么渠道买的吗?

scsi

0个粉丝

26

问答

0

专栏

2

资料

scsi 2016-03-08 20:57:00
认可0
估计是VENC一直没取走。

jiangchecjlu

0个粉丝

15

问答

0

专栏

0

资料

jiangchecjlu 2016-04-12 15:11:48
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=16824&ptid=7763]cpf 发表于 2015-6-4 18:50[/url]
公司买的。。。。。。。。。。。。。。[/quote]

楼主 您好 我也要实现这种功能 但是也是无法将YUV送进去 请问你那个问题解决了吗,如果解决是怎么解决的呢?

JACK_ZHANG

0个粉丝

5

问答

0

专栏

0

资料

JACK_ZHANG 2016-05-03 16:24:21
认可0
你这获取的就一帧的数据,送进去的时候,时间戳没有改变,到了后面当然不行咯(结构体的其他成员没有仔细研究,估计也有差别),代码看着有点感人,一个应用程序就一个函数看着好心塞

dsw2012218

0个粉丝

8

问答

0

专栏

0

资料

dsw2012218 2017-11-21 12:33:50
认可0
如果解决是怎么解决的呢?

hello666

0个粉丝

0

问答

0

专栏

0

资料

hello666 2018-03-27 23:00:00
认可0
点击链接加入群聊【双目视觉资料共享】:https://jq.qq.com/?_wv=1027&k=5ci6X4m
这个链接上有单目标定程序直接输出内外参数以及外参点云。群主可以解决你的问题。希望对楼上有帮助
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区