/ Published in: C
Expand |
Embed | Plain Text
void ToggleRecording() { if (IsRecording) { IsRecording = false; } else { IsRecording = true; codec = avcodec_find_encoder(CODEC_ID_H264); c = avcodec_alloc_context(); c->bit_rate = 0; c->width = (Width/2)*2; //This probably looks stupid, but it works as resolution must be multiple of 2 c->height = (Height/2)*2; c->time_base= (AVRational){1,fps}; c->gop_size = 10; // emit one intra frame every ten frames c->max_b_frames = 1; c->pix_fmt = PIX_FMT_YUV420P; //The only one H264 supports :( } }
You need to login to post a comment.
