![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
文章平均质量分 60
文长
咿呀呀
展开
-
usbcamera拔掉设备崩溃
崩溃堆栈如下:解决办法:原创 2020-07-11 10:45:26 · 886 阅读 · 0 评论 -
h265获取解码头
vps、sps、pps信息见上图:获取代码如下: void getH265Head(char* extradata,int len) { LOGD("getH265Head width : %d,height : %d,len : %d",mWidth,mHeight,len); if(extradata != NULL && len>22) ...原创 2018-05-15 10:44:04 · 3345 阅读 · 0 评论 -
obs之libx264编码
obs中使用libx264编码的例子,包含了动态设置码率。#include "Main.h"#include #include extern "C"{#include "../x264/x264.h"}void get_x264_log(void *param, int i_level, const char *psz, va_list argptr){ S原创 2017-09-01 15:09:24 · 1584 阅读 · 0 评论 -
obs之lame编码
obs之lame编码。#include "Main.h"#include "../lame/include/lame.h"const int audioBlockSize = 4; //output is 2 16bit channelsstruct AACDataPacket{ List Packet; inline void FreeData() {Pa原创 2017-09-01 15:01:50 · 456 阅读 · 0 评论 -
obs之libfaac编码
obs源码之libaac编码。#include "Main.h"#include "../libfaac/include/faac.h"//AAC is pretty good, I changed my mindclass AACEncoder : public AudioEncoder{ UINT curBitRate; bool bFirstPacket原创 2017-09-01 14:58:33 · 512 阅读 · 0 评论 -
lame example
#include "codec.h" // self#include // std::ofstream#include // std::logic_error#include "../lameplus/lameplus.h" // LamePlus#include "../wave/wave.h"原创 2017-08-24 12:12:47 · 361 阅读 · 0 评论 -
ffmpeg encode/decode example
00001 /*00002 * Copyright (c) 2001 Fabrice Bellard00003 *00004 * Permission is hereby granted, free of charge, to any person obtaining a copy00005 * of this software and associated documentati原创 2017-08-18 17:41:47 · 1627 阅读 · 0 评论 -
MP4v2获得h264数据
int32_t openFiles() { if (mp4File == NULL) { mp4File = MP4Read(mp4FilePathAndName); } if (mp4File == NULL) { NL_LOGE("mp4 file read error"); return -1; }原创 2016-01-27 10:41:14 · 2899 阅读 · 0 评论 -
Android中JNI 的一些常用说明 JNI_OnLoad registerNatives registerNativeMethods
Android JNI和NDK关系 1、什么JNIJava Native Interface (JNI)标准是java平台的一部分,它允许Java代码和其他语言写的代码进行交互。JNI 是本地编程接口,它使得在 Java 虚拟机 (VM) 内部运行的 Java 代码能够与用其它编程语言(如 C、C++ 和汇编语言)编写的应用程序和库进行交互操作。上面过程分为2个部分:第一、用C语言转载 2016-01-18 21:27:51 · 1309 阅读 · 1 评论 -
h.264保存flv文件
首先 写flv头。byte[] cFlvHeader = new byte[]{0x46,0x4C,0x56,0x01,0x01,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00};WriteFile.writeBuf(cFlvHeader);接下来写metadata,可有可无。然后是sps、pps这些header。privat原创 2014-12-21 09:57:10 · 904 阅读 · 0 评论 -
Crtmpserver编译
解决报错:1、info["audio"]["droppedPacketsCount"] = 0; 报错原因:=有许多重载,改成info["audio"]["droppedPacketsCount"] = (uint32_t)0;2、找不到nattraversalprotocol.cpp,其实目录下有,木有添加到工程。找到文件添加就ok。3.缺少openssl/bn.h,需要下载op原创 2014-11-24 09:42:02 · 720 阅读 · 0 评论 -
x264动态码率
新版的x264可以支持动态调整码率了,不过具体哪个版本开始不清楚。首先,在x264_encoder_open之前设置: x264_param_t param; param.rc.i_rc_method=X264_RC_ABR;param.rc.i_vbv_max_bitrate = (要设置的最大码率);param.rc.i_bitrate原创 2014-11-27 16:31:23 · 2911 阅读 · 0 评论 -
yv12转nv12,nv12转I420
yv12跟I420区别其实就是u、v顺序不一样,是平面格式,内存中u、v在连续的一块,nv12是打包格式,u、v交叉。yv12转nv12:void swapYV12toNV12(byte[] yv12bytes, byte[] nv12bytes, int width,int height) {int nLenY = width * height;int nLenU原创 2014-11-27 14:26:59 · 6144 阅读 · 1 评论 -
RGB图像任意角度旋转
推导: x = r cos(b);y = r sin(b); _ _ _ _ _ _ _ _ (1) x’ = r cos(a+b);y’ = r sin(a+b); _ _ _ _ _ _ _ _ (2) cos(a+b) = cos(a)cos(b)-sin(a)sin(b);sin(a+b)原创 2014-11-25 16:27:56 · 1508 阅读 · 0 评论 -
RGB图像镜像
水平镜像:原创 2014-11-25 15:52:32 · 1124 阅读 · 0 评论 -
vs2003安装
首先 需要安装虚拟光驱。 接着有3个文件:[Visual.Studio..Net.2003.简体中文企业版].sc_vs.net_2003_enar_cd1.[Beroko.com]、[Visual.Studio..Net.2003.简体中文企业版].sc_vs.net_2003_enar_cd2.[Beroko.com]、[Visual.Studio..Net.2003.简体中文原创 2015-01-08 15:36:38 · 888 阅读 · 0 评论