Closed a-lohia closed 1 year ago
Hello @a-lohia ! Wrapping a function like skvideo.io.FFmpegWriter
has several pitfalls. First, the next person would like to select a different codec or change other parameters. That means we'd have to expose all the FFmpegWriter args in the wrapper function. Second, it's another dependency to Tonic, but writing videos is not the scope of Tonic.
What I normally do is to create frames using tonic.transforms.ToFrame, convert them to PyTorch tensors and then use torchvision's write_video https://pytorch.org/vision/stable/generated/torchvision.io.write_video.html
Would that be a solution for your problem?
Hello @a-lohia ! Wrapping a function like
skvideo.io.FFmpegWriter
has several pitfalls. First, the next person would like to select a different codec or change other parameters. That means we'd have to expose all the FFmpegWriter args in the wrapper function. Second, it's another dependency to Tonic, but writing videos is not the scope of Tonic.What I normally do is to create frames using tonic.transforms.ToFrame, convert them to PyTorch tensors and then use torchvision's write_video https://pytorch.org/vision/stable/generated/torchvision.io.write_video.html
Would that be a solution for your problem?
That makes sense. I think your solution would work just as well.
Thank you for the quick reply, A.L.
Would it be possible to create a new function that just produces an mp4 video with the events with support for manual framerates. I currently have to do this manually using skvideo.io.FFmpegWriter()
Thanks, A. L.