Skip to content

Instantly share code, notes, and snippets.

View rpvelloso's full-sized avatar

Roberto Panerai Velloso rpvelloso

  • Florianópolis (SC), Brazil
View GitHub Profile
@rpvelloso
rpvelloso / rpi_camera_v4l2_ffmpeg.md
Created September 8, 2020 15:05 — forked from moritzmhmk/rpi_camera_v4l2_ffmpeg.md
using raspberry pi camera with ffmpeg (hardware accelerated)

Using Raspberry Pi Camera with ffmpeg

Capturing video from the rpi camera with ffmpeg can vary from less than 5% to 100% of the CPU (rpi zero) depending on ffmpeg using the hardware acceleration or not.

On many github issues one finds the suggestion of using h264_omx codec to use the gpu - but it does not ship with the default ffmpeg on Raspbian.

Instead I found that one can use the v4l2 driver provided by raspbian to get hardware accelerated h264 output. Also setting the video size will save one from using a (cpu) scale filter.

ffmpeg

capture h264 video from rpi camera

@rpvelloso
rpvelloso / rpi_camera_v4l2_ffmpeg.md
Created September 8, 2020 15:05 — forked from moritzmhmk/rpi_camera_v4l2_ffmpeg.md
using raspberry pi camera with ffmpeg (hardware accelerated)

Using Raspberry Pi Camera with ffmpeg

Capturing video from the rpi camera with ffmpeg can vary from less than 5% to 100% of the CPU (rpi zero) depending on ffmpeg using the hardware acceleration or not.

On many github issues one finds the suggestion of using h264_omx codec to use the gpu - but it does not ship with the default ffmpeg on Raspbian.

Instead I found that one can use the v4l2 driver provided by raspbian to get hardware accelerated h264 output. Also setting the video size will save one from using a (cpu) scale filter.

ffmpeg

capture h264 video from rpi camera

@rpvelloso
rpvelloso / dp.cpp
Last active December 4, 2017 19:43
Dynamic Programming - step by step (UVa #11137 - Ingenuous Cubrency)
// problem: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2078
/*
* 1º step) Naive powerset (brute force) - no memoization (TLE)
*/
#include <iostream>
#include <array>
#include <cmath>