clementfarabet / lua---ffmpeg

An interface between ffmpeg and Lua/Torch
21 stars 17 forks source link

Misunderstanding #4

Closed Atcold closed 11 years ago

Atcold commented 11 years ago
t7> ffmpeg.Video()
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Video

loads a video into a table of tensors:
 + relies on ffpmeg, which must be installed
 + creates a local scratch/ to store temp frames on disk

> usage:
Video{
    [path = string]                     -- path to video
    [width = number]                    -- width  [default = 320]
    [height = number]                   -- height  [default = 240]
    [fps = number]                      -- frames per second  [default = 10]
    [length = number]                   -- length, in seconds  [default = 10]
    [seek = number]                     -- seek to pos. in seconds  [default = 0]
    [channel = number]                  -- video channel  [default = 0]
    [load = boolean]                    -- loads frames after conversion  [default = true]
    [delete = boolean]                  -- clears (rm) frames after load  [default = true]
    [encoding = string]                 -- format of dumped frames  [default = png]
    [tensor = torch.Tensor]             -- provide a packed tensor (NxCxHxW or NxHxW), that bypasses path
}

Video{width=number, path=string}
Video(string, ...)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If the fps = 10 and length = 10s, therefore there could be only 100 photograms? How does this work?

Thanks

Atcold commented 11 years ago

Well, there is also a nframes varialbe... Therefore shouldn't be length = nframes / fps? I feel confused... :confused:

Atcold commented 11 years ago

Got it. length is the time ffmpeg watches the video from the seek point.