Skip to content

Commit

Permalink
Support overriding fps in --ffmpeg-config flag
Browse files Browse the repository at this point in the history
fps value still defaults to source fps, but you can now override it
to e.g. 15 through --ffmpeg-config='{"fps": 15}'.

Thanks for the report @Karl48071

Closing ORB-HD#24
  • Loading branch information
mdraw committed May 18, 2022
1 parent 5d5c33a commit b80a601
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deface/deface.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ def video_detect(
bar = tqdm.tqdm(dynamic_ncols=True, total=nframes)

if opath is not None:
_ffmpeg_config = ffmpeg_config.copy()
if not 'fps' in _ffmpeg_config:
# If fps is not explicitly set in ffmpeg_config, use source video fps value
_ffmpeg_config['fps'] = meta['fps']
writer: imageio.plugins.ffmpeg.FfmpegFormat.Writer = imageio.get_writer(
opath, format='FFMPEG', mode='I', fps=meta['fps'], **ffmpeg_config
opath, format='FFMPEG', mode='I', **_ffmpeg_config
)

for frame in read_iter:
Expand Down

0 comments on commit b80a601

Please sign in to comment.