首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LIBAV MJPEG编码和huffman表

LIBAV MJPEG编码和huffman表
EN

Stack Overflow用户
提问于 2018-11-08 12:23:52
回答 1查看 1.4K关注 0票数 1

我试图使用libav(ffmpeg)示例代码创建带有MJPEG视频有效载荷的RTP流,它对MPEG1非常简单,我看到MJPEG中的编码工作,但是当我需要发送mjpeg帧时,RTP发件人会返回错误:

rtp @000000878ca77a0 RFC 2435需要jpeg的标准Huffman表

我在libav标题中看到了评论:

代码语言:javascript
复制
/**
     * 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默认表。有我要为编码器设置的标志吗?谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-24 00:12:49

您可以将huffman选项设置为0,即:

代码语言:javascript
复制
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 
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53207692

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档