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.

TDA4VM: Modify the video encoding demo by replacing the input source with a local file

Part Number: TDA4VM

Hello,

I wrote a program based on app_multi_cam_encode under the sdk  to try to verify the encode capability of TDA4 by reading a local file.

NOTE:

1.My design logic is to feed the image data into the buffer of appsrc on the basis of a pipeline that can run successfully.

2.There are nine input images, which are continuous video frames with a resolution of 1920X1080 in YUV format.

3,here is my Main function:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
x_int32 app_multi_cam_encode_main(vx_int32 argc, vx_char *argv[])
{
AppObj *obj = &gAppObj;
vx_status status = VX_SUCCESS; //status =0;
/*Optional parameter setting*/
app_default_param_set(obj);
if(!obj)
{
printf("pointer obj is null \n");
}
/* GStreamer INIT */
gst_init(&argc, &argv);
printf("gst_init_done \n");
/*Update of parameters are config file read*/
app_update_param_set(obj);
if (status == VX_SUCCESS)
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here is the code I used to read the image and write it to the buffer

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
vx_status app_run_graph_for_one_frame_pipeline(AppObj * obj, vx_int32 frame_id)
{
vx_status status = VX_SUCCESS;
vx_char input_file_name[APP_MAX_FILE_PATH];
//void *gst_data_ptr[MAX_NUM_CHANNELS];
uint8_t *gst_data_ptr =NULL;
snprintf(obj->input_file_path, APP_MAX_FILE_PATH,"/opt/vision_apps/test_data/encode_test");
snprintf(input_file_name, APP_MAX_FILE_PATH, "%s/out%d.yuv", obj->input_file_path, frame_id);
printf("inputfilename=%s \n",input_file_name);
obj->gstPipeObj.num_channels = 1;
gst_data_ptr = (uint8_t *)calloc(obj->gstPipeObj.size, sizeof(uint8_t));
printf("alloc gst_data_ptr is ok\n");
// status = copy_image(&img_arr, gst_data_ptr, obj->sensorObj.num_cameras_enabled);
printf("we can go to get image \n");
//status = readScalerInput1(input_file_name,obj->input.arr[0], APP_MODULES_READ_FILE, 0, &(obj->input.arr[0]), gst_data_ptr, obj->sensorObj.num_cameras_enabled);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The output file was found to be empty by the printed log:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root@j7-evm:/opt/vision_apps# rm -rf output_video_00.mp4
root@j7-evm:/opt/vision_apps# ./vx_app_encode.out
APP: Init ... !!!
MEM: Init ... !!!
MEM: Initialized DMA HEAP (fd=4) !!!
MEM: Init ... Done !!!
IPC: Init ... !!!
IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
79.460067 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
79.469812 s: VX_ZONE_INIT:Enabled
79.469822 s: VX_ZONE_ERROR:Enabled
79.469836 s: VX_ZONE_WARNING:Enabled
79.472450 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
79.474612 s: VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
1111
gst_init_done
!!!!appsrcnamearr=myAppSrc0
gst param set ok!
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

So I'd like to ask you all here about the possible reasons why my buffer file is not being written to the gstreamer's pipe.

Thanks.

x 出现错误。请重试或与管理员联系。