No More Video Loss
Alex Rivkin
The camera doesn’t lie.
I think the video and the millions of people who
saw it, certainly put pressure on the
prosecutors to take some actions
Geoffrey Phillip Alpert - Professor of criminology
Agenda
• Android wearable camera requirements
• Video architecture camera 2
• Android video layers
• Our solution for keeping recorded process safe in abnormal situation
Wearable Camera
● Based on Android N
● Removable battery for
10 hours
● Increased storage - 64
GB
● Camera resolution FHD
● Small display for
recorded video preview
● Continuous video cashing
of last 30 seconds
● Automatic contextual
activation of video recording
based on sensors.
● Uploading video files to
backend at end of shift
Old architecture Camera 1
● Designed as a black box
● Three operating modes:
1. Preview
2. Video Record
3. Still Capture
● Hard to implement new features
● API of camera 1 are not supported after Android 7
New architecture Camera 2
● Camera subsystem as a pipeline
● Converts each capture request into one image captured by the camera
sensor
● A request contains all desired capture settings and the list of output
surfaces to push image buffers into for this request
setRepeatingRequest()
API Camera 2
SurfaceTexture
Android Video Layers
Application
Camera
Device
Camera
Manager
Capture
Session
Camera
Service
Camera
Provider
Camera3Device
Video HAL Hardware
Composer
SurfaceView
Surface
MediaCodec
Surface
MediaMuxer
MPEG4WriterSurfaceFlinger
SurfaceTexture
EglSurface
AudioRecord
AudioFlinger
Audio HAL
Media Framework
OpenMax-based MMF
V4L2 driver
Stagefright
ALSA
MIC SPKRDISPLAYCamera VFE/CPP CODEC
FrameBuffer
Driver
V4L2 driver
Circle queue
Control flow
Raw video
YUV:4.2.0
Raw audio
PCM 16000
Encoded video
H264
Encoded audio
audio/mp4
Preview
ISP
Video Recording Problem
● Android OS writes metadata of MP4 file only at end of recording
● Any failure during video recording like battery pull out will cause to MP4 file
corruption.
● The file will be not playable.
Solution ….. make mp4 streamable !!!!
Before change After change
THANK YOU
Motorola Solutions Confidential Restricted

No more video loss - Alex Rivkin, Motorola Solutions

  • 1.
    No More VideoLoss Alex Rivkin
  • 2.
    The camera doesn’tlie. I think the video and the millions of people who saw it, certainly put pressure on the prosecutors to take some actions Geoffrey Phillip Alpert - Professor of criminology
  • 3.
    Agenda • Android wearablecamera requirements • Video architecture camera 2 • Android video layers • Our solution for keeping recorded process safe in abnormal situation
  • 4.
    Wearable Camera ● Basedon Android N ● Removable battery for 10 hours ● Increased storage - 64 GB ● Camera resolution FHD ● Small display for recorded video preview ● Continuous video cashing of last 30 seconds ● Automatic contextual activation of video recording based on sensors. ● Uploading video files to backend at end of shift
  • 5.
    Old architecture Camera1 ● Designed as a black box ● Three operating modes: 1. Preview 2. Video Record 3. Still Capture ● Hard to implement new features ● API of camera 1 are not supported after Android 7
  • 6.
    New architecture Camera2 ● Camera subsystem as a pipeline ● Converts each capture request into one image captured by the camera sensor ● A request contains all desired capture settings and the list of output surfaces to push image buffers into for this request
  • 7.
  • 8.
    SurfaceTexture Android Video Layers Application Camera Device Camera Manager Capture Session Camera Service Camera Provider Camera3Device VideoHAL Hardware Composer SurfaceView Surface MediaCodec Surface MediaMuxer MPEG4WriterSurfaceFlinger SurfaceTexture EglSurface AudioRecord AudioFlinger Audio HAL Media Framework OpenMax-based MMF V4L2 driver Stagefright ALSA MIC SPKRDISPLAYCamera VFE/CPP CODEC FrameBuffer Driver V4L2 driver Circle queue Control flow Raw video YUV:4.2.0 Raw audio PCM 16000 Encoded video H264 Encoded audio audio/mp4 Preview ISP
  • 9.
    Video Recording Problem ●Android OS writes metadata of MP4 file only at end of recording ● Any failure during video recording like battery pull out will cause to MP4 file corruption. ● The file will be not playable.
  • 11.
    Solution ….. makemp4 streamable !!!! Before change After change
  • 12.
    THANK YOU Motorola SolutionsConfidential Restricted