? linux ? ? latex ? ? xelatex ?    发布于 2019-03-27   130人围观   0条评论

pre

目的: 在ubuntu搭建基于xelatex的论文编写环境
手段:

  1. 通过安装tex live 安装xelatex

tex live 安装

clean

如果上一次安装失败,则清理上一次遗留的安装文件

  1. rm -rf /usr/local/texlive/2018
  2. rm -rf ~/.texlive2018

下载iso

打开 http://tug.org/texlive/acquire-iso.html,点击download from a nearby CTAN mirror,下载iso文件

挂载镜像并安装

  1. sudo mount texlive2018-20180414.iso /mnt/
  2. cd /mnt/
  3. sudo ./install-tl

config

修改 /etc/profile,更改环境变量PATH

  1. export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH
  2. export MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH
  3. export INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH

texmaker 安装

  1. sudo apt install texmaker

或者使用TexWorks

  1. sudo apt install texworks

测试

  1. \documentclass{article}
  2. \begin{document}
  3. sdfasfdasd
  4. \end{document}

中文支持

  1. \documentclass[UTF8]{ctexart}
  2. \begin{document}
  3. 你好,world撒旦啊!
  4. \end{document}
查看更多
? c++ ? ? ffmpeg ? ? 播放器 ? ? SDL ?    发布于 2019-01-31   1337人围观   0条评论

前言

本文参考雷霄骅的博文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
查看更多
发布于 2019-01-31   716人围观   0条评论

前言

本文参考雷霄骅的博文最简单的基于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
查看更多
发布于 2019-01-24   490人围观   0条评论

前言

本文参考雷霄骅的博文最简单的基于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
查看更多
? c++ ? ? ffmpeg ? ? hello ?    发布于 2019-01-23   1953人围观   0条评论

前言

本文参考雷霄骅的博文最简单的基于FFMPEG的Helloworld程序,使用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之后就有了)。

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

 

代码

主函数

int main () {

    cout << "\n<<Configuration>>\n" << configurationInfo(); // 打印ffmpeg的configure信息

    cout << "\n<<URLProtocol>>\n" << urlProtocolInfo(); // 打印URL

    cout << "\n<AVFormat>\n" << formationInfo();

    cout << "\n<<AVCodec>>\n" << avcodecInfo();

    cout << "\n<<AVFilter>>\n" << avfilterInfo();

    return 0;
}

 

分函数

1. 打印ffempg的configure信息,直接调用avdevice_configuration函数,返回char字符串

string configurationInfo () {
    return string(avdevice_configuration());
}

2. 利用avio_enum_p

查看更多