This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Question about using the Mpeg4ENC and Mpeg4Vdec

HI, all

I am using the dvsdk demo on dm6467. Here I got some trouble run the encode demo to generate or decode a mpeg4 video file.

Here is the log which shows how it fails to create the alg.

[DSP] @0,112,532tk: [+0 T:0x8ba0006c] ti.sdo.ce.video1.VIDENC1 - VIDENC1_create> 
Enter (engine=0x0, name='mpeg4enc', params=0x8ff03940)
[DSP] @0,112,601tk: [+0 T:0x8ba0006c] CV - VISA_create(0x0, 'mpeg4enc', 0x8ff03940, 0x520, 'ti.sdo.ce.video1.IVIDENC1')
[DSP] @0,112,663tk: [+0 T:0x8ba0006c] CV - VISA_create2(0x0, 'mpeg4enc', 0x8ff03940, 0x30, 0x520, 'ti.sdo.ce.video1.IVIDENC1')
[DSP] @0,112,735tk: [+0 T:0x8ba0006c] CE - Engine_open> Enter('local', 0x8ba03d6c, 0x8ff03940)
[DSP] @0,112,788tk: [+0 T:0x8ba0006c] OM - Memory_alloc> Enter(size=0x2c)
[DSP] @0,112,824tk: [+0 T:0x8ba0006c] OM - Memory_alloc> return (0x8fc80880)
[DSP] @0,112,873tk: [+0 T:0x8ba0006c] CE - Engine_open> return(-1882716032)
[DSP] @0,112,935tk: [+0 T:0x8ba0006c] OM - Memory_alloc> Enter(size=0x34)
[DSP] @0,112,971tk: [+0 T:0x8ba0006c] OM - Memory_alloc> return (0x8fc808b0)
[DSP] @0,113,015tk: [+0 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_create> Enter(fxns=0x8fb86d1c, 
idma3Fxns=0x0, iresFxns=0x8fb86530, params=0x8ff03940, attrs=0x8ba03e80)
[DSP] @0,113,101tk: [+0 T:0x8ba0006c] OM - Memory_alloc> Enter(size=0x10)
[DSP] @0,113,138tk: [+0 T:0x8ba0006c] OM - Memory_alloc> return (0x8fc808e8)
[DSP] @0,113,185tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - _DSKT2_init> Enter
[DSP] @0,113,249tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - _DSKT2_init> Exit
[DSP] @0,113,284tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg> Enter (scratchId=0, fxns=0x8fb86d1c, 
parentAlg=0x0, params=0x8ff03940)
[DSP] @0,113,354tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - _DSKT2_init> Enter
[DSP] @0,113,390tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - _DSKT2_init> Exit
[DSP] @0,113,425tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg3> Enter (scratchId=0, fxns=0x8fb86d1c,
 parentAlg=0x0, params=0x8ff03940, extHeapId=0, singleHeap=2043)
[DSP] @0,113,514tk: [+2 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg3> Num memory recs requested 13
[DSP] @0,113,569tk: [+7 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg3> algAlloc returned numRecs=-1
[DSP] @0,113,630tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg> Exit (algHandle=0x0)
[DSP] @0,113,672tk: [+7 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_create> Algorithm creation FAILED; 
make sure that 1) alg params are correct/appropriate, 2) there is enough internal and external algorithm memory available
 -- check DSKT2 settings for heap assignments and scratch allocation
[DSP] @0,113,792tk: [+0 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_delete> Enter(alg=0x8fc808e8)
[DSP] @0,113,843tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc808e8, size=16)
[DSP] @0,113,889tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,113,924tk: [+0 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_delete> Exit
[DSP] @0,113,967tk: [+0 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_create> return (0x0)
[DSP] @0,114,010tk: [+2 T:0x8ba0006c] CV - VISA_create2> FAILED to create local codec.
[DSP] @0,114,051tk: [+0 T:0x8ba0006c] CV - VISA_delete(0x8fc808b0)
[DSP] @0,114,088tk: [+5 T:0x8ba0006c] CV - VISA_delete> deleting codec (localQueue=0xffff, remoteQueue=0xffff)
[DSP] @0,114,142tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc808b0, size=52)
[DSP] @0,114,186tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,114,221tk: [+0 T:0x8ba0006c] ti.sdo.ce.video1.VIDENC1 - VIDENC1_create> return (0x0)
[DSP] @0,114,270tk: [+0 T:0x8ba0006c] ti.sdo.ce.video1.VIDENC1 - VIDENC1_delete> Enter (handle=0x0)
[DSP] @0,114,315tk: [+0 T:0x8ba0006c] CV - VISA_delete(0x0)
[DSP] @0,114,345tk: [+0 T:0x8ba0006c] ti.sdo.ce.video1.VIDENC1 - VIDENC1_delete> return
[DSP] @0,114,390tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc80810, size=36)
[DSP] @0,114,434tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,114,468tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc807f0, size=32)
[DSP] @0,114,512tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,114,548tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc807e0, size=11)
[DSP] @0,114,593tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,114,627tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc807c8, size=24)
[DSP] @0,114,671tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
@1,988,639us: [+0 T:0x4348e490] CE - Engine_fwriteTrace> returning count [4839]
@1,988,746us: [+2 T:0x4348e490] CE - Engine_createNode> Returning 0x0
@1,988,841us: [+2 T:0x4348e490] CV - VISA_create2> FAILED to create remote codec (0x8).
@1,988,931us: [+0 T:0x4348e490] CV - VISA_delete(0x714e8)
@1,989,018us: [+5 T:0x4348e490] CV - VISA_delete> deleting codec (localQueue=0xffff, remoteQueue=0xffff)
@1,989,116us: [+0 T:0x4348e490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_create> return (0x0)
@1,989,211us: [+7 T:0x4348e490] ti.sdo.dmai - [Venc1] Failed to open video encode algorithm: mpeg4enc (0x8)
Error: Failed to create video encoder: mpeg4enc

As the error log suggested, the parameter and the DSKT are the possible reason of this failure. I firstly doubt if the 
parameters I set makes any mistake. Then I found during decoding mpeg4 video, similar error log is also generated. 
[DSP] @0,099,752tk: [+0 T:0x8ba0006c] OM - Memory_alloc> Enter(size=0x10)
[DSP] @0,099,788tk: [+0 T:0x8ba0006c] OM - Memory_alloc> return (0x8fc808e8)
[DSP] @0,099,835tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - _DSKT2_init> Enter
[DSP] @0,099,897tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - _DSKT2_init> Exit
[DSP] @0,099,932tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg> Enter (scratchId=0, fxns=0x8fb86cf0, 
parentAlg=0x0, params=0x8ff03940)
[DSP] @0,100,002tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - _DSKT2_init> Enter
[DSP] @0,100,037tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - _DSKT2_init> Exit
[DSP] @0,100,072tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg3> Enter (scratchId=0, fxns=0x8fb86cf0, 
parentAlg=0x0, params=0x8ff03940, extHeapId=0, singleHeap=2043)
[DSP] @0,100,161tk: [+2 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg3> Num memory recs requested 20
[DSP] @0,100,217tk: [+7 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg3> algAlloc returned numRecs=-1
[DSP] @0,100,277tk: [+0 T:0x8ba0006c] ti.sdo.fc.dskt2 - DSKT2_createAlg> Exit (algHandle=0x0)
[DSP] @0,100,320tk: [+7 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_create> Algorithm creation FAILED;
 make sure that 1) alg params are correct/appropriate, 2) there is enough internal and external algorithm memory available
 -- check DSKT2 settings for heap assignments and scratch allocation
[DSP] @0,100,439tk: [+0 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_delete> Enter(alg=0x8fc808e8)
[DSP] @0,100,489tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc808e8, size=16)
[DSP] @0,100,535tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,100,570tk: [+0 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_delete> Exit
[DSP] @0,100,612tk: [+0 T:0x8ba0006c] ti.sdo.ce.alg.Algorithm - Algorithm_create> return (0x0)
[DSP] @0,100,656tk: [+2 T:0x8ba0006c] CV - VISA_create2> FAILED to create local codec.
[DSP] @0,100,697tk: [+0 T:0x8ba0006c] CV - VISA_delete(0x8fc808b0)
[DSP] @0,100,735tk: [+5 T:0x8ba0006c] CV - VISA_delete> deleting codec (localQueue=0xffff, remoteQueue=0xffff)
[DSP] @0,100,788tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc808b0, size=52)
[DSP] @0,100,833tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,100,868tk: [+0 T:0x8ba0006c] ti.sdo.ce.video2.VIDDEC2 - VIDDEC2_create> return (0x0)
[DSP] @0,100,918tk: [+0 T:0x8ba0006c] ti.sdo.ce.video2.VIDDEC2 - VIDDEC2_delete> Enter (handle=0x0)
[DSP] @0,100,963tk: [+0 T:0x8ba0006c] CV - VISA_delete(0x0)
[DSP] @0,100,994tk: [+0 T:0x8ba0006c] ti.sdo.ce.video2.VIDDEC2 - VIDDEC2_delete> return
[DSP] @0,101,038tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc80810, size=36)
[DSP] @0,101,082tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,101,116tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc807f0, size=32)
[DSP] @0,101,160tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,101,196tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc807e0, size=11)
[DSP] @0,101,241tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
[DSP] @0,101,274tk: [+0 T:0x8ba0006c] OM - Memory_free> Enter(addr=0x8fc807c8, size=24)
[DSP] @0,101,319tk: [+0 T:0x8ba0006c] OM - Memory_free> return (0x1)
@0,978,651us: [+0 T:0x41e98490] CE - Engine_fwriteTrace> returning count [4841]
@0,978,754us: [+2 T:0x41e98490] CE - Engine_createNode> Returning 0x0
@0,978,844us: [+2 T:0x41e98490] CV - VISA_create2> FAILED to create remote codec (0x8).
@0,978,931us: [+0 T:0x41e98490] CV - VISA_delete(0x71130)
@0,979,018us: [+5 T:0x41e98490] CV - VISA_delete> deleting codec (localQueue=0xffff, remoteQueue=0xffff)
@0,979,113us: [+0 T:0x41e98490] ti.sdo.ce.video2.VIDDEC2 - VIDDEC2_create> return (0x0)
@0,979,207us: [+7 T:0x41e98490] ti.sdo.dmai - [Vdec2] Failed to open video decode algorithm
Error: Failed to create video decoder: mpeg4dec
Does this means that the DSKT memory allocation makes a mistake?
Currently, my setting is as the default one provided with the dvsdk, which is:
DSKT2.ALLOW_EXTERNAL_SCRATCH = false;
DSKT2.SARAM_SCRATCH_SIZES[GROUP_0] = 32768*2;
DSKT2.SARAM_SCRATCH_SIZES[GROUP_1] = 0;
DSKT2.DARAM_SCRATCH_SIZES[GROUP_0] = 32768*2;
DSKT2.DARAM_SCRATCH_SIZES[GROUP_1] = 0;
I tried to make some of them larger but it seems this doesn't work. Hope someone could help me finding a solution. 
Best regards,
Amanda Wu