ptz 发布的文章

因为供应商提供的编译环境是 ubuntu 14.04lts,比较老旧了,直接安装 openssh-server 安装不了,提示没有这个包,然后再网上找到相应的解决办法。

  1. backup

    sudo cp -i /etc/apt/sources.list /etc/apt/sources.list.backup
  2. add

    deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 
    deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
    deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
    deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse 
    deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse 
  3. update

    sudo apt-get update
  4. install
    sudo apt-get install openssh-server

reference

https://www.shangmayuan.com/a/7ee036528f064f86b65dff3e.html

  1. 使用 ps 打开图片
  2. 使用裁剪,设置 (2.5cm, 3.5cm, 300)1寸,(3.5cm, 5.3cm, 300)2寸。然后再图像上画框。
  3. image -> canvas size,设置长,宽,都扩展 0.4 cm
  4. edit -> define pattern,保存为图案。
  5. new -> width = 102mm, height = 152mm, resolution = 300
  6. edit -> fill,选中刚才保存的图案即可。然后保存打印。

参考:

https://www.php.cn/ps-tutorial-428361.html
https://zhuanlan.zhihu.com/p/363922181

转自: https://blog.csdn.net/byhook/article/details/84037338

音视频实践学习

android全平台编译ffmpeg以及x264与fdk-aac实践
ubuntu下使用nginx和nginx-rtmp-module配置直播推流服务器
android全平台编译ffmpeg合并为单个库实践
android-studio使用cmake编译ffmpeg实践
android全平台编译ffmpeg视频解码器实践
android全平台编译ffmpeg支持命令行实践
android全平台编译ffmpeg视频推流实践
android平台下音频编码之编译LAME库转码PCM为MP3
图解YU12、I420、YV12、NV12、NV21、YUV420P、YUV420SP、YUV422P、YUV444P的区别
ubuntu平台下编译vlc-android视频播放器实践

概述

YUV模型是根据一个亮度(Y分量)和两个色度(UV分量)来定义颜色空间,常见的YUV格式有YUY2、YUYV、YVYU、UYVY、AYUV、Y41P、Y411、Y211、IF09、IYUV、YV12、YVU9、YUV411、YUV420等,其中比较常见的YUV420分为两种:YUV420P和YUV420SP。

我们在android平台下使用相机默认图像格式是NV21属于YUV420SP格式

- 阅读剩余部分 -

转自: https://www.cnblogs.com/tid-think/p/10616789.html#:~:text=%E6%8E%A5%E4%B8%8B%E6%9D%A5%E6%98%AFYUV420,%E6%AF%8F%E5%9B%9B%E4%B8%AAy%E5%88%86%E9%87%8F%E5%85%AC%E7%94%A8%E4%B8%80%E4%B8%AAUV%E5%88%86%E9%87%8F%EF%BC%8C%E6%89%80%E4%BB%A5%E6%AF%8F%E4%B8%AA%E5%83%8F%E7%B4%A0%E7%82%B9%E5%8D%A0%E7%94%A81.5%E4%B8%AA%E5%AD%97%E8%8A%82%E7%A9%BA%E9%97%B4%EF%BC%8C%E6%A0%B9%E6%8D%AE%E5%AD%98%E5%82%A8%E9%A1%BA%E5%BA%8F%E4%B8%8D%E4%B8%80%E6%A0%B7%E5%8F%88%E5%88%86%E4%B8%BA%E5%9B%9B%E4%B8%AA%E4%B8%8D%E5%90%8C%E7%9A%84%E7%B1%BB%E5%9E%8B%E3%80%82

前段时间搞x264编码测试,传参的时候需要告诉编码器我的原始数据格式是什么,其中在x264.h头文件中定义了如下一堆类型。

/* Colorspace type */
#define X264_CSP_MASK           0x00ff  /* */
#define X264_CSP_NONE           0x0000  /* Invalid mode     */
#define X264_CSP_I400           0x0001  /* monochrome 4:0:0 */
#define X264_CSP_I420           0x0002  /* yuv 4:2:0 planar */
#define X264_CSP_YV12           0x0003  /* yvu 4:2:0 planar */
#define X264_CSP_NV12           0x0004  /* yuv 4:2:0, with one y plane and one packed u+v */
#define X264_CSP_NV21           0x0005  /* yuv 4:2:0, with one y plane and one packed v+u */
#define X264_CSP_I422           0x0006  /* yuv 4:2:2 planar */
#define X264_CSP_YV16           0x0007  /* yvu 4:2:2 planar */
#define X264_CSP_NV16           0x0008  /* yuv 4:2:2, with one y plane and one packed u+v */
#define X264_CSP_YUYV           0x0009  /* yuyv 4:2:2 packed */
#define X264_CSP_UYVY           0x000a  /* uyvy 4:2:2 packed */
#define X264_CSP_V210           0x000b  /* 10-bit yuv 4:2:2 packed in 32 */
#define X264_CSP_I444           0x000c  /* yuv 4:4:4 planar */
#define X264_CSP_YV24           0x000d  /* yvu 4:4:4 planar */
#define X264_CSP_BGR            0x000e  /* packed bgr 24bits */
#define X264_CSP_BGRA           0x000f  /* packed bgr 32bits */
#define X264_CSP_RGB            0x0010  /* packed rgb 24bits */
#define X264_CSP_MAX            0x0011  /* end of list */
#define X264_CSP_VFLIP          0x1000  /* the csp is vertically flipped */
#define X264_CSP_HIGH_DEPTH     0x2000  /* the csp has a depth of 16 bits per pixel component */

但是这个定义只是对于这个应用而言,对于其他的应用或者场景中,相同的数据格式却有着不同的名字,于是为了弄懂他们的差别关系,检索了一大堆信息,整理了一个图文出来如下。

- 阅读剩余部分 -

转自: https://blog.csdn.net/q1449660223/article/details/110310208

概述

RGB

RGB(Alpha,Red,Green,Blue)色彩模式是工业界的一种颜色标准,是通过对红®、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色,这个标准几乎包括了人类视力所能感知的所有颜色,是目前运用最广的颜色系统之一。RGB图像只使用三种颜色,就可以使它们按照不同的比例混合,在屏幕上呈现16777216(256 256 256)种颜色

- 阅读剩余部分 -

参考

https://www.jianshu.com/p/819c23563c90
https://www.cnblogs.com/linuxAndMcu/p/12127975.html
https://blog.csdn.net/xiaibiancheng/article/details/73065646
https://blog.csdn.net/byhook/article/details/84475525
https://blog.csdn.net/MACMACip/article/details/105450185
https://www.cnblogs.com/linuxAndMcu/p/12119915.html#:~:text=SwsContext%20%E7%BB%93%E6%9E%84%E4%BD%93%20SwsContext%20%E6%98%AF%E8%BD%AC%E6%8D%A2%E6%A0%BC%E5%BC%8F%E7%9A%84%E4%B8%8A%E4%B8%8B%E6%96%87%E7%BB%93%E6%9E%84%E4%BD%93%EF%BC%8C%E4%B9%9F%E6%98%AF%E4%BD%BF%E7%94%A8,libswscale%20%E7%9A%84%E6%97%B6%E5%80%99%E4%B8%80%E4%B8%AA%E8%B4%AF%E7%A9%BF%E5%A7%8B%E7%BB%88%E7%9A%84%E7%BB%93%E6%9E%84%E4%BD%93%EF%BC%8C%E8%BF%99%E4%B8%AA%E7%BB%93%E6%9E%84%E4%BD%93%E7%9A%84%E5%AE%9A%E4%B9%89%E5%BE%88%E5%A4%8D%E6%9D%82%EF%BC%8C%E9%87%8C%E9%9D%A2%E5%8C%85%E5%90%AB%E4%BA%86%20libswscale%20%E6%89%80%E9%9C%80%E8%A6%81%E7%9A%84%E5%85%A8%E9%83%A8%E5%8F%98%E9%87%8F%E3%80%82
https://blog.csdn.net/leixiaohua1020/article/details/12029505
https://blog.csdn.net/tea1896/article/details/72453510
https://blog.csdn.net/leixiaohua1020/article/details/42134965
https://blog.csdn.net/leixiaohua1020/article/details/44305697
https://blog.csdn.net/leixiaohua1020/article/details/44305697
https://www.jianshu.com/p/a3dc034deca6
https://blog.csdn.net/u010029439/article/details/80788479
https://www.jianshu.com/p/6c4155988c7d
https://www.jianshu.com/p/944ede616261
https://www.shangmayuan.com/a/c099c271a2904c3c932d654f.html
https://www.codenong.com/js6c4155988c7d/
https://blog.csdn.net/xiaibiancheng/article/details/73065646
https://blog.csdn.net/alspd_zhangpan/article/details/108243789
https://www.jianshu.com/p/bd0feaf4c0f9
https://blog.csdn.net/fengbingchun/article/details/50323273
https://www.jianshu.com/p/e52a3a19c8fe
https://blog.csdn.net/fengchu3415/article/details/84871710
https://blog.csdn.net/xiaolong1126626497/article/details/105984222
https://github.com/lemenkov/libyuv/blob/master/docs/getting_started.md
https://www.thinbug.com/q/54037393
https://www.cnblogs.com/cyyljw/p/8676062.html
https://www.cnblogs.com/yongdaimi/p/9829290.html
https://rumenz.com/rumenbiji/ffmpeg-sws_getCachedContext.html
https://www.cnblogs.com/yongdaimi/p/10715830.html#:~:text=%E4%B8%8E%E5%85%B6%E7%B1%BB%E4%BC%BC%E7%9A%84%E5%87%BD%E6%95%B0%E8%BF%98%E6%9C%89%EF%BC%9A%20sws_getCachedContext%20%EF%BC%8C%E5%8C%BA%E5%88%AB%E5%9C%A8%E4%BA%8E%EF%BC%9A%20sws_getContext,%E5%8F%AF%E4%BB%A5%E7%94%A8%E4%BA%8E%E5%A4%9A%E8%B7%AF%E7%A0%81%E6%B5%81%E8%BD%AC%E6%8D%A2%EF%BC%8C%E4%B8%BA%E6%AF%8F%E4%B8%AA%E4%B8%8D%E5%90%8C%E7%9A%84%E7%A0%81%E6%B5%81%E9%83%BD%E6%8C%87%E5%AE%9A%E4%B8%80%E4%B8%AA%E4%B8%8D%E5%90%8C%E7%9A%84%E8%BD%AC%E6%8D%A2%E4%B8%8A%E4%B8%8B%E6%96%87%EF%BC%8C%E8%80%8C%20sws_getCachedContext%20%E5%8F%AA%E8%83%BD%E7%94%A8%E4%BA%8E%E4%B8%80%E8%B7%AF%E7%A0%81%E6%B5%81%E8%BD%AC%E6%8D%A2%E3%80%82%202.sws_freeContext
https://blog.csdn.net/u010029439/article/details/82859206
https://www.cnblogs.com/yfceshi/p/7092525.html

jni 如果直接把源文件从 c 改为 cpp, 那么会报错 base operand of '->' has non-pointer type 'JNIEnv {aka _JNIEnv}'和Method 'GetStringUTFChars' could not be resolved

具体的写法是有区别的。

  • c 调用
const char * file_path = (*env)->GetStringUTFChars(env, path, NULL);

return (*env)->NewStringUTF(env, "Hello from JNI !");//如果是用C语言格式就用这种方式
  • cpp 调用
const char * file_path = env->GetStringUTFChars(path, NULL);

return env->NewStringUTF((char *)"Hello from JNI !");//C++用这种格式

原因是 jni 的头文件定义

  • c

    const char* (*GetStringUTFChars)(JNIEnv*, jstring, jboolean*);
  • cpp
    const char* GetStringUTFChars(jstring string, jboolean* isCopy)
    { return functions->GetStringUTFChars(this, string, isCopy); }

参考

https://blog.csdn.net/hejia729371286/article/details/51356983

firefox 打开网页慢可能是好几个原因,下面列出可能改善的方法

  1. 可能是证书的问题,在 firefox 设置中取消每次的证书验证。 搜索 OCSP 这个关键字就能找到了。
  2. 在about:config关闭media.peerconnection.enabled
  3. 在firefox设置中的网络设置里面,关闭代理和 enable dns over https

参考

https://www.jianlove.com/firefox-https-105.html#:~:text=%E6%9C%AC%E6%96%87%E5%B0%B1%E5%91%8A%E8%AF%89%E4%BD%A0%E4%BD%BF%E7%94%A8%20Firefox%E7%81%AB%E7%8B%90%E6%B5%8F%E8%A7%88%E5%99%A8%E6%89%93%E5%BC%80%20HTTPS%E7%BD%91%E7%AB%99%E7%BD%91%E9%A1%B5%E9%80%9F%E5%BA%A6%E6%AF%94%E8%BE%83%E6%85%A2%E6%9C%80%E6%9C%89%E5%8F%AF%E8%83%BD%E7%9A%84%E5%8E%9F%E5%9B%A0%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%8C%E9%82%A3%E5%B0%B1%E6%98%AF%E7%AE%80%E7%A7%B0%20OCSP%20%E7%9A%84%20Online%20Certificate%20Status,Protocol%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%20TLS%E8%AF%81%E4%B9%A6%E7%8A%B6%E6%80%81%E6%9F%A5%E8%AF%A2%E6%89%A9%E5%B1%95%EF%BC%8C%E6%98%AF%E5%AE%83%E5%BD%B1%E5%93%8D%E4%BA%86%20https%20%E7%BD%91%E7%AB%99%E6%89%93%E5%BC%80%E7%9A%84%E9%80%9F%E5%BA%A6%E3%80%82%20%E6%89%93%E5%BC%80%20https%20%E7%BD%91%E7%AB%99%E5%BE%88%E6%85%A2%E7%9A%84%E5%8E%9F%E5%9B%A0%E6%98%AF%E5%9B%A0%E4%B8%BA%E6%AF%8F%E6%AC%A1%E9%83%BD%E9%9C%80%E8%A6%81%E6%9F%A5%E8%AF%A2%E8%AF%81%E4%B9%A6%E8%8A%B1%E8%B4%B9%E6%97%B6%E9%97%B4%EF%BC%8C%E5%BE%88%E5%A4%9A%E6%83%85%E5%86%B5%E8%AF%81%E4%B9%A6%E7%9A%84%E6%9F%A5%E8%AF%A2%E6%9C%BA%E6%9E%84%E9%83%BD%E5%9C%A8%E6%B5%B7%E5%A4%96%EF%BC%8C%E8%80%8C%E6%88%91%E4%BB%AC%E5%A4%A7%E5%B1%80%E5%9F%9F%E7%BD%91%E5%9C%B0%E5%8C%BA%E7%89%B9%E6%AE%8A%E7%9A%84%E5%8E%9F%E5%9B%A0%E4%BC%9A%E6%9B%B4%E6%85%A2%E4%B8%80%E4%BA%9B%EF%BC%8C%E6%89%80%E4%BB%A5%E5%8F%AA%E9%9C%80%E8%A6%81%E5%81%9A%E7%AE%80%E5%8D%95%E7%9A%84%E8%AE%BE%E7%BD%AE%E5%B0%B1%E5%8F%AF%E4%BB%A5%E5%A4%A7%E5%B9%85%E6%8F%90%E9%AB%98%20Firefox%E7%81%AB%E7%8B%90%E6%B5%8F%E8%A7%88%E5%99%A8%E6%89%93%E5%BC%80%E7%BD%91%E9%A1%B5%E7%9A%84%E9%80%9F%E5%BA%A6%E4%BA%86%E3%80%82
https://www.zhihu.com/question/264453926
https://www.zhihu.com/question/447886102

已经编译好的 .a 静态库

直接在相应的 Android.mk 里面增加:

LOCAL_SRC_FILES := $(LOCAL_PATH)/lib/libyuv_neon.a

这样就可以了

希望把部分源码编译成静态库,然后再加载

LOCAL_STATIC_LIBRARIES := libtest

这个需要有源码

比如说 libyuv,这个在 external 目录下面有这个库,所以在 framework 下面使用也很简单,只要

LOCAL_STATIC_LIBRARIES := libyuv_static

如果提示找不到,那么直接去提示的目录那边去看看,看看目录名字是什么,就把这边的库名字修改了就可以了。

参考:

https://blog.csdn.net/baidu_31872269/article/details/84554696
https://blog.csdn.net/zhang01/article/details/78760630
https://blog.csdn.net/qq840727854/article/details/54782700
https://blog.csdn.net/sofa120/article/details/83029698
https://blog.csdn.net/kafeidev/article/details/8860278
https://programming.vip/docs/compiling-google-libyuv-so-library.html

有两种方法。

1. 进入容器

docker ps
docker exec -it instance15 sh
logcat

2. 不进入容器

docker ps
adb connect localhost:5987
logcat

3. 也可以把 log 写入文件,再把文件读取出来

docker ps
docker exec -it instance15 sh
logcat >log.txt
exit

adb connect localhost:5987
adb -s localhost:5987 pull log.txt .

4. 还可以这样

docker logs --since 5m 00363a3b96d6