e-lab / torch-toolbox

A collection of snippets and libraries for Torch from e-Lab
https://engineering.purdue.edu/elab/
199 stars 64 forks source link

Length of video using `libvideo-decoder` #20

Closed codeAC29 closed 7 years ago

codeAC29 commented 7 years ago

What can be a possible reason to get nil value for length of a video after calling libvideo-decoder like this?

jhjin commented 7 years ago

Some of videos do not have their length in the header. I guess also videos in streaming format can have no length in the header.

mvitez commented 7 years ago

Video-decoder did not return the total number of frames, because this information was not present. It can be calculated, though, if the video length and fps are present, which is true in your case. I have committed a new version with this fix.