While writing a video data to tfrecord
format, the output tfrecord
file size would be much larger than the original video file. For
quick demonstration purpose, some may use frame step to encode the frame to keep the overal size minimal. But in actual case (research or project)
all frame should be considered while encoding to tfrecord. By doing so, while using the tfrecord
in the training time, we can sample frames with different
indices. Check this discussion. The following code is tested in tf 2.12
.
video data layout
Let's say, we have a video data set in the following format.