Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
bde06039
Commit
bde06039
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Implements
#217
cmd arg play ftl files
parent
3387c58a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/reconstruct/src/main.cpp
+31
-0
31 additions, 0 deletions
applications/reconstruct/src/main.cpp
components/codecs/src/encoder.cpp
+1
-1
1 addition, 1 deletion
components/codecs/src/encoder.cpp
with
32 additions
and
1 deletion
applications/reconstruct/src/main.cpp
+
31
−
0
View file @
bde06039
...
...
@@ -16,6 +16,7 @@
#include
<ftl/rgbd/group.hpp>
#include
<ftl/threads.hpp>
#include
<ftl/codecs/writer.hpp>
#include
<ftl/codecs/reader.hpp>
#include
"ilw/ilw.hpp"
#include
<ftl/render/splat_render.hpp>
...
...
@@ -102,6 +103,36 @@ static void run(ftl::Configurable *root) {
net
->
start
();
net
->
waitConnections
();
// Check paths for an FTL file to load...
auto
paths
=
(
*
root
->
get
<
nlohmann
::
json
>
(
"paths"
));
for
(
auto
&
x
:
paths
.
items
())
{
std
::
string
path
=
x
.
value
().
get
<
std
::
string
>
();
auto
eix
=
path
.
find_last_of
(
'.'
);
auto
ext
=
path
.
substr
(
eix
+
1
);
// Command line path is ftl file
if
(
ext
==
"ftl"
)
{
// Create temp reader to count number of sources found in file
std
::
ifstream
file
;
file
.
open
(
path
);
ftl
::
codecs
::
Reader
reader
(
file
);
reader
.
begin
();
int
max_stream
=
0
;
reader
.
read
(
reader
.
getStartTime
()
+
100
,
[
&
max_stream
](
const
ftl
::
codecs
::
StreamPacket
&
spkt
,
const
ftl
::
codecs
::
Packet
&
pkt
)
{
max_stream
=
max
(
max_stream
,
spkt
.
streamID
);
});
reader
.
end
();
LOG
(
INFO
)
<<
"Found "
<<
(
max_stream
+
1
)
<<
" sources in "
<<
path
;
// For each stream found, add a source object
for
(
int
i
=
0
;
i
<
max_stream
;
++
i
)
{
root
->
getConfig
()[
"sources"
].
push_back
(
nlohmann
::
json
{{
"uri"
,
std
::
string
(
"file://"
)
+
path
+
std
::
string
(
"#"
)
+
std
::
to_string
(
i
)}});
}
}
}
// Create a vector of all input RGB-Depth sources
auto
sources
=
ftl
::
createArray
<
Source
>
(
root
,
"sources"
,
net
);
...
...
This diff is collapsed.
Click to expand it.
components/codecs/src/encoder.cpp
+
1
−
1
View file @
bde06039
...
...
@@ -73,6 +73,6 @@ bool Encoder::encode(const cv::Mat &in, preset_t preset,
const
auto
&
settings
=
ftl
::
codecs
::
getPreset
(
preset
);
const
definition_t
definition
=
(
in
.
type
()
==
CV_32F
)
?
settings
.
depth_res
:
settings
.
colour_res
;
const
bitrate_t
bitrate
=
(
in
.
type
()
==
CV_32F
)
?
settings
.
depth_qual
:
settings
.
colour_qual
;
LOG
(
INFO
)
<<
"Encode definition: "
<<
(
int
)
definition
;
return
encode
(
in
,
definition
,
bitrate
,
cb
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment