Apollo
11.0
自动驾驶开放平台
video2jpg.cc
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2019 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
17
#include "gflags/gflags.h"
18
19
#include "
cyber/common/log.h
"
20
#include "
modules/drivers/video/tools/decode_video/frame_processor.h
"
21
22
using
apollo::drivers::video::FrameProcessor
;
23
24
DECLARE_string
(input_video);
25
DECLARE_string
(output_dir);
26
DEFINE_string
(input_video,
""
,
"The input video file"
);
27
DEFINE_string
(output_dir,
""
,
"The directory to output decoded pictures."
);
28
29
int
main
(
int
argc,
char
** argv) {
30
google::ParseCommandLineFlags(&argc, &argv,
true
);
31
AINFO
<<
"input video: "
<< FLAGS_input_video
32
<<
". output dir: "
<< FLAGS_output_dir;
33
FrameProcessor
processor(FLAGS_input_video, FLAGS_output_dir);
34
if
(!processor.
ProcessStream
()) {
35
AERROR
<<
"error: failed to decode file "
<< FLAGS_input_video;
36
return
-1;
37
}
38
return
0;
39
}
apollo::drivers::video::FrameProcessor
FrameProcessor is a class to process video streams.
Definition
frame_processor.h:30
apollo::drivers::video::FrameProcessor::ProcessStream
bool ProcessStream() const
Definition
frame_processor.cc:41
frame_processor.h
log.h
AERROR
#define AERROR
Definition
log.h:44
AINFO
#define AINFO
Definition
log.h:42
main
int main(int argc, char **argv)
Definition
video2jpg.cc:29
DECLARE_string
DECLARE_string(input_video)
DEFINE_string
DEFINE_string(input_video, "", "The input video file")
modules
drivers
video
tools
decode_video
video2jpg.cc