我试图使用libav(ffmpeg)示例代码创建带有MJPEG视频有效载荷的RTP流,它对MPEG1非常简单,我看到MJPEG中的编码工作,但是当我需要发送mjpeg帧时,RTP发件人会返回错误:
rtp @000000878ca77a0 RFC 2435需要jpeg的标准Huffman表
我在libav标题中看到了评论:
/**
* some codecs need / can use extradata like Huffman tables.
* MJPEG: Huffman tables
* rv10: additional flags
* MPEG-4: global headers (they can be in the bitstream or here)
* The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
* than extradata_size to avoid problems if it is read with the bitstream reader.
* The bytewise contents of extradata must not depend on the architecture or CPU endianness.
* - encoding: Set/allocated/freed by libavcodec.
* - decoding: Set/allocated/freed by user.
*/
uint8_t *extradata;
int extradata_size;但是如何更正填充huffman表或init默认表。有我要为编码器设置的标志吗?谢谢。
发布于 2019-03-24 00:12:49
您可以将huffman选项设置为0,即:
ffmpeg -i /dev/video0 -input_format mjpeg -f v4l2 -pix_fmt yuvj420p -vcodec mjpeg -huffman 0 -f rtp "rtp://127.0.0.1:10000" -sdp_file sdp_file https://stackoverflow.com/questions/53207692
复制相似问题