Skip to content

Commit

Permalink
screensharing documentation (#7)
Browse files Browse the repository at this point in the history
* screensharing documentation

* cleanup

* cleanup

* cleanup

* cleanup
  • Loading branch information
Mast3rwaf1z authored Nov 25, 2024
1 parent d3836a4 commit 1cb1d94
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
venv

*.mp4
*.webm

.direnv
.envrc
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ project(hyperwall)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(PROJECT_IMPLEMENTATIONS
src/FFmpeg.cpp
src/Sources.cpp
src/Hyperwall.cpp
src/impl/FFmpeg.cpp
src/impl/Sources.cpp
src/impl/Hyperwall.cpp
)
set(CMAKE_CXX_FLAGS "-O3")

Expand All @@ -31,3 +31,4 @@ target_link_libraries(sender
${OpenCV_LIBS}
argparse
)

12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@ cmake --build build -j4
```sh
./build/sender <args>
# in another shell
./scripts/tmux-ffplay.sh
./scripts/tmux-ffplay.sh <ip addr>
```

### Screensharing
screensharing is at the moment an exercise in setting up a tcp stream yourself. in a shell do something like:
```sh
ffmpeg -f x11grab -i :0 -vcodec libx264 -f mpegts tcp://127.0.0.1:8600
```
then in another shell, start the hyperwall:
```sh
./build/sender --file "tcp://127.0.0.1:8600?listen" ... <args>
```
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
packages = with pkgs; [
opencv
ffmpeg
cmake
];
};
};
Expand Down
6 changes: 3 additions & 3 deletions scripts/tmux-ffplay.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

for ((x=0;x<$1;x++)); do
for ((y=0;y<$2;y++)); do
tmux new-session -d ffplay rtsp://localhost:8554/frame/$x/$y
for ((x=0;x<$2;x++)); do
for ((y=0;y<$3;y++)); do
tmux new-session -d ffplay rtsp://$1:8554/frame/$x/$y
done
done
3 changes: 2 additions & 1 deletion src/FFmpeg.cpp → src/impl/FFmpeg.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "FFmpeg.hpp"
#include <cstdio>
#include <format>
#include <opencv2/core/mat.hpp>
#include <opencv2/opencv.hpp>
#include <sstream>
#include <string>

Expand Down Expand Up @@ -41,3 +41,4 @@ const void Hyperwall::FFmpeg::write(const cv::Mat& mat) const {
fwrite(mat.data, 1, mat.cols * mat.rows * 3, buffer);
fflush(buffer);
}

File renamed without changes.
File renamed without changes.

0 comments on commit 1cb1d94

Please sign in to comment.