lua---ffmpeg icon indicating copy to clipboard operation
lua---ffmpeg copied to clipboard

self.n_channels set to zero after loading

Open 0wu opened this issue 10 years ago • 0 comments

I am not sure if this is an issue or my misusage but I am going to report it anyways.

The following usage loads a video, but at the end of the constructor vid.n_channels is set to 0 by vid:clear()

require 'ffmpeg'

vid = ffmpeg.Video('office20150910.mp4')
print(vid.n_channels) --- prints 0

due to the fact vid.n_channels=0, the following functions won't work.

print(vid:forward()) -- returns {}
vid:save('test.avi')  -- generate empty test.avi

but if I manually set n_channels back to 1, everything work as expected.

vid = ffmpeg.Video('office20150910.mp4')
vid.n_channels = 1
print(#(vid:forward()))  -- this one return a 3d tensor of the frame.

0wu avatar Sep 16 '15 02:09 0wu