@@ -50,13 +50,17 @@ def define_args(p):
50
50
# for options that might be available. On Raspberry Pi or Jetson, try "h264_v4l2m2m",
51
51
# and on Linux machines with Nvidia GPUs, try "h264_nvenc".
52
52
p .add_argument ('--ffmpeg_codec' , help = "FFMpeg codec for host" , default = None )
53
+ p .add_argument ('--ffmpeg_preview' , help = "Save PNG previews while recording with ffmpeg every Nth frame" , type = int )
54
+ p .add_argument ('--ffmpeg_preview_scale' , help = "Scale of the ffmpeg PNG previews 0.5 half, 1.0 full resolution etc." , type = float )
55
+ p .add_argument ("--use_encoded_video" , help = "Encodes video on OAK-D, works only in recording only mode" , action = "store_true" )
56
+ p .add_argument ("--color_stereo" , help = "Use this flag with devices that have color stereo cameras" , action = "store_true" )
53
57
p .add_argument ('--map' , help = 'Record SLAM map' , action = "store_true" )
54
58
p .add_argument ('--no_feature_tracker' , help = 'Disable on-device feature tracking' , action = "store_true" )
55
59
p .add_argument ('--vio_auto_exposure' , help = 'Enable SpectacularAI auto exposure which optimizes exposure parameters for VIO performance (BETA)' , action = "store_true" )
56
60
p .add_argument ('--ir_dot_brightness' , help = 'OAK-D Pro (W) IR laser projector brightness (mA), 0 - 1200' , type = float , default = 0 )
57
61
p .add_argument ("--resolution" , help = "Gray input resolution (gray)" ,
58
62
default = '400p' ,
59
- choices = ['400p' , '800p' ])
63
+ choices = ['400p' , '800p' , '1200p' ])
60
64
61
65
return p
62
66
@@ -89,6 +93,8 @@ def record(args):
89
93
autoFolderName = datetime .datetime .now ().strftime ("%Y%m%dT%H%M%S" )
90
94
outputFolder = os .path .join (outputFolder , autoFolderName )
91
95
96
+ internalParameters = {}
97
+
92
98
if not args .no_inputs :
93
99
config .recordingFolder = outputFolder
94
100
if args .map :
@@ -111,10 +117,20 @@ def record(args):
111
117
if args .disable_cameras :
112
118
config .disableCameras = True
113
119
if args .ffmpeg_codec is not None :
114
- config .internalParameters = { 'ffmpegVideoCodec' : args .ffmpeg_codec + ' -b:v 8M' }
115
- print (config .internalParameters )
120
+ internalParameters ["ffmpegVideoCodec" ] = args .ffmpeg_codec + ' -b:v 8M'
116
121
if args .no_usb_speed_check :
117
122
config .ensureSufficientUsbSpeed = False
123
+ if args .color_stereo :
124
+ config .useColorStereoCameras = True
125
+ if args .use_encoded_video :
126
+ config .forceUnrectified = True
127
+ config .useEncodedVideo = True
128
+ if args .ffmpeg_preview :
129
+ internalParameters ["ffmpegPngPreviewNthFrame" ] = str (args .ffmpeg_preview )
130
+ if args .ffmpeg_preview_scale :
131
+ internalParameters ["ffmpegPngPreviewScale" ] = str (args .ffmpeg_preview_scale ).replace ("," , "." )
132
+
133
+ config .internalParameters = internalParameters
118
134
119
135
# Enable recoding by setting recordingFolder option
120
136
vio_pipeline = spectacularAI .depthai .Pipeline (pipeline , config )
0 commit comments