This is a continue to my previous question about running omtb encoder and decoder, http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/151859.aspx#556495
I want to encode and decode yuv420 sequences (test sequences instead of captured in real time) using the fread_venc_fwrite.oms and fread_vdec_fwrite.oms. I can run successfully the encode now which can exits by using the new SDK of EZSDK 5_03_01_15 and modify the encoder setting as you suggested "
Please change the following line in the omtb script.
Current: omx setp 0 h264venc filereset_flag enable
Modify to: omx setp 0 h264venc filereset_flag disable
When the flag is enabled, omtb will reset the file pointer to the begining of the file when it reaches end of file.
"
However, at the decoder, it can not stop and there are errors. I guess it is due to the incorrect configuration for decoding the file.
I past the script of fread_vdec_fwrite.oms here:
#omx omtb_dbg_lvl 0x10
#omx omtb_dbg_lvl 0x08
omx api init
omx setp 0 h264vdec framerate 60
omx setp 0 h264vdec numinbuf 6
omx setp 0 h264vdec inbufsize 152064
omx setp 0 h264vdec frame_width 352
omx setp 0 h264vdec frame_height 288
omx setp 0 h264vdec numoutbuf 6
omx setp 0 h264vdec outbufsize 152064
omx setp 0 h264vdec inbuf allocate
omx setp 0 h264vdec outbuf allocate
omx setp 0 h264vdec data_opmode file
omx setp 0 h264vdec infile /usr/share/ti/data/videos/dm816x_foreman_cif250_encode.264
omx setp 0 h264vdec outfile /usr/share/ti/data/videos/dm816x_foreman_cif250_420p.yuv
omx api gethandle h264vdec 0 0
omx api sendcommand port h264vdec 0 enable 0
omx api sendcommand port h264vdec 0 waitforsem 0
omx api sendcommand port h264vdec 0 enable 1
omx api sendcommand port h264vdec 0 waitforsem 1
omx api sendcommand state h264vdec 0 idle
omx api sendcommand state h264vdec 0 waitforsem
sleep 500
omx api sendcommand state h264vdec 0 exec
omx api sendcommand state h264vdec 0 waitforsem
sleep 120000
omx api sendcommand state h264vdec 0 idle
omx api sendcommand state h264vdec 0 waitforsem
omx api sendcommand state h264vdec 0 loaded
omx api sendcommand state h264vdec 0 waitforsem
omx api freehandle h264vdec 0
omx api uninit
The script of fread_venc_fwrite.oms is as follows:
#omx omtb_dbg_lvl 0x10
#omx omtb_dbg_lvl 0x08
omx api init
omx setp 0 h264venc numinbuf 6
omx setp 0 h264venc inbufsize 152064
omx setp 0 h264venc frame_width 352
omx setp 0 h264venc frame_height 288
omx setp 0 h264venc numoutbuf 6
omx setp 0 h264venc inbufsize_flag enable
omx setp 0 h264venc outbufsize_flag enable
omx setp 0 h264venc outbufsize 152064
omx setp 0 h264venc inbuf allocate
omx setp 0 h264venc outbuf allocate
omx setp 0 h264venc data_opmode file
omx setp 0 h264venc data_ipmode file
#omx setp 0 h264venc filereset_flag enable
omx setp 0 h264venc filereset_flag disable
omx setp 0 h264venc infile /usr/share/ti/data/videos/foreman_cif_sp250f.yuv
omx setp 0 h264venc outfile /usr/share/ti/data/videos/dm816x_foreman_cif250_encode.264
#Q-16 format 2^16 * framerate
omx setp 0 h264venc framerate 3932160
omx api gethandle h264venc 0 0
omx api getparam h264venc 0 0 1 OMX_IndexParamVideoBitrate
omx setp 0 h264venc OMX_IndexParamVideoBitrate nTargetBitrate 2048000
omx setp 0 h264venc OMX_IndexParamVideoBitrate eControlRate variable
#eRateControlPreset is set to "disable => CBR" or "hq(high quality) => VBR"
#omx setp 0 h264venc OMX_TI_IndexParamVideoEncoderPreset eRateControlPreset hq
#omx setp 0 h264venc OMX_TI_IndexParamVideoEncoderPreset eRateControlPreset disable
omx api setparam h264venc 0 0 1 OMX_IndexParamVideoBitrate
omx api sendcommand port h264venc 0 enable 0
omx api sendcommand port h264venc 0 waitforsem 0
omx api sendcommand port h264venc 0 enable 1
omx api sendcommand port h264venc 0 waitforsem 1
omx api sendcommand state h264venc 0 idle
omx api sendcommand state h264venc 0 waitforsem
sleep 500
omx api sendcommand state h264venc 0 exec
omx api sendcommand state h264venc 0 waitforsem
#sleep 120000
omx notify h264venc 0 eos
omx api sendcommand state h264venc 0 idle
omx api sendcommand state h264venc 0 waitforsem
omx api sendcommand state h264venc 0 loaded
omx api sendcommand state h264venc 0 waitforsem
omx api freehandle h264venc 0
omx api uninit
The error is as below:
OMTB> sleep 120000
OMTB-OMTB script reading task sleeping for 120000 msecs
OMTB-Entering <Thread, instance #> : < OMTB_ClientApiTsk, 0 >
...
OMTB-Entering <Thread, instance #> : < OMTB_FileRead, 0>
OMTB-In OMTB_ClientEnventHandler: OMX_EventError - 800100b
OMTB-FAIL: OMX_ErrorStream Corrrupt
....
Leaving <Function: OMTB_CotexA8Task>
it then stay here and not goes on.
It would be appreciated much if you can attach two availble script for both encoder and decoder for the coding of yuv420 sequence.
Thank you very much!