Install ffmpeg based on this gist
apt install -y \
x264 \
fcitx-libs-dev fcitx-libs-qt5 \
mesa-utils \
libgtk2.0-dev \
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| """Custom QMainWindow Widget.""" | |
| import os | |
| import sys | |
| from random import randint |
| #include <stdio.h> | |
| #include <opencv2/opencv.hpp> | |
| using namespace cv; | |
| void save(const char *filename, const unsigned char * data, int size) | |
| { | |
| FILE *fp = fopen(filename, "wb"); | |
| fwrite(data, size, 1, fp); | |
| fclose(fp); |
| #!/bin/bash | |
| apt-get update | |
| apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \ | |
| libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \ | |
| libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev | |
| # Create a dir where the rest of the sources will live | |
| mkdir ~/ffmpeg_sources |
Install ffmpeg based on this gist
apt install -y \
x264 \
fcitx-libs-dev fcitx-libs-qt5 \
mesa-utils \
libgtk2.0-dev \
| version="2.4.12" | |
| echo "Installing OpenCV" $version | |
| mkdir OpenCV | |
| cd OpenCV | |
| echo "Removing any pre-installed ffmpeg and x264" | |
| sudo apt-get -qq remove ffmpeg x264 libx264-dev | |
| echo "Installing Dependenices" |
| /* | |
| * Read video frame with FFmpeg and convert to OpenCV image | |
| * | |
| * Copyright (c) 2016 yohhoy | |
| */ | |
| #include <iostream> | |
| #include <vector> | |
| // FFmpeg | |
| extern "C" { | |
| #include <libavformat/avformat.h> |
| /* | |
| * Convert from OpenCV image and write movie with FFmpeg | |
| * | |
| * Copyright (c) 2016 yohhoy | |
| */ | |
| #include <iostream> | |
| #include <vector> | |
| // FFmpeg | |
| extern "C" { | |
| #include <libavformat/avformat.h> |
| /* | |
| * Convert from OpenCV image and write movie with FFmpeg | |
| * | |
| * Copyright (c) 2021 yohhoy | |
| */ | |
| #include <iostream> | |
| #include <vector> | |
| // FFmpeg | |
| extern "C" { | |
| #include <libavformat/avformat.h> |
| LOCAL_PATH := $(call my-dir) | |
| include $(CLEAR_VARS) | |
| OPENCV_LIB_TYPE:=STATIC | |
| OPENCV_INSTALL_MODULES:=on | |
| include /home/jay/Android_OpenCV/OpenCV-2.4.8-android-sdk/sdk/native/jni/OpenCV.mk | |
| LOCAL_MODULE := tutorial02 |
cd src/mainmkdir jni