mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
video invert optional
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -71,10 +71,14 @@ VIDEO_WIDTH="640"
|
|||||||
VIDEO_HEIGHT="480"
|
VIDEO_HEIGHT="480"
|
||||||
VIDEO_FPS="30"
|
VIDEO_FPS="30"
|
||||||
VIDEO_BITRATE="${VIDEO_BITRATE:-3000000}"
|
VIDEO_BITRATE="${VIDEO_BITRATE:-3000000}"
|
||||||
|
VIDEO_INVERT="${VIDEO_INVERT:-1}"
|
||||||
VIDEO_SENSOR_MODE="${VIDEO_SENSOR_MODE:-1296:972}"
|
VIDEO_SENSOR_MODE="${VIDEO_SENSOR_MODE:-1296:972}"
|
||||||
|
|
||||||
# Flip the camera 180deg (supported by rpicam-vid/libcamera-vid)
|
# Flip the camera 180deg by default; allow upright camera mounts via VIDEO_INVERT=0.
|
||||||
|
FLIP_ARGS=()
|
||||||
|
if [[ "${VIDEO_INVERT}" -ne 0 ]]; then
|
||||||
FLIP_ARGS=(--rotation 180)
|
FLIP_ARGS=(--rotation 180)
|
||||||
|
fi
|
||||||
|
|
||||||
MODE_ARGS=()
|
MODE_ARGS=()
|
||||||
if [[ -n "${VIDEO_SENSOR_MODE}" ]]; then
|
if [[ -n "${VIDEO_SENSOR_MODE}" ]]; then
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ type MediaConfig struct {
|
|||||||
AudioPublishURL string `yaml:"audioPublishUrl" json:"audioPublishUrl,omitempty"`
|
AudioPublishURL string `yaml:"audioPublishUrl" json:"audioPublishUrl,omitempty"`
|
||||||
AudioForwardURL string `yaml:"audioForwardUrl" json:"audioForwardUrl,omitempty"`
|
AudioForwardURL string `yaml:"audioForwardUrl" json:"audioForwardUrl,omitempty"`
|
||||||
PublishPort int `yaml:"publishPort" json:"-"`
|
PublishPort int `yaml:"publishPort" json:"-"`
|
||||||
|
CameraInverted bool `yaml:"cameraInverted" json:"-"`
|
||||||
Manage bool `yaml:"manage"`
|
Manage bool `yaml:"manage"`
|
||||||
ManageAudio bool `yaml:"manageAudio"`
|
ManageAudio bool `yaml:"manageAudio"`
|
||||||
Service string `yaml:"service"`
|
Service string `yaml:"service"`
|
||||||
@@ -178,6 +179,7 @@ func LoadConfig(path string) (*Config, error) {
|
|||||||
},
|
},
|
||||||
Media: MediaConfig{
|
Media: MediaConfig{
|
||||||
PublishPort: 9000,
|
PublishPort: 9000,
|
||||||
|
CameraInverted: true,
|
||||||
HealthInterval: Duration{Duration: 30 * time.Second},
|
HealthInterval: Duration{Duration: 30 * time.Second},
|
||||||
VideoBitrate: 2000000,
|
VideoBitrate: 2000000,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ func UpdatePublisherEnv(media MediaConfig, audio AudioConfig) error {
|
|||||||
fmt.Fprintf(&buf, "VIDEO_FPS=%d\n", media.VideoFPS)
|
fmt.Fprintf(&buf, "VIDEO_FPS=%d\n", media.VideoFPS)
|
||||||
}
|
}
|
||||||
fmt.Fprintf(&buf, "VIDEO_BITRATE=%d\n", media.VideoBitrate)
|
fmt.Fprintf(&buf, "VIDEO_BITRATE=%d\n", media.VideoBitrate)
|
||||||
|
fmt.Fprintf(&buf, "VIDEO_INVERT=%d\n", boolToInt(media.CameraInverted))
|
||||||
audioDevice := audio.CaptureDevice
|
audioDevice := audio.CaptureDevice
|
||||||
if audioDevice == "" || audioDevice == "rovermic" {
|
if audioDevice == "" || audioDevice == "rovermic" {
|
||||||
audioDevice = "hw:0,0"
|
audioDevice = "hw:0,0"
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ media:
|
|||||||
publishUrl: srt://192.168.0.86:9000?streamid=#!::r=roomba-alpha,m=publish&latency=10&mode=caller&transtype=live&pkt_size=1316
|
publishUrl: srt://192.168.0.86:9000?streamid=#!::r=roomba-alpha,m=publish&latency=10&mode=caller&transtype=live&pkt_size=1316
|
||||||
audioForwardUrl: srt://192.168.0.86:9000?streamid=#!::r=roomba-alpha-fwd,m=request&latency=10&mode=caller&transtype=live&pkt_size=1316
|
audioForwardUrl: srt://192.168.0.86:9000?streamid=#!::r=roomba-alpha-fwd,m=request&latency=10&mode=caller&transtype=live&pkt_size=1316
|
||||||
publishPort: 9000
|
publishPort: 9000
|
||||||
|
# Default assumes camera is mounted upside down; set false for upright mounts.
|
||||||
|
cameraInverted: true
|
||||||
videoBitrate: 2000000
|
videoBitrate: 2000000
|
||||||
manage: true
|
manage: true
|
||||||
service: video-publisher.service
|
service: video-publisher.service
|
||||||
|
|||||||
Reference in New Issue
Block a user