-
Notifications
You must be signed in to change notification settings - Fork 42
/
PipeLines.h
73 lines (63 loc) · 1.72 KB
/
PipeLines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef _PIPELINE_H
#define _PIPELINE_H
#define TEST_VIDEO
//#define TEST_RTSP
//#define TEST_CAMERA
#ifndef TEST_CAMERA
static std::string CreateAppSinkPipeline()
{
std::stringstream pipelineString;
pipelineString
#ifdef TEST_RTSP
<< "rtsp://192.168.31.163:554/"
<< LINK
#elif defined TEST_VIDEO
<< "filesrc location=/usr/local/test.mp4"
<< LINK
<< "qtdemux"
<< LINK
#endif
<< "h264parse"
<< LINK
<< "mppvideodec"
<< LINK
<< "video/x-raw,format=(string)NV12"
<< LINK
<< "rgaconvert output-io-mode=dmabuf-import capture-io-mode=dmabuf vpu-stride=true"
<< LINK
<< "video/x-raw,format=BGR,width=(int)1920,height=(int)1080"
<< LINK
<< "appsink caps=video/x-raw,format=BGR name="
<< APPSINK_NAME;
return pipelineString.str();
}
#else
static std::string CreateAppSinkPipeline()
{
std::stringstream pipelineString;
pipelineString
<< "v4l2src device=/dev/video1"
<< LINK
<< "mppvideodec"
<< LINK
<< "rgaconvert output-io-mode=dmabuf-import capture-io-mode=dmabuf"
<< LINK
<< "video/x-raw,format=(string)BGR,width=(int)1920,height=(int)1080,framerate=(fraction)30/1"
<< LINK
<< "appsink name="
<< APPSINK_NAME;
return pipelineString.str();
}
#endif
static std::string CreateAppSrcPipeline()
{
std::stringstream pipelineString;
pipelineString
<< "appsrc caps=video/x-raw,format=(string)BGR,width=(int)1920,height=(int)1080,framerate=(fraction)30/1 "
"block=true name="
<< APPSRC_NAME
<< LINK
<< "rkximagesink sync=false";
return pipelineString.str();
}
#endif