添加源
sudo add-apt-repository ppa:embrosyn/cinnamon
sudo apt update
不填加源,安装的会是2.x版
安装
sudo apt install cinnamon
pre
目的: 在ubuntu搭建基于xelatex的论文编写环境 
手段: 
- 通过安装tex live 安装xelatex
tex live 安装
clean
如果上一次安装失败,则清理上一次遗留的安装文件
rm -rf /usr/local/texlive/2018
rm -rf ~/.texlive2018
下载iso
打开 http://tug.org/texlive/acquire-iso.html,点击download from a nearby CTAN mirror,下载iso文件
挂载镜像并安装
sudo mount texlive2018-20180414.iso /mnt/
cd /mnt/
sudo ./install-tl
config
修改 /etc/profile,更改环境变量PATH
export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH
export MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH
texmaker 安装
sudo apt install texmaker
或者使用TexWorks
sudo apt install texworks
测试
\documentclass{article}
\begin{document}
sdfasfdasd
\end{document}
中文支持
\documentclass[UTF8]{ctexart}
\begin{document}
你好,world撒旦啊!
\end{document}
前言
本文参考雷霄骅的博文https://blog.csdn.net/leixiaohua1020/article/details/8652605,使用c++根据ffmpeg-4.1版本改写(原文代码基于旧版本ffmpeg)。代码见下文。
本文代码地址见https://github.com/2997215859/ffplay-learn/blob/master/Video/print_info.cpp
本文代码基于ffmpeg-4.1版本,事先需要安装好ffmpeg
本文代码提供CMakeLists.txt,见附录CMakeLists.txt部分,或根据CMakeLists.txt改写。需要链接的库如下(基本上安装ffmpeg、ffplay、SDL2之后就有了)。
1 avdevice avfilter avformat avcodec swscale swresample postproc avutil m xcb xcb-shm xcb xcb-shape xcb xcb-xfixes xcb-render xcb-shape xcb asound pthread m fontconfig freetype freetype z bz2 lzma SDL2 SDL2main
流程
 
解码器即C++中使用ffmpeg解码视频到YUV数据示例,SDL渲染是一个封装了音视频底层接口的库,本文使用2.0版本。
解码器主要使用ffmpeg中的几个函数:avformat_alloc_context, avcodec_find_decoder, avcodec_send_packet, avcodec_receive_frame
代码剖析
读取视频格式并获取视频流的索引
string filepath = "/home/sensetime/videos/big_buck_bunny_720p_30mb.mp4"; avdevice_register_all(); avformat_network_init(); AVFormatContext *avFormatContext = avformat_alloc_context(); if (avformat_open_input(&avFormatContext, filepath.c_str
前言
本文参考雷霄骅的博文最简单的基于FFMPEG+SDL的视频播放器:拆分-解码器和播放器,使用c++根据ffmpeg-4.1版本改写(原文代码基于旧版本ffmpeg)。代码见下文。
本文代码地址见https://github.com/2997215859/ffplay-learn/blob/master/Video/yuv_player.cpp
本文代码基于ffmpeg-4.1版本,事先需要安装好ffmpeg
本文代码提供CMakeLists.txt,见附录CMakeLists.txt部分,或根据CMakeLists.txt改写。需要链接的库如下(基本上安装ffmpeg、ffplay、SDL2之后就有了)。
avdevice avfilter avformat avcodec swscale swresample postproc avutil m xcb xcb-shm xcb xcb-shape xcb xcb-xfixes xcb-render xcb-shape xcb asound pthread m fontconfig freetype freetype z bz2 lzma SDL2 SDL2main
代码注解
代码主要部分就是读取之前解码器存储的yuv数据,并使用SDL渲染
#include <iostream>
#ifdef __cplusplus
extern "C" {
#endif
#include <SDL2/SDL.h>
#ifdef __cplusplus
};
#endif
using namespace std;
int stopRefresh = 0;
#define REFRESH_EVENT  (SDL_USEREVENT + 1)
#define BREAK_EVENT (SDL_USEREVENT + 2)
int refreshVideo (void *opaque) {
    stopRefresh = 0;
    while (!stopRefresh) {
        SDL_Event event;
        event.type = REFRESH_EVENT;
        SDL_PushEvent(&event);
        SDL_Delay(40);
    }
    st
		前言
本文参考雷霄骅的博文最简单的基于FFMPEG+SDL的视频播放器:拆分-解码器和播放器,使用c++根据ffmpeg-4.1版本改写(原文代码基于旧版本ffmpeg)。代码见下文。
本文代码地址见https://github.com/2997215859/ffplay-learn/blob/master/Video/decode2yuv.cpp
本文代码基于ffmpeg-4.1版本,事先需要安装好ffmpeg
本文代码提供CMakeLists.txt,见附录CMakeLists.txt部分,或根据CMakeLists.txt改写。需要链接的库如下(基本上安装ffmpeg、ffplay、SDL2之后就有了)。
avdevice avfilter avformat avcodec swscale swresample postproc avutil m xcb xcb-shm xcb xcb-shape xcb xcb-xfixes xcb-render xcb-shape xcb asound pthread m fontconfig freetype freetype z bz2 lzma SDL2 SDL2main
代码注解
#include <iostream>
#include <cstdio>
#include <cstdlib>
#ifdef __cplusplus
extern "C" {
#endif
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libavfilter/avfilter.h>
#include <libavdevice/avdevice.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
#ifdef __cplusplus
};
#endif
using namespace std;
int main () {
    string filepath = "/home/sensetime/videos/big_buck_bunny_720p_30mb.mp4";
    string outputFile = "/home/sensetime/v
		