avformat/rtpenc_rfc4175: support for interlace format

Below are steps how to test on your local host:
wget --no-check-certificate https://samples.ffmpeg.org/MPEG2/interlaced/burosch1.mpg

1. interlace format:
ffmpeg  -re -i ./burosch1.mpg  -c:v bitpacked  -pix_fmt yuv422p10  -f rtp  rtp://239.255.0.1:6000
copy and create sdp file test.sdp
ffplay -buffer_size 671088640 -protocol_whitelist "file,rtp,udp"  test.sdp

2. progressive format:
ffmpeg  -re -i ./burosch1.mpg  -vf yadif -c:v bitpacked  -pix_fmt yuv422p10  -f rtp  rtp://239.255.0.1:6000
copy and create sdp file test.sdp
ffplay -buffer_size 671088640 -protocol_whitelist "file,rtp,udp"  test.sdp

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
Limin Wang
2022-01-01 20:19:50 +08:00
parent 3ea93bbd6d
commit b697326a68
4 changed files with 33 additions and 14 deletions

View File

@@ -728,9 +728,12 @@ static int sdp_write_media_attributes(char *buff, int size, const AVStream *st,
av_strlcatf(buff, size, "a=rtpmap:%d raw/90000\r\n"
"a=fmtp:%d sampling=%s; "
"width=%d; height=%d; "
"depth=%d\r\n",
"depth=%d",
payload_type, payload_type,
pix_fmt, p->width, p->height, bit_depth);
if (p->field_order != AV_FIELD_PROGRESSIVE)
av_strlcatf(buff, size, "; interlace");
av_strlcatf(buff, size, "\r\n");
break;
}