Blender Git Loki

Git Commits -> Revision c5b1e7c

Revision c5b1e7c by Sybren A. Stüvel (master)
June 11, 2019, 13:51 (GMT)
FFmpeg: Fix integer overflow when writing custom FPS with high denominator

FFmpeg uses a fraction of integers to indicate the frame rate, whereas
Blender uses `int / float`. When a custom frame rate is used with
non-integer base, the FPS and Base settings were multiplied with 100000
before passing to FFmpeg as `int`. This could overflow when a high
enough FPS setting was used, which is the case when importing a video of
almost-but-not-quite-integer frame rate into the VSE. The overflow
caused FFmpeg to return an error "The encoder timebase is not set",
which is rather cryptic for users.

The new solution is to take the max int and divide that by the frame
rate, and use that ratio to pass to FFmpeg. This won't overflow, and
thus allows exporting arbitrary frame rates.

Commit Details:

Full Hash: c5b1e7cd4e86f9aff010fa84192d783b895ce6c7
Parent Commit: bbba447
Lines Changed: +7, -2

1 Modified Path:

/source/blender/blenkernel/intern/writeffmpeg.c (+7, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021