File: info.R

package info (click to toggle)
r-cran-av 0.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 324 kB
  • sloc: ansic: 1,353; sh: 83; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#' Video Info
#'
#' Get video info such as width, height, format, duration and framerate.
#' This may also be used for audio input files.
#'
#' @export av_video_info av_media_info
#' @aliases av_video_info av_media_info
#' @name info
#' @param file path to an existing file
#' @useDynLib av R_video_info
#' @family av
av_media_info <- function(file){
  file <- normalizePath(file, mustWork = TRUE)
  out <- .Call(R_video_info, file)
  if(length(out$video))
    out$video <- data.frame(out$video, stringsAsFactors = FALSE)
  if(length(out$audio))
    out$audio <- data.frame(out$audio, stringsAsFactors = FALSE)
  out
}

av_video_info <- av_media_info