SlideShare a Scribd company logo
VideoMR:
A Map and Reduce Framework for
Real-time Video Processing
Benjamin-Heinz Meier, Matthias Trapp, Jürgen Döllner
Hasso Plattner Institute, University of Potsdam, Germany
1
Motivation
For our research we were searching
for a real-time video processing
framework supporting us to develop
GPU-based filter operation.
2
3
Video
Processing
3
Abstraction
& Usability
Video
Processing
3
Abstraction
& Usability
GPU
Program-
ming
Video
Processing
3
GPU
Program-
ming
Abstraction
& Usability
Video
Processing
GStreamer,
Videotoolkit,
Premiere,
...
Plug-
Ins
Map & Reduce
MARS, ...
4
VideoMR
5
GPU
Program-
ming
Abstraction
& Usability
Video
Processing
VideoMR
bounded
memory concept,
new definition of operators
Map & Reduce
transparent
memory management
using streams
6
GPU
Program-
ming
Abstraction
& Usability
Video
Processing
Agenda
Memory management using LMAX disruptors as streams
The concept of Map & Reduce
A redefinition for video processing
A small example
Performance Evaluation
Limitations & Improvements
Conclusion
7
Memory Management
A video is a sequence of frames
A stream is a subsequence of the video with a fixed size
Implemented using the idea of a disruptor [Tho’11] :
using LMAX disruptors as streams
time
current frame
pointer
0
-1
-2
-3
…
8
– [Dean'04]
“Programs written in this functional style are automatically
parallelized and executed on a large cluster of
commodity machines.”
9
Map & Reduce
Map & Reduce
concept
10
Map Operation
map(key1,value1) → list(key2,value2)
Map & Reduce
concept
10
Map Operation
map(key1,value1) → list(key2,value2)
Map & Reduce
concept
for each word:
if word is a noun:
emit („noun“,1)
else if word is a verb:
emit („verb“,1)
10
Reduce Operation
reduce(key2,list(value2)) → list(value2)
Map Operation
map(key1,value1) → list(key2,value2)
Map & Reduce
concept
for each word:
if word is a noun:
emit („noun“,1)
else if word is a verb:
emit („verb“,1)
10
Reduce Operation
reduce(key2,list(value2)) → list(value2)
Map Operation
map(key1,value1) → list(key2,value2)
Map & Reduce
concept
for each word:
if word is a noun:
emit („noun“,1)
else if word is a verb:
emit („verb“,1)
result = 0
for each value2:
result += 1
emit („number of“+key2
+result)
10
Map & Reduce
redefinition for video processing
11
Map & Reduce
redefinition for video processing
11
Map
map(streamin,list(streamside)) → streamout
streamin
Map & Reduce
redefinition for video processing
11
Map
map(streamin,list(streamside)) → streamout
streamin
Map & Reduce
redefinition for video processing
11
Map
map(streamin,list(streamside)) → streamout
streamin
Reduce
reduce(streamin,list(streamside)) → streamout
streamin
Map & Reduce
redefinition for video processing
11
Map
map(streamin,list(streamside)) → streamout
streamin
Reduce
reduce(streamin,list(streamside)) → streamout
streamin
Example
12
Example
Program
12
Example
Program
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
Example
Program
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// setup program and add the operation to it
*prog << moveMap;
Example
Program
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// move detection

auto move = std::make_shared<vmr::Display>(); 

auto moveMap = std::make_shared<vmr::Map>
(source,move,“./move.map“);
// setup program and add the operation to it
*prog << moveMap;
Example
Program
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// move detection

auto move = std::make_shared<vmr::Display>(); 

auto moveMap = std::make_shared<vmr::Map>
(source,move,“./move.map“);
// setup program and add the operation to it
*prog << moveMap;
// run program
prog->run();
Example
Program Operation
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// move detection

auto move = std::make_shared<vmr::Display>(); 

auto moveMap = std::make_shared<vmr::Map>
(source,move,“./move.map“);
// setup program and add the operation to it
*prog << moveMap;
// run program
prog->run();
Example
Program Operation
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// move detection

auto move = std::make_shared<vmr::Display>(); 

auto moveMap = std::make_shared<vmr::Map>
(source,move,“./move.map“);
// setup program and add the operation to it
*prog << moveMap;
// run program
prog->run();
// get position of current pixel
ivec2 pos = vmr_getPosition();
Example
Program Operation
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// move detection

auto move = std::make_shared<vmr::Display>(); 

auto moveMap = std::make_shared<vmr::Map>
(source,move,“./move.map“);
// setup program and add the operation to it
*prog << moveMap;
// run program
prog->run();
// get position of current pixel
ivec2 pos = vmr_getPosition();
// get data from last three frames
vec3 c;
vec3 c1 = vmr_getStreamDataIn(pos, 0);
vec3 c2 = vmr_getStreamDataIn(pos, -1);
vec3 c3 = vmr_getStreamDataIn(pos, -2);
Example
Program Operation
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// move detection

auto move = std::make_shared<vmr::Display>(); 

auto moveMap = std::make_shared<vmr::Map>
(source,move,“./move.map“);
// setup program and add the operation to it
*prog << moveMap;
// run program
prog->run();
// get position of current pixel
ivec2 pos = vmr_getPosition();
// get data from last three frames
vec3 c;
vec3 c1 = vmr_getStreamDataIn(pos, 0);
vec3 c2 = vmr_getStreamDataIn(pos, -1);
vec3 c3 = vmr_getStreamDataIn(pos, -2);
// compute difference
float diff1 = abs(c1.r-c2.r)
+ abs(c1.g-c2.g) + abs(c1.b-c2.b);
float diff2 = abs(c1.r-c3.r)
+ abs(c1.g-c3.g) + abs(c1.b-c3.b);
Example
Program Operation
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// move detection

auto move = std::make_shared<vmr::Display>(); 

auto moveMap = std::make_shared<vmr::Map>
(source,move,“./move.map“);
// setup program and add the operation to it
*prog << moveMap;
// run program
prog->run();
// get position of current pixel
ivec2 pos = vmr_getPosition();
// get data from last three frames
vec3 c;
vec3 c1 = vmr_getStreamDataIn(pos, 0);
vec3 c2 = vmr_getStreamDataIn(pos, -1);
vec3 c3 = vmr_getStreamDataIn(pos, -2);
// compute difference
float diff1 = abs(c1.r-c2.r)
+ abs(c1.g-c2.g) + abs(c1.b-c2.b);
float diff2 = abs(c1.r-c3.r)
+ abs(c1.g-c3.g) + abs(c1.b-c3.b);
// compare with threshold
if (diff1>100 && diff2>100){
c = vec3(255, 255, 255);
} else {
c = vec3(0, 0, 0);
}
Example
Program Operation
12
// init program
auto prog = std::make_shared
<vmr::GlfwProgram >();
auto source = std::make_shared
<vmr:: LibavLoader>("./example.mov");
source->init(3);
// move detection

auto move = std::make_shared<vmr::Display>(); 

auto moveMap = std::make_shared<vmr::Map>
(source,move,“./move.map“);
// setup program and add the operation to it
*prog << moveMap;
// run program
prog->run();
// get position of current pixel
ivec2 pos = vmr_getPosition();
// get data from last three frames
vec3 c;
vec3 c1 = vmr_getStreamDataIn(pos, 0);
vec3 c2 = vmr_getStreamDataIn(pos, -1);
vec3 c3 = vmr_getStreamDataIn(pos, -2);
// compute difference
float diff1 = abs(c1.r-c2.r)
+ abs(c1.g-c2.g) + abs(c1.b-c2.b);
float diff2 = abs(c1.r-c3.r)
+ abs(c1.g-c3.g) + abs(c1.b-c3.b);
// compare with threshold
if (diff1>100 && diff2>100){
c = vec3(255, 255, 255);
} else {
c = vec3(0, 0, 0);
}
// write result to current position
vmr_emitToStreamOut(pos,c);
Performance Evaluation
0 ms
10 ms
20 ms
30 ms
40 ms
SD HD Full HD 4K
map reduce complex
13
0 RLOC
125 RLOC
250 RLOC
375 RLOC
500 RLOC
OpenGL VideoMR
program operation
Improvements & Future Work
14
Improvements & Future Work
14
A general concept for n-dimensional buffers instead of frames
Improvements & Future Work
14
A general concept for n-dimensional buffers instead of frames
Extension with template classes to decide which main data type to use
Improvements & Future Work
14
A general concept for n-dimensional buffers instead of frames
Extension with template classes to decide which main data type to use
Introduction of an explicit CPU operation with transparent memory
management
Improvements & Future Work
14
A general concept for n-dimensional buffers instead of frames
Extension with template classes to decide which main data type to use
Introduction of an explicit CPU operation with transparent memory
management
Considering of OpenCL and CUDA as backend
Improvements & Future Work
14
A general concept for n-dimensional buffers instead of frames
Extension with template classes to decide which main data type to use
Introduction of an explicit CPU operation with transparent memory
management
Considering of OpenCL and CUDA as backend
Comparison with other map and reduce frameworks will be part of future
and therefore, a suitable benchmark has to be developed
Conclusion
15
GPU
Program-
ming
Abstraction
& Usability
Video
Processing
VideoMR fulfills the requirements of
real-time video processing and
supports with the map and
reduce concept the development
of GPU-based filter operations.
Question & Comments
16
Contact:
Benjamin-Heinz Meier/ benjamin-heinz.meier@student.hpi.de
Matthias Trapp / matthias.trapp@hpi.de
Jürgen Döllner / juergen.doellner@hpi.de
Publications: www.4dndvis.de/publikationen.html
This work was funded by the Federal Ministry of Education
and Research (BMBF), Germany within the InnoProfile
Transfer research group "4DnD-Vis".
VideoMR:
A Map and Reduce Framework for
Real-time Video Processing
Benjamin-Heinz Meier, Matthias Trapp, Jürgen Döllner
Hasso Plattner Institute, University of Potsdam, Germany
17
18
PAPER
[Dean'04]
Dean, J. & Ghemawat, S. MapReduce: Simplified Data
Processing on Large Clusters OSDI'04: Sixth Symposium on
Operating System Design and Implementation, 2004
[Tho'11]
Thompson, M.; Farley, D.; Barker, M.; Gee,
P. & Stewart, A. DISRUPTOR: High performance
alternative to bounded queues for exchanging data

More Related Content

PPT
Large Scale Log collection using LogStash & mongoDB
PDF
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
PDF
IBM Monitoring and Diagnostic Tools - GCMV 2.8
PPT
Monitoring using Prometheus and Grafana
PDF
Android RenderScript on LLVM
PDF
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
PDF
What the CRaC - Superfast JVM startup
PDF
100 bugs in Open Source C/C++ projects
Large Scale Log collection using LogStash & mongoDB
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
IBM Monitoring and Diagnostic Tools - GCMV 2.8
Monitoring using Prometheus and Grafana
Android RenderScript on LLVM
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
What the CRaC - Superfast JVM startup
100 bugs in Open Source C/C++ projects

Similar to VideoMR - A Map and Reduce Framework for Real-time Video Processing (20)

PDF
performance optimization: UI
PDF
426 lecture 4: AR Developer Tools
PDF
Java Performance and Profiling
PDF
Advanced kapacitor
PPT
Open Cv 2005 Q4 Tutorial
PPTX
20110220 computer vision_eruhimov_lecture02
PDF
Point cloud mesh-investigation_report-lihang
PDF
Native Java with GraalVM
PDF
Spark Summit EU talk by Francois Garillot and Mohamed Kafsi
PDF
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
PDF
Sparkling Water Meetup
PPTX
Monitoring_with_Prometheus_Grafana_Tutorial
PDF
5 baker oxide (1)
PDF
Adopting GraalVM - Scale by the Bay 2018
PDF
Forge - DevCon 2016: Visual Reporting with Connected Design Data
PDF
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
PDF
Automatic and Interpretable Machine Learning with H2O and LIME
PDF
Integrating Angular js & three.js
PPTX
Kubernetes walkthrough
PDF
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
performance optimization: UI
426 lecture 4: AR Developer Tools
Java Performance and Profiling
Advanced kapacitor
Open Cv 2005 Q4 Tutorial
20110220 computer vision_eruhimov_lecture02
Point cloud mesh-investigation_report-lihang
Native Java with GraalVM
Spark Summit EU talk by Francois Garillot and Mohamed Kafsi
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
Sparkling Water Meetup
Monitoring_with_Prometheus_Grafana_Tutorial
5 baker oxide (1)
Adopting GraalVM - Scale by the Bay 2018
Forge - DevCon 2016: Visual Reporting with Connected Design Data
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
Automatic and Interpretable Machine Learning with H2O and LIME
Integrating Angular js & three.js
Kubernetes walkthrough
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
Ad

More from Matthias Trapp (20)

PDF
Interactive Control over Temporal Consistency while Stylizing Video Streams
PDF
A Framework for Art-directed Augmentation of Human Motion in Videos on Mobile...
PDF
A Framework for Interactive 3D Photo Stylization Techniques on Mobile Devices
PDF
ALIVE-Adaptive Chromaticity for Interactive Low-light Image and Video Enhance...
PDF
A Service-based Preset Recommendation System for Image Stylization Applications
PDF
Design Space of Geometry-based Image Abstraction Techniques with Vectorizatio...
PDF
A Benchmark for the Use of Topic Models for Text Visualization Tasks - Online...
PDF
Efficient GitHub Crawling using the GraphQL API
PDF
CodeCV - Mining Expertise of GitHub Users from Coding Activities - Online.pdf
PDF
Non-Photorealistic Rendering of 3D Point Clouds for Cartographic Visualization
PDF
TWIN4ROAD - Erfassung Analyse und Auswertung mobiler Multi Sensorik im Strass...
PDF
Interactive Close-Up Rendering for Detail+Overview Visualization of 3D Digita...
PDF
Web-based and Mobile Provisioning of Virtual 3D Reconstructions
PDF
Visualization of Knowledge Distribution across Development Teams using 2.5D S...
PDF
Real-time Screen-space Geometry Draping for 3D Digital Terrain Models
PDF
FERMIUM - A Framework for Real-time Procedural Point Cloud Animation & Morphing
PDF
Interactive Editing of Signed Distance Fields
PDF
Integration of Image Processing Techniques into the Unity Game Engine
PDF
Interactive GPU-based Image Deformation for Mobile Devices
PDF
Interactive Photo Editing on Smartphones via Intrinsic Decomposition
Interactive Control over Temporal Consistency while Stylizing Video Streams
A Framework for Art-directed Augmentation of Human Motion in Videos on Mobile...
A Framework for Interactive 3D Photo Stylization Techniques on Mobile Devices
ALIVE-Adaptive Chromaticity for Interactive Low-light Image and Video Enhance...
A Service-based Preset Recommendation System for Image Stylization Applications
Design Space of Geometry-based Image Abstraction Techniques with Vectorizatio...
A Benchmark for the Use of Topic Models for Text Visualization Tasks - Online...
Efficient GitHub Crawling using the GraphQL API
CodeCV - Mining Expertise of GitHub Users from Coding Activities - Online.pdf
Non-Photorealistic Rendering of 3D Point Clouds for Cartographic Visualization
TWIN4ROAD - Erfassung Analyse und Auswertung mobiler Multi Sensorik im Strass...
Interactive Close-Up Rendering for Detail+Overview Visualization of 3D Digita...
Web-based and Mobile Provisioning of Virtual 3D Reconstructions
Visualization of Knowledge Distribution across Development Teams using 2.5D S...
Real-time Screen-space Geometry Draping for 3D Digital Terrain Models
FERMIUM - A Framework for Real-time Procedural Point Cloud Animation & Morphing
Interactive Editing of Signed Distance Fields
Integration of Image Processing Techniques into the Unity Game Engine
Interactive GPU-based Image Deformation for Mobile Devices
Interactive Photo Editing on Smartphones via Intrinsic Decomposition
Ad

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PPTX
A Presentation on Artificial Intelligence
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Machine Learning_overview_presentation.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Building Integrated photovoltaic BIPV_UPV.pdf
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
A Presentation on Artificial Intelligence
Spectral efficient network and resource selection model in 5G networks
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine Learning_overview_presentation.pptx
MYSQL Presentation for SQL database connectivity
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Assigned Numbers - 2025 - Bluetooth® Document
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?

VideoMR - A Map and Reduce Framework for Real-time Video Processing

  • 1. VideoMR: A Map and Reduce Framework for Real-time Video Processing Benjamin-Heinz Meier, Matthias Trapp, Jürgen Döllner Hasso Plattner Institute, University of Potsdam, Germany 1
  • 2. Motivation For our research we were searching for a real-time video processing framework supporting us to develop GPU-based filter operation. 2
  • 3. 3
  • 9. VideoMR bounded memory concept, new definition of operators Map & Reduce transparent memory management using streams 6 GPU Program- ming Abstraction & Usability Video Processing
  • 10. Agenda Memory management using LMAX disruptors as streams The concept of Map & Reduce A redefinition for video processing A small example Performance Evaluation Limitations & Improvements Conclusion 7
  • 11. Memory Management A video is a sequence of frames A stream is a subsequence of the video with a fixed size Implemented using the idea of a disruptor [Tho’11] : using LMAX disruptors as streams time current frame pointer 0 -1 -2 -3 … 8
  • 12. – [Dean'04] “Programs written in this functional style are automatically parallelized and executed on a large cluster of commodity machines.” 9 Map & Reduce
  • 14. Map Operation map(key1,value1) → list(key2,value2) Map & Reduce concept 10
  • 15. Map Operation map(key1,value1) → list(key2,value2) Map & Reduce concept for each word: if word is a noun: emit („noun“,1) else if word is a verb: emit („verb“,1) 10
  • 16. Reduce Operation reduce(key2,list(value2)) → list(value2) Map Operation map(key1,value1) → list(key2,value2) Map & Reduce concept for each word: if word is a noun: emit („noun“,1) else if word is a verb: emit („verb“,1) 10
  • 17. Reduce Operation reduce(key2,list(value2)) → list(value2) Map Operation map(key1,value1) → list(key2,value2) Map & Reduce concept for each word: if word is a noun: emit („noun“,1) else if word is a verb: emit („verb“,1) result = 0 for each value2: result += 1 emit („number of“+key2 +result) 10
  • 18. Map & Reduce redefinition for video processing 11
  • 19. Map & Reduce redefinition for video processing 11 Map map(streamin,list(streamside)) → streamout streamin
  • 20. Map & Reduce redefinition for video processing 11 Map map(streamin,list(streamside)) → streamout streamin
  • 21. Map & Reduce redefinition for video processing 11 Map map(streamin,list(streamside)) → streamout streamin Reduce reduce(streamin,list(streamside)) → streamout streamin
  • 22. Map & Reduce redefinition for video processing 11 Map map(streamin,list(streamside)) → streamout streamin Reduce reduce(streamin,list(streamside)) → streamout streamin
  • 25. Example Program 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3);
  • 26. Example Program 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // setup program and add the operation to it *prog << moveMap;
  • 27. Example Program 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // move detection
 auto move = std::make_shared<vmr::Display>(); 
 auto moveMap = std::make_shared<vmr::Map> (source,move,“./move.map“); // setup program and add the operation to it *prog << moveMap;
  • 28. Example Program 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // move detection
 auto move = std::make_shared<vmr::Display>(); 
 auto moveMap = std::make_shared<vmr::Map> (source,move,“./move.map“); // setup program and add the operation to it *prog << moveMap; // run program prog->run();
  • 29. Example Program Operation 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // move detection
 auto move = std::make_shared<vmr::Display>(); 
 auto moveMap = std::make_shared<vmr::Map> (source,move,“./move.map“); // setup program and add the operation to it *prog << moveMap; // run program prog->run();
  • 30. Example Program Operation 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // move detection
 auto move = std::make_shared<vmr::Display>(); 
 auto moveMap = std::make_shared<vmr::Map> (source,move,“./move.map“); // setup program and add the operation to it *prog << moveMap; // run program prog->run(); // get position of current pixel ivec2 pos = vmr_getPosition();
  • 31. Example Program Operation 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // move detection
 auto move = std::make_shared<vmr::Display>(); 
 auto moveMap = std::make_shared<vmr::Map> (source,move,“./move.map“); // setup program and add the operation to it *prog << moveMap; // run program prog->run(); // get position of current pixel ivec2 pos = vmr_getPosition(); // get data from last three frames vec3 c; vec3 c1 = vmr_getStreamDataIn(pos, 0); vec3 c2 = vmr_getStreamDataIn(pos, -1); vec3 c3 = vmr_getStreamDataIn(pos, -2);
  • 32. Example Program Operation 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // move detection
 auto move = std::make_shared<vmr::Display>(); 
 auto moveMap = std::make_shared<vmr::Map> (source,move,“./move.map“); // setup program and add the operation to it *prog << moveMap; // run program prog->run(); // get position of current pixel ivec2 pos = vmr_getPosition(); // get data from last three frames vec3 c; vec3 c1 = vmr_getStreamDataIn(pos, 0); vec3 c2 = vmr_getStreamDataIn(pos, -1); vec3 c3 = vmr_getStreamDataIn(pos, -2); // compute difference float diff1 = abs(c1.r-c2.r) + abs(c1.g-c2.g) + abs(c1.b-c2.b); float diff2 = abs(c1.r-c3.r) + abs(c1.g-c3.g) + abs(c1.b-c3.b);
  • 33. Example Program Operation 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // move detection
 auto move = std::make_shared<vmr::Display>(); 
 auto moveMap = std::make_shared<vmr::Map> (source,move,“./move.map“); // setup program and add the operation to it *prog << moveMap; // run program prog->run(); // get position of current pixel ivec2 pos = vmr_getPosition(); // get data from last three frames vec3 c; vec3 c1 = vmr_getStreamDataIn(pos, 0); vec3 c2 = vmr_getStreamDataIn(pos, -1); vec3 c3 = vmr_getStreamDataIn(pos, -2); // compute difference float diff1 = abs(c1.r-c2.r) + abs(c1.g-c2.g) + abs(c1.b-c2.b); float diff2 = abs(c1.r-c3.r) + abs(c1.g-c3.g) + abs(c1.b-c3.b); // compare with threshold if (diff1>100 && diff2>100){ c = vec3(255, 255, 255); } else { c = vec3(0, 0, 0); }
  • 34. Example Program Operation 12 // init program auto prog = std::make_shared <vmr::GlfwProgram >(); auto source = std::make_shared <vmr:: LibavLoader>("./example.mov"); source->init(3); // move detection
 auto move = std::make_shared<vmr::Display>(); 
 auto moveMap = std::make_shared<vmr::Map> (source,move,“./move.map“); // setup program and add the operation to it *prog << moveMap; // run program prog->run(); // get position of current pixel ivec2 pos = vmr_getPosition(); // get data from last three frames vec3 c; vec3 c1 = vmr_getStreamDataIn(pos, 0); vec3 c2 = vmr_getStreamDataIn(pos, -1); vec3 c3 = vmr_getStreamDataIn(pos, -2); // compute difference float diff1 = abs(c1.r-c2.r) + abs(c1.g-c2.g) + abs(c1.b-c2.b); float diff2 = abs(c1.r-c3.r) + abs(c1.g-c3.g) + abs(c1.b-c3.b); // compare with threshold if (diff1>100 && diff2>100){ c = vec3(255, 255, 255); } else { c = vec3(0, 0, 0); } // write result to current position vmr_emitToStreamOut(pos,c);
  • 35. Performance Evaluation 0 ms 10 ms 20 ms 30 ms 40 ms SD HD Full HD 4K map reduce complex 13 0 RLOC 125 RLOC 250 RLOC 375 RLOC 500 RLOC OpenGL VideoMR program operation
  • 37. Improvements & Future Work 14 A general concept for n-dimensional buffers instead of frames
  • 38. Improvements & Future Work 14 A general concept for n-dimensional buffers instead of frames Extension with template classes to decide which main data type to use
  • 39. Improvements & Future Work 14 A general concept for n-dimensional buffers instead of frames Extension with template classes to decide which main data type to use Introduction of an explicit CPU operation with transparent memory management
  • 40. Improvements & Future Work 14 A general concept for n-dimensional buffers instead of frames Extension with template classes to decide which main data type to use Introduction of an explicit CPU operation with transparent memory management Considering of OpenCL and CUDA as backend
  • 41. Improvements & Future Work 14 A general concept for n-dimensional buffers instead of frames Extension with template classes to decide which main data type to use Introduction of an explicit CPU operation with transparent memory management Considering of OpenCL and CUDA as backend Comparison with other map and reduce frameworks will be part of future and therefore, a suitable benchmark has to be developed
  • 42. Conclusion 15 GPU Program- ming Abstraction & Usability Video Processing VideoMR fulfills the requirements of real-time video processing and supports with the map and reduce concept the development of GPU-based filter operations.
  • 43. Question & Comments 16 Contact: Benjamin-Heinz Meier/ benjamin-heinz.meier@student.hpi.de Matthias Trapp / matthias.trapp@hpi.de Jürgen Döllner / juergen.doellner@hpi.de Publications: www.4dndvis.de/publikationen.html This work was funded by the Federal Ministry of Education and Research (BMBF), Germany within the InnoProfile Transfer research group "4DnD-Vis".
  • 44. VideoMR: A Map and Reduce Framework for Real-time Video Processing Benjamin-Heinz Meier, Matthias Trapp, Jürgen Döllner Hasso Plattner Institute, University of Potsdam, Germany 17
  • 45. 18 PAPER [Dean'04] Dean, J. & Ghemawat, S. MapReduce: Simplified Data Processing on Large Clusters OSDI'04: Sixth Symposium on Operating System Design and Implementation, 2004 [Tho'11] Thompson, M.; Farley, D.; Barker, M.; Gee, P. & Stewart, A. DISRUPTOR: High performance alternative to bounded queues for exchanging data