Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions test/generate_reference_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,22 @@ do
python3 "$TORCHCODEC_PATH/test/convert_image_to_tensor.py" "$bmp"
rm -f "$bmp"
done

# This video was generated by running the following:
# ffmpeg -f lavfi -i testsrc=duration=10:size=128x128:rate=30 -vf "setpts=PTS*if(gt(N\,30)\,1.5\,1)" -c:v libx264 -bf 0 var_fps_video.mp4
VIDEO_PATH=$RESOURCES_DIR/var_fps_video.mp4
STREAMS=(0)

FRAMES=(0 1 2 3 4 5 10 15 20 25 30 35 40 45 50 55 60)
for stream in "${STREAMS[@]}"; do
for frame in "${FRAMES[@]}"; do
frame_name=$(printf "%06d" "$frame")
ffmpeg -y -i "$VIDEO_PATH" -map 0:"$stream" -vf select="eq(n\,$frame)" -vsync vfr -q:v 2 "$VIDEO_PATH.stream$stream.frame$frame_name.bmp"
done
done

for bmp in "$RESOURCES_DIR"/*.bmp
do
python3 "$TORCHCODEC_PATH/test/convert_image_to_tensor.py" "$bmp"
rm -f "$bmp"
done
Binary file added test/resources/var_fps_video.mp4
Binary file not shown.
Loading
Loading