Hello,
I am trying to create a video encoder program by using the DMAI functions. I already created a working AAC decoder program, so I am familiar with the API quite a bit. The current code of the encoder fails during this call:
hEnc = Venc1_create(hEngine, "h264enc", ¶ms, &dynParams);
Engine_open() works and hEngine is not NULL. The parameter structures have PAL D1 as maximum video resolution. param.size is set to sizeof(VIDENC1_Params). So I ran the program with CE_DEBUG=2. The output says, that XDM_SETPARAMS failed with status code -1, which boils down to the extremely helpful "unspecified error". Obviously, the failure occurs at the VIDENC_control() function, which is called by Venc1_create().
Does somone know, where the problem might be? Appended below is the debug information.
Best regards,Andreas
-
**** Debug info ****
@0,226,749us: [+2 T:0x4001e340] ti.sdo.dmai - [Venc1] Creating encoder h264enc for max 720x576 bitrate 6000000 ratectrl 1@0,226,841us: [+0 T:0x4001e340] ti.sdo.ce.video1.VIDENC1 - VIDENC1_create> Enter (engine=0x57508, name='h264enc', params=0xbeafdc4c)@0,226,932us: [+0 T:0x4001e340] CV - VISA_create(0x57508, 'h264enc', 0xbeafdc4c, 0x520, 'ti.sdo.ce.video1.IVIDENC1')@0,226,993us: [+0 T:0x4001e340] CV - VISA_create2(0x57508, 'h264enc', 0xbeafdc4c, 0x30, 0x520, 'ti.sdo.ce.video1.IVIDENC1')@0,227,085us: [+0 T:0x4001e340] CE - Engine_createNode(0x57508, 'h264enc', 520, 0xbeafdc4c, 0x30, 0xbeafda70)@0,227,146us: [+0 T:0x4001e340] CE - Engine> allocNode Enter(engine=0x57508, impId='h264enc')@0,227,237us: [+0 T:0x4001e340] CE - Engine> allocNode(). Calling (Comm_create(gppfromnode_1041_1, 0x57af0, NULL)@0,248,294us: [+4 T:0x4001e340] CE - Engine_createNode> created node(stdIn=0x2, stdOut=0x10001, msgq=0x57b10, algName='h264enc', rmsNode=0x87f11e08, algHandle=0x87f11ef8)[DSP] @0,045,518tk: [+0 T:0x87f0d334] OM - Memory_alloc> Enter(size=0x18)[DSP] @0,045,567tk: [+0 T:0x87f0d334] OM - Memory_alloc> return (0x87f11e08)[DSP] @0,045,610tk: [+0 T:0x87f0d334] OM - Memory_alloc> Enter(size=0xa)[DSP] @0,045,647tk: [+0 T:0x87f0d334] OM - Memory_alloc> return (0x87f11e20)[DSP] @0,045,693tk: [+0 T:0x87f0d334] OM - Memory_alloc> Enter(size=0x20)[DSP] @0,045,731tk: [+0 T:0x87f0d334] OM - Memory_alloc> return (0x87f11e30)[DSP] @0,045,773tk: [+0 T:0x87f0d334] OM - Memory_alloc> Enter(size=0x24)[DSP] @0,045,811tk: [+0 T:0x87f0d334] OM - Memory_alloc> return (0x87f11e50)[DSP] @0,045,878tk: [+0 T:0x87f0d334] ti.sdo.ce.video1.VIDENC1 - VIDENC1_create> Enter (engine=0x0, name='h264enc', params=0x873048c0)[DSP] @0,045,948tk: [+0 T:0x87f0d334] CV - VISA_create(0x0, 'h264enc', 0x873048c0, 0x520, 'ti.sdo.ce.video1.IVIDENC1')[DSP] @0,046,010tk: [+0 T:0x87f0d334] CV - VISA_create2(0x0, 'h264enc', 0x873048c0, 0x30, 0x520, 'ti.sdo.ce.video1.IVIDENC1')[DSP] @0,046,084tk: [+0 T:0x87f0d334] CE - Engine_open> Enter('local', 0x87f1100c, 0x873048c0)[DSP] @0,046,136tk: [+0 T:0x87f0d334] OM - Memory_alloc> Enter(size=0x34)[DSP] @0,046,174tk: [+0 T:0x87f0d334] OM - Memory_alloc> return (0x87f11ec0)[DSP] @0,046,236tk: [+4 T:0x87f0d334] CE - Engine_open> engine->server = 0x0[DSP] @0,046,276tk: [+0 T:0x87f0d334] CE - Engine_open> return(-2014241088)[DSP] @0,046,335tk: [+0 T:0x87f0d334] OM - Memory_alloc> Enter(size=0x34)[DSP] @0,046,372tk: [+0 T:0x87f0d334] OM - Memory_alloc> return (0x87f11ef8)[DSP] @0,046,416tk: [+0 T:0x87f0d334] ti.sdo.ce.alg.Algorithm - Algorithm_create> Enter(fxns=0x87f8e8b8, idma3Fxns=0x87f8e8e4, iresFxns=0x0, params=0x873048c0, attrs=0x87f11128)[DSP] @0,046,504tk: [+0 T:0x87f0d334] OM - Memory_alloc> Enter(size=0x10)[DSP] @0,046,541tk: [+0 T:0x87f0d334] OM - Memory_alloc> return (0x87f11f30)[DSP] @0,073,003tk: [+0 T:0x87f0d334] ti.sdo.ce.alg.Algorithm - Algorithm_create> return (0x87f11f30)[DSP] @0,073,079tk: [+5 T:0x87f0d334] CV - VISA_create> local codec created (name='h264enc', handle=0x87f11f30)[DSP] @0,073,137tk: [+0 T:0x87f0d334] ti.sdo.ce.video1.VIDENC1 - VIDENC1_create> return (0x87f11ef8)[DSP] @0,073,229tk: [+4 T:0x87f0d334] OT - Thread_create > name: "h264enc#0", pri: -1, stack size: 21288, stack seg: 0@0,252,597us: [+0 T:0x4001e340] CE - Engine_fwriteTrace> returning count [2298]@0,252,658us: [+2 T:0x4001e340] CE - Engine_createNode> Returning 0x57ae8@0,252,720us: [+5 T:0x4001e340] CV - VISA_create> remote codec created (name='h264enc', localQueueID=0x10001, remoteQueueID=0x0002)@0,252,781us: [+0 T:0x4001e340] ti.sdo.ce.video1.VIDENC1 - VIDENC1_create> return (0x57aa0)@0,252,842us: [+2 T:0x4001e340] ti.sdo.dmai - [Venc1] Setting dynParams size 720x576 bitrate 6000000@0,252,872us: [+0 T:0x4001e340] ti.sdo.ce.video1.VIDENC1 - VIDENC1_control> Enter (handle=0x57aa0, id=1, dynParams=0xbeafdc1c (size=0x30), status=0xbeafdb38 (size=0x9c)@0x0003999e:[T:0x4001e340] ti.sdo.dmai - [Dmai] Dmai log level set to '2'. Note that calling CERuntime_init after this point may cause unexpected change to D@0x0003999e:[T:0x4001e340] ti.sdo.dmai - [Dmai] Dmai log level set to '2'. Note that calling CERuntime_init after this point may cause unexpected change to DMAI tracing behavior.@0x000618f1:[T:0x4001e340] ti.sdo.dmai - [Venc1] Creating encoder h264enc for max 720x576 bitrate 6000000 ratectrl 1@0x00066ec5:[T:0x4001e340] ti.sdo.dmai - [Venc1] Setting dynParams size 720x576 bitrate 6000000@0x00067535:[T:0x4001e340] ti.sdo.dmai - [Venc1] XDM_SETPARAMS failed, status=-1
Found the problem. When setting the framerate in dynParams, I didn't account for the factor 1000 and set 30 instead of 30000.