congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
MP4VideoDemuxer.getTimescale
Code IndexAdd Tabnine to your IDE (free)

How to use
getTimescale
method
in
us.ihmc.codecs.demuxer.MP4VideoDemuxer

Best Java code snippets using us.ihmc.codecs.demuxer.MP4VideoDemuxer.getTimescale (Showing top 6 results out of 315)

origin: us.ihmc/RobotDataCommunication

private long getVideoTimestamp(long timestamp)
{
 currentlyShowingIndex = Arrays.binarySearch(robotTimestamps, timestamp);
 if (currentlyShowingIndex < 0)
 {
   int nextIndex = -currentlyShowingIndex + 1;
   if ((nextIndex < robotTimestamps.length) && (Math.abs(robotTimestamps[-currentlyShowingIndex] - timestamp) > Math.abs(robotTimestamps[nextIndex])))
   {
    currentlyShowingIndex = nextIndex;
   }
   else
   {
    currentlyShowingIndex = -currentlyShowingIndex;
   }
 }
 if (currentlyShowingIndex < 0)
   currentlyShowingIndex = 0;
 if (currentlyShowingIndex >= robotTimestamps.length)
   currentlyShowingIndex = robotTimestamps.length - 1;
 currentlyShowingRobottimestamp = robotTimestamps[currentlyShowingIndex];
 long videoTimestamp = videoTimestamps[currentlyShowingIndex];
 if (hasTimebase)
 {
   videoTimestamp = (videoTimestamp * bmdTimeBaseNum * demuxer.getTimescale()) / (bmdTimeBaseDen);
 }
 return videoTimestamp;
}
origin: us.ihmc/ihmc-robot-data-visualizer

private long getVideoTimestamp(long timestamp)
{
 currentlyShowingIndex = Arrays.binarySearch(robotTimestamps, timestamp);
 if (currentlyShowingIndex < 0)
 {
   int nextIndex = -currentlyShowingIndex + 1;
   if ((nextIndex < robotTimestamps.length) && (Math.abs(robotTimestamps[-currentlyShowingIndex] - timestamp) > Math.abs(robotTimestamps[nextIndex])))
   {
    currentlyShowingIndex = nextIndex;
   }
   else
   {
    currentlyShowingIndex = -currentlyShowingIndex;
   }
 }
 if (currentlyShowingIndex < 0)
   currentlyShowingIndex = 0;
 if (currentlyShowingIndex >= robotTimestamps.length)
   currentlyShowingIndex = robotTimestamps.length - 1;
 currentlyShowingRobottimestamp = robotTimestamps[currentlyShowingIndex];
 long videoTimestamp = videoTimestamps[currentlyShowingIndex];
 if (hasTimebase)
 {
   videoTimestamp = (videoTimestamp * bmdTimeBaseNum * demuxer.getTimescale()) / (bmdTimeBaseDen);
 }
 return videoTimestamp;
}
origin: us.ihmc/IHMCRobotDataVisualizer

private long getVideoTimestamp(long timestamp)
{
 currentlyShowingIndex = Arrays.binarySearch(robotTimestamps, timestamp);
 if (currentlyShowingIndex < 0)
 {
   int nextIndex = -currentlyShowingIndex + 1;
   if ((nextIndex < robotTimestamps.length) && (Math.abs(robotTimestamps[-currentlyShowingIndex] - timestamp) > Math.abs(robotTimestamps[nextIndex])))
   {
    currentlyShowingIndex = nextIndex;
   }
   else
   {
    currentlyShowingIndex = -currentlyShowingIndex;
   }
 }
 if (currentlyShowingIndex < 0)
   currentlyShowingIndex = 0;
 if (currentlyShowingIndex >= robotTimestamps.length)
   currentlyShowingIndex = robotTimestamps.length - 1;
 currentlyShowingRobottimestamp = robotTimestamps[currentlyShowingIndex];
 long videoTimestamp = videoTimestamps[currentlyShowingIndex];
 if (hasTimebase)
 {
   videoTimestamp = (videoTimestamp * bmdTimeBaseNum * demuxer.getTimescale()) / (bmdTimeBaseDen);
 }
 return videoTimestamp;
}
origin: us.ihmc/RobotDataCommunication

private static int getFrameRate(MP4VideoDemuxer demuxer) throws IOException
{
 demuxer.seekToFrame(0);
 long startPts = demuxer.getCurrentPTS();
 demuxer.seekToFrame(1);
 long endPts = demuxer.getCurrentPTS();      
 
 double step = endPts - startPts;
 int rate = (int)Math.round((double)demuxer.getTimescale() / step);
 
 System.out.println("Framerate is " + rate);
 return rate;
 }
origin: us.ihmc/ihmc-robot-data-visualizer

private static int getFrameRate(MP4VideoDemuxer demuxer) throws IOException
{
 demuxer.seekToFrame(0);
 long startPts = demuxer.getCurrentPTS();
 demuxer.seekToFrame(1);
 long endPts = demuxer.getCurrentPTS();      
 
 double step = endPts - startPts;
 int rate = (int)Math.round((double)demuxer.getTimescale() / step);
 
 System.out.println("Framerate is " + rate);
 return rate;
 }
origin: us.ihmc/IHMCRobotDataLogger

private static int getFrameRate(MP4VideoDemuxer demuxer) throws IOException
{
 demuxer.seekToFrame(0);
 long startPts = demuxer.getCurrentPTS();
 demuxer.seekToFrame(1);
 long endPts = demuxer.getCurrentPTS();      
 
 double step = endPts - startPts;
 int rate = (int)Math.round((double)demuxer.getTimescale() / step);
 
 System.out.println("Framerate is " + rate);
 return rate;
 }
us.ihmc.codecs.demuxerMP4VideoDemuxergetTimescale

Popular methods of MP4VideoDemuxer

  • <init>
    Create a new demuxer
  • getNextFrame
    Return the next frame in the video
  • getHeight
  • getWidth
  • delete
    Delete native resources held by the demuxer
  • seekToFrame
    Seek to frame. Next call to nextFrame will return frameNo
  • seekToPTS
    Seek to PTS. Next call to nextFrame will return frame at given PTS
  • getCurrentFrame
  • getCurrentPTS
  • getNextPacket
  • decodeLeadingFrames
  • getPreviousKeyFrame
  • decodeLeadingFrames,
  • getPreviousKeyFrame,
  • seek

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • JPanel (javax.swing)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now