self.n_channels set to zero after loading
0wu opened this issue · comments
Tingfan Wu commented
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.