You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
examples/dump-frames works fine if frame width and height are multiple of 32 bytes. But I find it generated corrupted image if input or output size is 300*300 pixels.
I used 300*300 in the test is because many pre-trained object detection models are typically designed to accept inputs of a specific size that is not multiple of 32. For example, ssd_mobilenet_v1_1's the expected input size is 300x300 pixels.
Reproduce
run dump-frames example with a video with format 300*300 pixels, then you find the output ppm images are corrupted.
cargo run --example dump-frames ../sample-300x300.mp4
Analysis
After some check, it looks video function alloc() calls "av_frame_get_buffer" with fixed alignment 32 bytes, so it created frame with linesize[0] = 960, but it should be 900.
I then tried a test to set this alignment to 1, and it worked fine to dump 300*300 pixel images.
Suggestion
So I am asking could you please modify this alloc() function to add an additional argument "align" ? or add a new version of alloc2() function, such as
examples/dump-frames works fine if frame width and height are multiple of 32 bytes. But I find it generated corrupted image if input or output size is 300*300 pixels.
I used 300*300 in the test is because many pre-trained object detection models are typically designed to accept inputs of a specific size that is not multiple of 32. For example, ssd_mobilenet_v1_1's the expected input size is 300x300 pixels.
run dump-frames example with a video with format 300*300 pixels, then you find the output ppm images are corrupted.
After some check, it looks video function alloc() calls "av_frame_get_buffer" with fixed alignment 32 bytes, so it created frame with linesize[0] = 960, but it should be 900.
I then tried a test to set this alignment to 1, and it worked fine to dump 300*300 pixel images.
rust-ffmpeg/src/util/frame/video.rs
Line 29 in 0e4c39a
So I am asking could you please modify this alloc() function to add an additional argument "align" ? or add a new version of alloc2() function, such as
thanks
The text was updated successfully, but these errors were encountered: