Hi.
For non-blocking mode: do I need to send eos before closing the device descriptor ?
Hi,
Please refer to encoder_proc_nonblocking() in 01_video_encode. There are two ways of stopping encoding:
if (read_video_frame(ctx.in_file, *outplane_buffer) < 0)
{
cerr << "Could not read complete frame from input file" << endl;
v4l2_output_buf.m.planes[0].bytesused = 0;
if(ctx.b_use_enc_cmd)
{
ret = ctx.enc->setEncoderCommand(V4L2_ENC_CMD_STOP, 1);
eos = true;
break;
}
else
{
eos = true;
v4l2_output_buf.m.planes[0].m.userptr = 0;
v4l2_output_buf.m.planes[0].bytesused = 0;
v4l2_output_buf.m.planes[1].bytesused = 0;
v4l2_output_buf.m.planes[2].bytesused = 0;
}
}