摘要:
概述 我们以FFmpeg简单使用:视频解码 提取yuv为例,研究一下h264的解码过程。 这里主要涉及两个方面: 1.解析器【ff_h264_parser】:使用av_parser_parse2解析出一帧NALU 2.解码器【ff_h264_decoder】:使用avcodec_send_packe 阅读全文
摘要:
我们以一个acc解码为例看看这两个函数 static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile) { int i, ch; int ret, data_size; // pkt是 阅读全文
摘要:
解析报文 /** * Parse a packet. * * @param s parser context. 解析器上下文 * @param avctx codec context. 解码器上下文 * @param poutbuf set to pointer to parsed buffer o 阅读全文
摘要:
初始化AVCodecContext /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this * function the context has to be allocated with av 阅读全文
摘要:
分配解码器上下文 /** * Allocate an AVCodecContext and set its fields to default values. The * resulting struct should be freed with avcodec_free_context(). * 阅读全文
摘要:
查找编码器 AVCodecParserContext *av_parser_init(int codec_id); 实现 AVCodecParserContext *av_parser_init(int codec_id) { AVCodecParserContext *s = NULL; cons 阅读全文
摘要:
实现 实际就是利用了HTTP的分块传输,发送FLV数据,服务器无法知道流长度,所以不会填写Content-Length字段而是携带Transfer-Encoding: chunked字段,这样客户端就会一直接受数据了。 分块传输 编码规则 下面我们来看一下分块传输的编码规则,其实也很简单,同样采用了 阅读全文
摘要:
查找解码器 /** * Find a registered decoder with a matching codec ID. * * @param id AVCodecID of the requested decoder * @return A decoder if one was found, 阅读全文
摘要:
1. 流程图 2.概述 1. AVCodec *avcodec_find_decoder(enum AVCodecID id) 获取解码器 2. AVCodecParserContext *av_parser_init(int codec_id) 获取解析器 3. AVCodecContext *a 阅读全文
摘要:
1. socket的TIMEOUT #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdlib.h> #include <assert.h 阅读全文