Skip to content

GrgoMariani/RayMarching--OpenCV--ffmpeg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RayMarching->OpenCV->ffmpeg

Description

I guess there could have been a lot of better time uses than emulating GLSL shaders in OpenCV and then pipe-ing it to ffmpeg.

Threading is done via openmp, to disable it remove DEFINES from CXXFLAGS in Makefile



HOW TO

  • Step0: Prerequisites

Make sure to install OpenCV (preferably the latest one) and install ffmpeg.

  • Step1: Compile
g++ main.cpp -std=c++11 -o raymarching `pkg-config opencv --cflags --libs`

or use

make

  • Step2: Use
./raymarching | ffmpeg -f rawvideo -pixel_format bgr24 -video_size 320x240 -i - -f mpegts -preset veryslow -vcodec libx264 udp://localhost:5000

Pipe the output directly to ffmpeg with this command

  • Step3: Watch

Open VLC player (or SMPlayer) and use CTRL+N (CTRL+U - SMPlayer) to open the stream from URL

udp://@0.0.0.0:5000


Code Explanation

Follow xdPixel's Tutorial

Check xdPixel's tutorial for code. It's his RayMarching code after all.

Why use this code ???

Why not ???

About

Use raymarching with opencv and stream the result to ffmpeg

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published