org.mbari.beholder

Members list

Type members

Classlikes

object AppConfig

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
AppConfig.type
object CachedImage

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class CachedImage(videoUri: URI, elapsedTime: Duration, path: Path, created: Instant = ..., sizeBytes: Option[Long] = ..., imageType: ImageType = ..., deinterlace: Boolean = ...)

Information about the source of a JPEG

Information about the source of a JPEG

Value parameters

created

When the jpeg was created. Used by the cache to determine which items to drop.

deinterlace

Whether a deinterlacer was actually run over this frame. This is the effective flag, not what the request asked for: a progressive video captured with deinterlace=true is stored here as false, because the pixels are identical to an ordinary capture and there is nothing to be gained by holding two copies of them.

elapsedTime

The elapsed time into the video that the jpeg was taken

path

The local path to the jpeg file

sizeBytes

The size of the jpeg file in bytes

videoUri

The URL to the source video

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait ImageCache

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ImageCacheImpl(val root: Path, maxCacheSizeMB: Double, cacheClearPct: Double = ...) extends ImageCache

Disk-backed image frame cache. Frames are indexed by (videoUri, elapsedTime) for O(1) lookups and evicted oldest-first when total on-disk size exceeds maxCacheSizeMB.

Disk-backed image frame cache. Frames are indexed by (videoUri, elapsedTime) for O(1) lookups and evicted oldest-first when total on-disk size exceeds maxCacheSizeMB.

Improvements over JpegCache:

  • O(1) lookup via nested ConcurrentHashMap (URI → elapsedMs → Jpeg) instead of O(n) TreeSet.find
  • O(log n) eviction via ConcurrentSkipListSet ordered by creation time; pollFirst() is atomic
  • AtomicLong byte counter avoids floating-point drift from summing MB values
  • AtomicBoolean eviction guard prevents concurrent eviction storms without a global lock
  • scanCache preserves real file creation timestamps for correct age-ordering on restart

Value parameters

cacheClearPct

Fraction of current cache size to free when the limit is exceeded (0 < x <= 1)

maxCacheSizeMB

Maximum allowed on-disk cache size in MB

root

Root directory for cached JPEG files

Attributes

Supertypes
trait ImageCache
class Object
trait Matchable
class Any
object ImageCapture

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class ImageCapture(cache: ImageCache, grabFrameFrom: FrameGrabber = ..., ffprobe: Ffprobe = ...)

Value parameters

cache

Where captured frames are stored and looked up

ffprobe

Used to decide whether a video is worth deinterlacing. Defaults to the same cached instance FfmpegUtil probes with, so asking here costs nothing that the capture was not about to pay anyway.

grabFrameFrom

Does the actual capture

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ImageType

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
ImageType.type
enum ImageType(val extension: String, val mediaType: String, val evictionOrder: Int)

The image type. Used to determine the image type of a cached image.

The image type. Used to determine the image type of a cached image.

Value parameters

evictionOrder

The order in which the image type is evicted from the cache. Lower values are evicted first.

extension

The extension for the image type (e.g. ".jpg", ".png")

mediaType

The media type (e.g. "image/jpeg", "image/png")

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Main

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Main.type
class MainRunner extends Callable[Int]

Attributes

Supertypes
trait Callable[Int]
class Object
trait Matchable
class Any

Types

type FrameGrabber = (URI, Duration, Path, Boolean, Boolean, Boolean) => Either[Throwable, Path]

How a single frame is pulled out of a video: (videoUri, elapsedTime, target, accurate, skipNonKeyFrames, deinterlace).

How a single frame is pulled out of a video: (videoUri, elapsedTime, target, accurate, skipNonKeyFrames, deinterlace).

Injectable so that ImageCapture can be exercised without paying for a real ffmpeg run, in the same spirit as FfprobeService taking its delegate.

Attributes