2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

26
22-03-21 Martin Bisson 1 Stereoscopic video and GStreamer By Martin Bisson

Transcript of 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Page 1: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

23-04-19 Martin Bisson 1

Stereoscopic video and GStreamer

By Martin Bisson

Page 2: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Presentation outline

IntroductionUse casesImplementationRoad ahead

23-04-19 Martin Bisson 2

Page 3: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Presentation outline

IntroductionUse casesImplementationRoad ahead

23-04-19 Martin Bisson 3

Page 4: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Stereoscopy

23-04-19 Martin Bisson 4

Page 5: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Recent popularity

3D-ready hardware

3D moviesAvatar => ~2.8 billion USD

23-04-19 Martin Bisson 5

Page 6: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Presentation outline

IntroductionUse casesImplementationRoad ahead

23-04-19 Martin Bisson 6

Page 7: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Use cases

1) Merge 2 video streams into a stereo stream

2) Convert a (double) video stream into a stereo stream

23-04-19 Martin Bisson 7

Page 8: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Use cases

3) Convert a stereo stream into a « regular » video streamCan be displayed or encoded by normal plugins

4) Generate an anaglyph video stream from a stereo stream

5) Output a stereo stream on various 3D display hardware

23-04-19 Martin Bisson 8

Page 9: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Presentation outline

IntroductionUse casesImplementationRoad ahead

23-04-19 Martin Bisson 9

Page 10: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Implementation

What is a « stereo stream »?Buffer flags?New caps

video/x-raw-{rgb,yuv,gray}-stereolayout = { 1122 , 1212 }fourcc = { YUY2, YVYU, UYVY , Y800 , GREY , Y8 , Y16 }

23-04-19 Martin Bisson 10

Page 11: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Memory layout

23-04-19 Martin Bisson 11

1122Memory-consecutive

1212Row-interleaved

Page 12: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Supported formats

Only packed, no planarRGB : RGBx, xRGB, BGRx, xBGR, RGB,

BGR, RGB_16, RGB_15YUV : YUY2, YVYU, UYVY, Y800,

GREY, Y8, Y16GRAY : GRAY8, GRAY16

23-04-19 Martin Bisson 12

Page 13: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Plugins

video3dmergeGstCollectPadsmode : memory-consecutive or row-interleaved

23-04-19 Martin Bisson 13

Page 14: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Plugins

video3dconvertGstVideoFiltermode : left-right or top-bottom

23-04-19 Martin Bisson 14

Page 15: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Plugins

video3dpresentGstVideoFiltermode : a lot of them…

23-04-19 Martin Bisson 15

Page 16: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

video3dpresent modes

Left, RightLeft/Right, Right/Left, Top/Bottom, Bottom/TopAnaglyph

Gray/Gray, Gray/Color, Color/Gray, Color/ColorRed/Cyan, Green/Magenta, Blue/Yellow, and vice-versa

23-04-19 Martin Bisson 16

Page 17: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Anaglyph implementation

« C templates »Inspired by ffmpegcolorspace (imgconvert.c)

Orc optimizationOnly RGBx/BGRx/xRGB/xBGR output formatsYUY2/YVYU/UYVY/Y800/GREY/Y8/Y16 input

formats for gray-gray anaglyphRGBx/BGRx/xRGB/xBGR input formats for all

anaglyph types

23-04-19 Martin Bisson 17

Page 18: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

23-04-19 Martin Bisson 18

Page 19: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Example application

23-04-19 Martin Bisson 19

Page 20: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Presentation outline

IntroductionUse casesImplementationRoad ahead

23-04-19 Martin Bisson 20

Page 21: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Integration

Not in main GStreamer tree (in a branch at http://www.gitorious.org/video3d/video3d/)

Talks about how to handle stereo video:Buffer flagsMetadataNew caps

23-04-19 Martin Bisson 21

Page 22: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Integration

New caps (video/x-raw-*-stereo)Caps negotiation and all that jazz…

Buffer flags/metadataBuffers can be used in existing plugins

23-04-19 Martin Bisson 22

Page 23: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Integration

23-04-19 Martin Bisson 23

Page 24: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

3D hardware

Implement stereo sinksNVIDIA 3D VisionQuad Buffered OpenGLiZ3DEtc…

See Stereoscopic Player (http://www.3dtv.at/)

23-04-19 Martin Bisson 24

Page 25: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

Stereo codecs

Multiview Video Coding (H.264/MPEG-4 AVC)Uses temporal AND inter-view predictionExisting implementation by Nokia

http://research.nokia.com/page/4988

23-04-19 Martin Bisson 25

Page 26: 2015-07-02Martin Bisson1 Stereoscopic video and GStreamer By Martin Bisson.

23-04-19 Martin Bisson 26

Questions?