https://github.com/grgomariani/raymarching--opencv--ffmpeg
Use raymarching with opencv and stream the result to ffmpeg
https://github.com/grgomariani/raymarching--opencv--ffmpeg
computer-vision ffmpeg opencv raymarching shaders stream
Last synced: about 2 months ago
JSON representation
Use raymarching with opencv and stream the result to ffmpeg
- Host: GitHub
- URL: https://github.com/grgomariani/raymarching--opencv--ffmpeg
- Owner: GrgoMariani
- License: mit
- Created: 2018-06-05T13:51:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-13T11:49:52.000Z (about 8 years ago)
- Last Synced: 2025-04-24T03:47:45.133Z (about 1 year ago)
- Topics: computer-vision, ffmpeg, opencv, raymarching, shaders, stream
- Language: C++
- Size: 31.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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]( http://xdpixel.com/ray-marching-101-part-2/ ) for code. It's his RayMarching code after all.
## Why use this code ???
Why not ???