Package org.opensourcephysics.media.mov
Class MovieVideo
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.media.core.VideoAdapter
org.opensourcephysics.media.mov.MovieVideo
- All Implemented Interfaces:
PropertyChangeListener,EventListener,Drawable,Interactive,Measurable,DrawableImage,InteractiveImage,Trackable,Video
- Direct Known Subclasses:
JSMovieVideo,XuggleVideo
An abstract class that describes common aspects of VideoAdapters that involve
actual digital video sources such as MP4 (JSMovieVideo and XuggleVideo).
(formerly MovieVideoI interface)
- Author:
- hansonr
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanset true to read control data start_times, duration (for rawDuration), and frame_count; false to instead scan video againprotected XMLControlthe originating video XMLControlElement, if it existsprotected Stringprotected doubleprotected doubleThese are temporary only, during loading.protected booleanprotected booleanprotected booleanprotected intnominal rounded frame rate -- 24, 25, 30, 50, 60...; used only for offset to center of framesprotected Stringprotected static final Stringstatic final Stringstatic final Stringprotected doublethe duration reported by the video, possibly longer for Xuggle than this.getDuration(); in secondsprotected intframe count by this engine's calculation; may be different from frameCount, which could be coming from another creator via a video XMLControlElementprotected static final doubleprotected URLFields inherited from class org.opensourcephysics.media.core.VideoAdapter
aspects, baseDir, bufferedImage, clearRaster, coords, displayedSize, endFrameNumber, filteredImage, filterStack, frameCount, frameNumber, isMeasured, isValidFilteredImage, isValidImage, isValidMeasure, looping, maxX, maxY, minX, minY, mouseEnabled, playing, properties, rate, rawImage, size, startFrameNumber, startTimesMS, visible, widthDominatesFields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTINGFields inherited from interface org.opensourcephysics.media.core.Video
PROPERTY_VIDEO_COORDS, PROPERTY_VIDEO_ENDFRAME, PROPERTY_VIDEO_FILTERCHANGED, PROPERTY_VIDEO_FRAMENUMBER, PROPERTY_VIDEO_IMAGE, PROPERTY_VIDEO_LOOPING, PROPERTY_VIDEO_NEXTFRAME, PROPERTY_VIDEO_PLAYING, PROPERTY_VIDEO_RATE, PROPERTY_VIDEO_SIZE, PROPERTY_VIDEO_VIDEOVISIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidprotected intgetFrameNumberBefore(double time) Gets the number of the last frame before the specified time.protected abstract BufferedImagegetImageForMSTimePoint(double timeSec) protected abstract StringGet this platform's nameprotected abstract booleanseekMS(double timeMS) seek to a time in milliseconds.protected XMLControlsetFromControl(XMLControl control) Set frameCount, startTimes, and rawDuration if available from the control.protected StringsetFromMediaTrackInfo(Map<String, Object> info) JavaScript only -- use MediaInfo for rate informationprotected voidMethods inherited from class org.opensourcephysics.media.core.VideoAdapter
back, dispose, draw, finalize, findInteractive, findMinMaxValues, getAbsolutePath, getAngle, getCoords, getEndFrameNumber, getEndTime, getFilterStack, getFrameCount, getFrameDuration, getFrameNumber, getFrameTime, getHeight, getImage, getImageSize, getProperty, getPropertyNames, getRate, getRawBufferedImage, getRelativeAspect, getStartFrameNumber, getStartTime, getWidth, getX, getXMax, getXMin, getY, getYMax, getYMin, goToEnd, goToStart, initialize, invalidateVideoAndFilter, isEnabled, isLooping, isMeasured, isPlaying, isVisible, notifyFrame, notifySize, propertyChange, refreshBufferedImage, reset, setAngle, setCoords, setEnabled, setEndFrameNumber, setEndTime, setFilterStack, setFrameAngle, setFrameCount, setFrameHeight, setFrameNumber, setFrameRelativeAspect, setFrameWidth, setFrameX, setFrameXY, setFrameY, setHeight, setLooping, setNotify, setPlaying, setProperty, setRate, setRelativeAspect, setStartFrameNumber, setStartTime, setVisible, setWidth, setX, setXY, setY, step, updateBufferedImageMethods inherited from class org.opensourcephysics.display.OSPRuntime.Supported
addListeners, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenerSafely, dispose, firePropertyChange, firePropertyChange, removeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Interactive
isInteractiveMethods inherited from interface org.opensourcephysics.media.core.Video
addListener, addPropertyChangeListener, addPropertyChangeListener, getAverageFrameDuration, getAverageFrameRate, getFrameCountDurationMS, getOutliers, getTypeName, isValid, play, removeListener, removePropertyChangeListener, removePropertyChangeListener, stop
-
Field Details
-
PROPERTY_VIDEO_PROGRESS
- See Also:
-
PROPERTY_VIDEO_STALLED
- See Also:
-
PLATFORM_JAVA
- See Also:
-
TIME_SLOP_MS
protected static final double TIME_SLOP_MS- See Also:
-
fileName
-
url
-
frameTimes
These are temporary only, during loading. see startTimes -
allowControlData
protected boolean allowControlDataset true to read control data start_times, duration (for rawDuration), and frame_count; false to instead scan video again -
rawDuration
protected double rawDurationthe duration reported by the video, possibly longer for Xuggle than this.getDuration(); in seconds -
nominalFrameRate
protected int nominalFrameRatenominal rounded frame rate -- 24, 25, 30, 50, 60...; used only for offset to center of frames -
path
-
isLocal
protected boolean isLocal -
isExport
protected boolean isExport -
rawFrameCount
protected int rawFrameCountframe count by this engine's calculation; may be different from frameCount, which could be coming from another creator via a video XMLControlElement -
control
the originating video XMLControlElement, if it exists -
isVariableFrameRate
protected boolean isVariableFrameRate -
frameRateMinimum
protected double frameRateMinimum -
frameRateMaximum
protected double frameRateMaximum
-
-
Constructor Details
-
MovieVideo
- Throws:
IOException
-
-
Method Details
-
getPlatform
Get this platform's name- Returns:
- "Java" or navigator.userAgent
-
seekMS
protected abstract boolean seekMS(double timeMS) seek to a time in milliseconds.- Parameters:
timeMS-- Returns:
-
finalizeLoading
- Throws:
IOException
-
getImageForMSTimePoint
-
setStartTimes
protected void setStartTimes()- Specified by:
setStartTimesin classVideoAdapter
-
getFrameNumberBefore
protected int getFrameNumberBefore(double time) Gets the number of the last frame before the specified time. a 0.1-ms slop is added- Parameters:
time- the time in milliseconds- Returns:
- the frame number, or -1 if not found
-
setFromControl
Set frameCount, startTimes, and rawDuration if available from the control. Ignore if the saved platform string is "Java" and- Parameters:
control-- Returns:
- null if cannot be set (older versions)
-
setFromMediaTrackInfo
JavaScript only -- use MediaInfo for rate information- Parameters:
info-- Returns:
- error string or null if no error
-