Skip to content

Commit df3d4f9

Browse files
committed
imwrite_video fps
1 parent 9f1ea1e commit df3d4f9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

samples/cpp/video_generation/imwrite_video.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,13 @@ static inline void pack_to_rgb_u8(const uint8_t* src, size_t H, size_t W, size_t
328328
}
329329

330330
// accept video [B, F, H, W, C]
331-
void imwrite_video(const std::string& name, ov::Tensor video, bool convert_bgr2rgb, int quality) {
331+
void imwrite_video(const std::string& name, ov::Tensor video, const uint32_t fps, bool convert_bgr2rgb, int quality) {
332332
const auto shape = video.get_shape(); // [B, F, H, W, C]
333333
if (shape.size() != 5) throw std::runtime_error("imwrite_video: expected [B, F, H, W, C]");
334334

335335
const size_t B = shape[0], F = shape[1], H = shape[2], W = shape[3], C = shape[4];
336336
if (!(C == 1 || C == 3 || C == 4)) throw std::runtime_error("imwrite_video: C must be 1, 3, or 4");
337337

338-
const uint32_t fps = 30; // TODO: update or support as param
339338
const size_t elems_per_frame = H * W * C;
340339
const uint8_t* base = video.data<uint8_t>();
341340

samples/cpp/video_generation/imwrite_video.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
// */
1515
//
1616

17-
void imwrite_video(const std::string& name, ov::Tensor video, bool convert_bgr2rgb = false, int quality = 85);
17+
void imwrite_video(const std::string& name, ov::Tensor video, const uint32_t fps = 25, bool convert_bgr2rgb = false, int quality = 85);

0 commit comments

Comments
 (0)