I use x264 to compress the video stream from the webcam using these settings:
x264_param_default_preset(¶m, "veryfast", "zerolatency");
param.i_threads = 1;
param.i_fps_den = 1;
param.b_annexb = 1;
param.i_keyint_max = 30;
param.rc.i_rc_method = X264_RC_CRF;
param.rc.f_rf_constant = 25;
param.rc.f_rf_constant_max = 35;
param.b_repeat_headers = 1;
x264_param_apply_profile(¶m, "baseline");
param.i_slice_max_size = X264_NAL_MAX_SIZE;
I would like to put NAL in MTU size, but if I set a small maximum size, the stream would be destroyed - it would randomly blink between black and white, with some hints of the original image in the background. The larger max_size, the less likely the thread will be destroyed. So my question is: can we have a small NALU and the right video stream?
UPD: I use FFmpeg as a decoder.
source
share