I'm facing some problems in my video chat application, which is using libav libraries. I am sending 1080p videos encoded in VP8 as WebM container via UDP and it works quite well. Most of the time, the decoder on either side recovers from packet losses due to the transmission.
However at some point in time it just freezes and never recovers again. This happens on both sides eventually. I was searching for VP8 codec parameters to set for increased robustness, when sending over lossy transmission channels. And I combined some of which I found, in order to increase robustness. However, it still freezes after some time of video chat.
Here are the parameters I am currently using.
pVidCodecCtx->codec_id = AV_CODEC_ID_VP8;
pVidCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
pVidCodecCtx->width = frmQ->pCodecCtx->width; //1920
pVidCodecCtx->height = frmQ->pCodecCtx->height; //1080
pVidCodecCtx->time_base = frmQ->pCodecCtx->time_base;
pVidCodecCtx->pix_fmt = PIX_FMT_YUV420P;
pVidCodecCtx->qmin = 4;
pVidCodecCtx->qmax = 56;
pVidCodecCtx->bit_rate = pVidCodecCtx->width * pVidCodecCtx->height * 6;
pVidCodecCtx->slices = 8;
pVidCodecCtx->profile = 3;
pVidCodecCtx->thread_count = 3;
pVidCodecCtx->keyint_min = 5;
av_dict_set(&pDictCodecOpts, "rc_lookahead", "0", 0);
av_dict_set(&pDictCodecOpts, "quality", "realtime", 0);
av_dict_set(&pDictCodecOpts, "deadline", "realtime", 0);
av_dict_set(&pDictCodecOpts, "max-intra-rate", "0", 0);
av_dict_set(&pDictCodecOpts, "qcomp", "0", 0);
av_dict_set(&pDictCodecOpts, "default", "er", 0);
av_dict_set(&pDictCodecOpts, "error_resilient", "er", 0);
av_dict_set(&pDictCodecOpts, "partitions", "er", 0);
Most of the parameters I extracted from the ffmpeg code for the vpx encoder.
Do I also have to set parameters for the decoder in order to increase error resilience? Or am I missing some parameters in the encoder or setting them incorrectly. Any help or hints are greatly appreciated.