本文整理了Java中org.openimaj.video.Video.countFrames()
方法的一些代码示例,展示了Video.countFrames()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Video.countFrames()
方法的具体详情如下:
包路径:org.openimaj.video.Video
类名称:Video
方法名:countFrames
[英]Return the number of frames in the whole video. If the video is a live stream, then this method should return -1.
[中]返回整个视频中的帧数。如果视频是实时流,那么这个方法应该返回-1。
代码示例来源:origin: openimaj/openimaj
@Override
public long countFrames()
{
return video.countFrames();
}
代码示例来源:origin: org.openimaj/core-video
@Override
public long countFrames()
{
return video.countFrames();
}
代码示例来源:origin: org.openimaj/core-video
/**
* {@inheritDoc}
*
* @see org.openimaj.video.Video#hasNextFrame()
*/
@Override
public long countFrames()
{
if (this.video == null)
throw new UnsupportedOperationException("Chain method called on non-chainable processor");
return this.video.countFrames();
}
代码示例来源:origin: openimaj/openimaj
/**
* {@inheritDoc}
*
* @see org.openimaj.video.Video#hasNextFrame()
*/
@Override
public long countFrames()
{
if (this.video == null)
throw new UnsupportedOperationException("Chain method called on non-chainable processor");
return this.video.countFrames();
}
代码示例来源:origin: openimaj/openimaj
/**
* Change the video that is being displayed by this video display.
*
* @param newVideo
* The new video to display.
*/
public void changeVideo(final Video<T> newVideo) {
this.video = newVideo;
this.timeKeeper = new BasicVideoTimeKeeper(newVideo.countFrames() == -1);
}
代码示例来源:origin: org.openimaj/core-video
/**
* Change the video that is being displayed by this video display.
*
* @param newVideo
* The new video to display.
*/
public void changeVideo(final Video<T> newVideo) {
this.video = newVideo;
this.timeKeeper = new BasicVideoTimeKeeper(newVideo.countFrames() == -1);
}
代码示例来源:origin: openimaj/openimaj
/**
*
* @param data
*/
protected VideoBarVisualisation(final Video<MBFImage> video) {
this.data = video;
this.nFrames = this.data.countFrames();
this.setPreferredSize(new Dimension(1, 120 + (this.showAudio ? this.audioHeight : 0)));
}
代码示例来源:origin: openimaj/openimaj
/**
* Returns the position of the play head in this video as a percentage of
* the length of the video. IF the video is a live video, this method will
* always return 0;
*
* @return The percentage through the video.
*/
public double getPosition() {
final long nFrames = this.video.countFrames();
if (nFrames == -1)
return 0;
return this.video.getCurrentFrameIndex() * 100d / nFrames;
}
代码示例来源:origin: org.openimaj/core-video
/**
* Returns the position of the play head in this video as a percentage of
* the length of the video. IF the video is a live video, this method will
* always return 0;
*
* @return The percentage through the video.
*/
public double getPosition() {
final long nFrames = this.video.countFrames();
if (nFrames == -1)
return 0;
return this.video.getCurrentFrameIndex() * 100d / nFrames;
}
代码示例来源:origin: openimaj/openimaj
/**
* Set the position of the play head to the given percentage. If the video
* is a live video this method will have no effect.
*
* @param pc
* The percentage to set the play head to.
*/
public void setPosition(final double pc) {
if (pc > 100 || pc < 0)
throw new IllegalArgumentException("Percentage must be less than " +
"or equals to 100 and greater than or equal 0. Given " + pc);
// If it's a live video we cannot do anything
if (this.video.countFrames() == -1)
return;
// We have to seek to a millisecond position, so we find out the length
// of the video in ms and then multiply by the percentage
final double nMillis = this.video.countFrames() * this.video.getFPS();
final long msPos = (long) (nMillis * pc / 100d);
System.out.println("msPOs = " + msPos + " (" + pc + "%)");
this.seek(msPos);
}
代码示例来源:origin: org.openimaj/core-video
/**
* Set the position of the play head to the given percentage. If the video
* is a live video this method will have no effect.
*
* @param pc
* The percentage to set the play head to.
*/
public void setPosition(final double pc) {
if (pc > 100 || pc < 0)
throw new IllegalArgumentException("Percentage must be less than " +
"or equals to 100 and greater than or equal 0. Given " + pc);
// If it's a live video we cannot do anything
if (this.video.countFrames() == -1)
return;
// We have to seek to a millisecond position, so we find out the length
// of the video in ms and then multiply by the percentage
final double nMillis = this.video.countFrames() * this.video.getFPS();
final long msPos = (long) (nMillis * pc / 100d);
System.out.println("msPOs = " + msPos + " (" + pc + "%)");
this.seek(msPos);
}
代码示例来源:origin: org.openimaj/core-video
/**
* Construct a video display with the given video and audio
*
* @param v
* The video
* @param a
* The audio
* @param screen
* The frame to draw into.
*/
public VideoDisplay(final Video<T> v, final AudioStream a, final ImageComponent screen) {
this.video = v;
// If we're given audio, we create an audio player that will also
// act as our synchronisation time keeper.
if (a != null) {
this.audioPlayer = new AudioPlayer(a);
this.timeKeeper = this.audioPlayer;
}
// If no audio is provided, we'll use a basic time keeper
else
this.timeKeeper = new BasicVideoTimeKeeper(this.video.countFrames() == -1);
this.screen = screen;
this.videoDisplayListeners = new ArrayList<VideoDisplayListener<T>>();
this.stateListeners = new ArrayList<VideoDisplayStateListener>();
this.positionListeners = new ArrayList<VideoPositionListener>();
}
代码示例来源:origin: openimaj/openimaj
/**
* Construct a video display with the given video and audio
*
* @param v
* The video
* @param a
* The audio
* @param screen
* The frame to draw into.
*/
public VideoDisplay(final Video<T> v, final AudioStream a, final ImageComponent screen) {
this.video = v;
// If we're given audio, we create an audio player that will also
// act as our synchronisation time keeper.
if (a != null) {
this.audioPlayer = new AudioPlayer(a);
this.timeKeeper = this.audioPlayer;
}
// If no audio is provided, we'll use a basic time keeper
else
this.timeKeeper = new BasicVideoTimeKeeper(this.video.countFrames() == -1);
this.screen = screen;
this.videoDisplayListeners = new ArrayList<VideoDisplayListener<T>>();
this.stateListeners = new ArrayList<VideoDisplayStateListener>();
this.positionListeners = new ArrayList<VideoPositionListener>();
}
代码示例来源:origin: org.openimaj/core-video
if (this.video.countFrames() != -1 && this.currentFrame != null) {
final long t = this.timeKeeper.getTime().getTimecodeInMilliseconds();
代码示例来源:origin: openimaj/openimaj
if (this.video.countFrames() != -1 && this.currentFrame != null) {
final long t = this.timeKeeper.getTime().getTimecodeInMilliseconds();
代码示例来源:origin: openimaj/openimaj
nFrames = video.countFrames();
代码示例来源:origin: org.openimaj/sandbox
nFrames = video.countFrames();
内容来源于网络,如有侵权,请联系作者删除!