public int getSegmentsCount() {
      if (segmentsBuilder_ == null) {
        return segments_.size();
      } else {
        return segmentsBuilder_.getCount();
      }
    }
<pre>
Video segments to annotate. The segments may overlap and are not required
to be contiguous or span the whole video. If unspecified, each video is
treated as a single segment.
</pre>

<code>repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1;</code>
java-video-intelligence/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContext.java