Skip to content
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

Manim generates variable framerate video instead of the constant value in the CONFIG #1000

Open
qo4on opened this issue Apr 22, 2020 · 3 comments

Comments

@qo4on
Copy link

qo4on commented Apr 22, 2020

FFMPEG concat function that Manim uses for partial movie files concatenation creates variational framerate video instead of constant. You can check it with these 2 video files 00000 and 00001:

ffmpeg -y -f concat -safe 0 -i file_list.txt -loglevel error -c copy test.mp4

file_list.txt:
file '00000.mp4'
file '00001.mp4'

00000.mp4:
Duration: 00:00:00.42, start: 0.000000, bitrate: 204 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 182 kb/s,
60 fps, 60 tbr, 15360 tbn, 120 tbc (default)

00001.mp4:
Duration: 00:00:01.63, start: 0.000000, bitrate: 58 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 48 kb/s,
60 fps, 60 tbr, 15360 tbn, 120 tbc (default)

The result has a different framerate:

test.mp4:
Duration: 00:00:02.05, start: 0.000000, bitrate: 85 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 76 kb/s,
59.99 fps, 60 tbr, 15360 tbn, 120 tbc (default)

I checked for a VFR:

ffmpeg -i 00000.mp4 -vf vfrdet -an -f null -
VFR:0.000000 (0/24)

ffmpeg -i 00001.mp4 -vf vfrdet -an -f null -
VFR:0.000000 (0/97)

ffmpeg -i test.mp4 -vf vfrdet -an -f null -
VFR:0.016393 (2/120) min: 256 max: 261 avg: 258

Manim generates two CFR inputs for ffmpeg concatenation and one VFR output of this concatenation. Is it possible to get VFR:0 after the concatenation?

@kevkevinpal
Copy link

do you know if this is because the first video is less than a second cause it may be the way that they calculate fps, Is this a big issue I'm not sure if having our fps off by .01 is bad or does it compound over multiple concatenation of videos?

@qo4on
Copy link
Author

qo4on commented May 14, 2020

It is a ffmpeg concat bug.

@3b1b
Copy link
Owner

3b1b commented Feb 6, 2021

The defaults have since changed so that it won't use the contact function but just writes to a single final movie file. It's still an option to write the animations to separate files and have them concat, but presumably in that case the user would have a reason for wanting the separate files in that case, which are individually constant frame rate (I believe).

How much of an issue is it if the default now is CFR, and that if one wants to export into many smaller video files it's an option, but default concatenation between those is no longer CFR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants