Skip to content

Commit 5c6f84e

Browse files
wip: overnight; gstreamer & swapped shark/sawfish
1 parent 94a31cf commit 5c6f84e

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

src/missions/gate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ pub async fn gate_run_procedural<
8989

9090
let shark = detections
9191
.iter()
92-
.filter(|d| matches!(d.class().identifier, Target::Shark))
92+
.filter(|d| matches!(d.class().identifier, Target::Sawfish))
9393
.collect_vec();
9494

9595
let sawfish = detections
9696
.iter()
97-
.filter(|d| matches!(d.class().identifier, Target::Sawfish))
97+
.filter(|d| matches!(d.class().identifier, Target::Shark))
9898
.collect_vec();
9999

100100
let mut traversal_timer = DelayAction::new(7.5); // forward duration in second

src/video_source/appsink.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,32 @@ impl Camera {
6666
+ ".mp4\" ";
6767

6868
#[cfg(feature = "annotated_streams")]
69+
let rtsp_string = "h264. ! queue ! h264parse config_interval=-1 ! video/x-h264,stream-format=byte-stream,alignment=au ! rtspclientsink location=rtsp://127.0.0.1:8554/".to_string()
70+
+ camera_name + "_annotated.mp4 ";
71+
#[cfg(feature = "annotated_streams")]
6972
let output_string = "appsrc ! videoconvert ! ".to_string()
7073
+ &h264_enc_pipeline(2048000)
71-
+ " ! mpegtsmux ! rtspclientsink location=rtspt://127.0.0.1:8554/"
74+
// + " ! h264parse config_interval=-1 ! video/x-h264,stream-format=byte-stream,alignment=au"
75+
+ " ! h264parse config_interval=-1 ! video/x-h264,stream-format=byte-stream,alignment=au !"
76+
+ " rtspclientsink location=rtsp://127.0.0.1:8554/"
7277
+ camera_name
7378
+ "_annotated.mp4 ";
79+
dbg!(&output_string);
80+
// pipeline_head(camera_path, camera_dimensions.0, camera_dimensions.1, 30)
81+
// "appsrc ! image/jpeg, width=480, height=640, framerate=30/1".to_string()
82+
// + " ! jpegdec ! tee name=raw "
83+
// + "raw. ! queue ! videoconvert ! videobalance brightness=0.0 ! appsink "
84+
// + "raw. ! queue ! videoconvert ! "
85+
// + &h264_enc_pipeline(2048000)
86+
// + " ! tee name=h264 "
87+
// + if rtsp { &rtsp_string } else { "" }
88+
// + "h264. ! queue ! mpegtsmux ! filesink location=\""
89+
// + filesink
90+
// .to_str()
91+
// .ok_or(anyhow!("filesink_dir is not a string"))?
92+
// + "/"
93+
// + camera_name
94+
// + "_annotated.mp4\" ";
7495

7596
let frame: Arc<Mutex<Option<Mat>>> = Arc::default();
7697
let frame_copy = frame.clone();
@@ -152,7 +173,7 @@ fn pipeline_head(device_name: &str, width: u32, height: u32, framerate: u32) ->
152173
return format!("mfvideosrc device-index={device_name} ! image/jpeg, width={width}, height={height}, framerate={framerate}/1");
153174

154175
#[cfg(not(target_os = "windows"))]
155-
return format!("v4l2src device={device_name} exposure=30 ! image/jpeg, width={width}, height={height}, framerate={framerate}/1");
176+
return format!("v4l2src device={device_name} exposure=50 ! image/jpeg, width={width}, height={height}, framerate={framerate}/1");
156177
}
157178

158179
fn h264_enc_pipeline(bitrate: u32) -> String {

0 commit comments

Comments
 (0)