• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python FFmpeg Batch Encoding Dashboard

FBED - FFmpeg Batch Encoding Dashboard

A commandline python application for monitoring the progress of video encoding with FFmpeg. FBED makes use of ffmpeg-python and urwid.

Usage

fbed.py takes the number of parallel ffmpeg tasks to run followed by the list of files or directories to encode. If passed a directory, the script will find all videos within the directory and its subdirectories. The encoded videos are output to encode_output in the working directory.

Usage:
    ./fbed.py <parallel_encodes> <items>...

Guide:
    <items> can be a single files or a directories. If a directory is passed all
    files in the directory and it subdirectories besides those in one named
    'encode_output' will be re-encoded

By default FBED will use the h264_v4l2m2m encoder for hardware accelerated encoding on the Raspberry Pi 4. You may need to build FFmpeg from source to get a recent version with some bugs in this encoder fixed (version 4.3 or higher is required). If you're using hardware accelerated encoding on the Raspberry Pi keep in mind the limitations of the hardware: It can only run a single 1080p encode at a time. If your videos are lower resultion it may be able to run 2 or 3 in parallel, but if the encoding appears to freeze check the log files written out in encode_output for errors.

Example image of the dashboard

Configuring FBED

FBED has a few settings hard-coded in it that I found to work well for my use case. The script will pick the output target bitrate based on the video resolution, which you can increase or decrease as desired by editing the script:

# Pick bitrate based on resolution, 1080p (8Mbps), 720p (5Mbps), smaller (3Mbps)
bitrate = "3M"
if info["height"] > 720:
    bitrate = "8M"
elif info["height"] > 480:
    bitrate = "5M"

You can also change the encoder used to select a different hardware encoder (e.g., h264_nvenc on Nvidia GPUs, h264_qsv on Intel CPUs, etc.) by changing the value of c:v in the encoding_args to your desired encoder. You can also pass additional arguments to the encoder by adding them here. If you're on the RPi4 using h264_v4l2m2m I recommend leaving the num_output_buffers and num_capture_buffers as I've set them, which raises their values above the defaults of 16 and 4 respectively. When running parallel encodes of 720p and smaller videos I would get warnings from ffmpeg that the capture buffers where flushed out to user space, and to consider increasing them. These are set high enough that I don't seem to get these warnings, though exceed the memory capacity of the encoder if trying to do two 1080p streams in parallel. In that case you'd want to set them to half their current value (i.e., to 16 and 8 respectively). Do not modify or remove progress parameter, as this is required by the dashboard.

encoding_args = {
    # HWAccel for RPi4, may need to pick a different encoder
    # for HW accel on other systems
    "c:v": "h264_v4l2m2m",
    "num_output_buffers": 32,
    "num_capture_buffers": 16,
    "b:v": bitrate,
    "c:a": "copy",
    "progress": f"pipe:{self.pipe_write}"
}

More Repositories

1

ChameleonRT

An example path tracer that runs on multiple ray tracing backends (Embree/DXR/OptiX/Vulkan/Metal/OSPRay)
C++
599
star
2

tray_rust

A toy ray tracer in Rust
Rust
513
star
3

TwinklebearDev-Lessons

Source code and assets for the TwinklebearDev Tutorials
C++
323
star
4

webgl-volume-raycaster

A WebGL Volume Raycaster
JavaScript
245
star
5

tobj

Tiny OBJ Loader in Rust
Rust
231
star
6

webgl-marching-cubes

An example of marching cubes in WebGL, using Rust + WebASM to compute the isosurface
JavaScript
87
star
7

ispc-rs

Rust library for build scripts to compile ISPC code into a Rust library
Rust
84
star
8

tray

A toy ray tracer
C++
70
star
9

dxr-ao-bake

A demo of ambient occlusion map baking using DXR
C++
57
star
10

webgpu-bcmc

WebGPU Data-Parallel Block-Compressed Marching Cubes Isosurface Extraction
JavaScript
53
star
11

webgpu-0-to-gltf

Code for my From 0 to glTF with WebGPU blog series
TypeScript
49
star
12

webgpu-experiments

A series of examples written while learning about WebGPU
JavaScript
48
star
13

webgpu-marching-cubes

A GPU-parallel Marching Cubes implementation using WebGPU
TypeScript
48
star
14

bspline

Generic B-Spline Curves in Rust
Rust
40
star
15

webgpu-gltf

A glTF loader and viewer using WebGPU
JavaScript
39
star
16

wgpu-cpp-starter

Starter project for cross platform WebGPU development in C++
C++
39
star
17

embree-rs

Rust bindings to Embree 3
Rust
34
star
18

webgpu-cpp-gltf

C++
31
star
19

webgpu-webpack-starter

A starter template for WebGPU development using webpack
JavaScript
29
star
20

asteroids

An over-engineered implementation of Asteroids
C
29
star
21

lfwatch

A LightFileWatcher
C++
27
star
22

webgl-ewa-splatter

An EWA surface splatter in WebGL
JavaScript
26
star
23

webgpu-cpp-wasm

Template to get started with SDL2 + WebGPU C++ -> Native/Wasm projects
C++
26
star
24

arcball-cpp

A Shoemake Arcball camera in C++
C
25
star
25

oidn-rs

Rust bindings to Intel's OpenImageDenoise Library
Rust
25
star
26

spline-viewer

A viewer for B-spline curves and surfaces
Rust
20
star
27

webgpu-volume-pathtracer

This is a WebGPU implementation of a volume path tracer that uses delta tracking to sample the volume.
JavaScript
19
star
28

webgpu-prog-iso

Code for the paper "Speculative Progressive Raycasting for Memory Constrained Isosurface Visualization of Massive Volumes"
JavaScript
18
star
29

webgpu-volume-raycaster

JavaScript
18
star
30

LPCGame

Working on a C++ tile based 'engine' using SDL
C++
17
star
31

imgui-transfer-function

A transfer function widget implemented using ImGui
C++
16
star
32

webgl-neuron

An SWC + Volume/TIFF Stack Viewer in WebGL
JavaScript
16
star
33

tobj_viewer

A very simple Wavefront OBJ viewer using tobj and glium
Rust
15
star
34

webgl-util

A set of barebones utilities for playing with WebGL
JavaScript
15
star
35

topo-vol

Topology Guided Volume Exploration
C++
15
star
36

sdl2_vulkan

SDL2 + Vulkan
C++
14
star
37

micro-packet

A micro packet ray tracer
C++
14
star
38

ChameleonRT-lang

A hobby language and API for cross API and cross platform ray tracing
C++
13
star
39

vulkan-marching-cubes

A GPU-parallel implementation of Marching Cubes in Vulkan
C++
12
star
40

webgpu-isosurface-raycaster

A WebGPU Isosurface Raycaster
JavaScript
10
star
41

tray_rust_blender

tray_rust plugin for Blender
Python
9
star
42

light_arena

A lightweight, placement based memory arena
Rust
9
star
43

webgpu-cpp-usdz

Trying out Rendering USDZ
C++
9
star
44

arcball

A Shoemake arcball camera in Rust
Rust
8
star
45

webgpu-webpack-typescript-starter

A starter template for WebGPU development using webpack and TypeScript
TypeScript
8
star
46

ssao

Sort of an implementation of Scalable Ambient Obscurance, but not quite
C++
8
star
47

OpenCL-OpenGL-Interop

Fiddling around with OpenCL/OpenGL Interop and using SDL2 for windowing
C++
8
star
48

mini-osp-vis

A Mini-app Example for Scientific Visualization Using OSPRay
C++
7
star
49

build-ship-dbg-wasm

Code for my blog post on building, shippping, and debugging WebAssembly
C++
7
star
50

libbat

Scalable adaptive I/O for particles
C++
6
star
51

Twinklebear.github.io

My website
JavaScript
6
star
52

sdl2_dx12

C++
5
star
53

webgl-volume-animation

Play back 3D volumetric time series data
JavaScript
5
star
54

ship-wasm-npm

Code for my blog post on shipping and using Wasm in an NPM package
CMake
5
star
55

sdl2_metal

An example app of using Metal to render to an SDL2 window
CMake
5
star
56

theta-tunnel

A script for tunneling ports onto Theta compute nodes for remote visualization
Shell
5
star
57

Charm-experiments

Different code written while checking out Charm++
C
5
star
58

uu-dissertation-template

IEEE Style CS Dissertation Template for Univ. of Utah
TeX
5
star
59

3D-Tiles

Fast 3D tile style map rendering
C
4
star
60

Nano-BMP

A minimal BMP library
C
4
star
61

pico_bench

A minimal C++11 benchmarking library.
C++
4
star
62

mini-cinema

A Cinema-style mini-app example for OSPRay
C++
4
star
63

wgpu-rs-test

Trying out Rust + WebGPU via wgpu-rs for cross platform native/web graphics
Rust
4
star
64

ffmpeg-slideshow-py

Easily make a slideshow with crossfade image transitions using FFmpeg
Python
4
star
65

crafting-interpreters

Working through https://craftinginterpreters.com/
C++
3
star
66

vsbillboards

A demo of quickly rendering camera-facing 3d billboards using the vertex shader.
C
3
star
67

eigen_vec3.ispc

Joachim Kopp's hybrid 3x3 real-symmetric eigenvector & value solver in ispc
C
3
star
68

ospray_starter

Get started quickly with developing an OSPRay app or custom module
C++
3
star
69

zed-vive-mr

A mixed reality test and manual calibration app for the ZED using OpenVR
C++
3
star
70

osp-mpi-distrib-samples

Small tutorial samples of the OSPRay MPI Distributed Device
C++
3
star
71

crescent

A MoonRay inspired ray tracer
Rust
3
star
72

osp-distrib-viewer

A distributed viewer application for OSPRay showcasing more advanced features
C++
2
star
73

wall_art

Generate nice wallpapers from images
C++
2
star
74

sdl2webgpu

A function to easily get a WebGPU context for SDL2 on Web & Native
CMake
2
star
75

vis17-particles-ospray

Particle Rendering Samples in OSPRay for the VIS17 Particle Rendering Tutorial
C++
2
star
76

ospray-vive

C
2
star
77

parallel-rsync

Script for parallelizing rsync transfers on large directories
Python
2
star
78

module_lidar_importer

A LiDAR importer for OSPRay's scenegraph
C++
2
star
79

module_pidx

PIDX rendering sample app for OSPRay
C++
2
star
80

SSE-Fiddle

Messing around with making a very basic SSE math library for 4 vectors and 4x4 matrices
C
2
star
81

fast-kd

A k-d tree builder which is pretty fast
C++
2
star
82

ExaMPM-libbat

C++
2
star
83

webgl-df

WebGL Distance Field Renderer
JavaScript
1
star
84

particle-lasso

Utilities for lassoing particle data
C++
1
star
85

arxivify

A utility script to make it easier to build the flattened tex/assets layout that arXiv takes for uploads.
Python
1
star
86

module_openvr

OpenVR Module for OSPRay. View 360 panorama images in VR
C
1
star
87

rvk

A library for easily building remote rendering visualization applications
C++
1
star
88

OpenGL-Wrapper

A simple OpenGL Wrapper/Learning project I'm working on
C++
1
star
89

microGL

A micro OpenGL-like rasterizer
C
1
star
90

libIS

libIS is an in situ data management layer for easily using or prototyping in transit visualization
C++
1
star
91

ispc.vim

ISPC syntax and indentation configuration for vim
Vim Script
1
star
92

module_pidx_particle

PIDX Particle Rendering with OSPRay
C++
1
star
93

blender_export_crts

A ChameleonRT Scene Exporter for Blender
Python
1
star
94

tbb_scan_example

Example of using TBB parallel scan for inclusive/exclusive scans and marching cubes
C++
1
star
95

ospray_senpai

OSPRay viewer for use with SENSEI simulations and libIS, from the ISAV18 paper
C++
1
star
96

Deferred-Rendering

Playing around with making a deferred renderer
C++
1
star
97

webgpu-bcmc-data-generator

Convert RAW files or generate synthetic data for BCMC
C++
1
star
98

arcball.js

A Shoemake Arcball camera in Javascript
JavaScript
1
star