Skip to content

Variable FPS tests #761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Variable FPS tests #761

wants to merge 6 commits into from

Conversation

scotts
Copy link
Contributor

@scotts scotts commented Jul 9, 2025

Creating a new PR based off of #669. I can't push to that PR, so we need a new one.

This PR adds a new video which has variable FPS, commits some reference frames from it, and then uses it in two tests. Notably we only test with exact seeking mode. These tests would fail in approximate mode because we would get the wrong frames.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 9, 2025
python3 "$TORCHCODEC_PATH/test/convert_image_to_tensor.py" "$bmp"
rm -f "$bmp"
done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive by. I realized we had this logic twice: here and again at the end of the script. We only want it once. The dupe was introduced back in #448.

@scotts scotts marked this pull request as ready for review July 9, 2025 03:38
@scotts scotts marked this pull request as draft July 9, 2025 11:28
@scotts
Copy link
Contributor Author

scotts commented Jul 9, 2025

Status: the current video in the PR is failing on CUDA with errors similar to what we fixed with #448. I want to re-create the video, but I am unable to. The comment in the script uses the command:

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

But I don't have libx264 in my environment. I do have libopenh264, but when I use that to encode the video, I see the warnings:

[libopenh264 @ 0x47a3c0] [OpenH264] this = 0x0x644690, Warning:layerId(0) doesn't support profile(578), change to UNSPECIFIC profile
[libopenh264 @ 0x47a3c0] [OpenH264] this = 0x0x644690, Warning:bEnableFrameSkip = 0,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.
[libopenh264 @ 0x47a3c0] [OpenH264] this = 0x0x644690, Warning:Change QP Range from(0,51) to (12,42)

And the resulting video does not have a variable frame rate. Shelving this for now until we can reliably recreate a variable framer rate video.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants