Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(ffmpeg-video): fig bug for scaling videos to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
felix committed Aug 26, 2019
1 parent cf02bed commit a76a460
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gnes/preprocessor/io_utils/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def scale_video(input_filename: str = 'pipe:',
frame_rate: int = 15,
crf: int = 16,
vcodec: str = 'libx264',
format: str = 'mpeg',
format: str = 'mp4',
pix_fmt: str = 'yuv420p',
**kwargs):
capture_stdin = (input_filename == 'pipe:')
Expand Down Expand Up @@ -60,6 +60,8 @@ def scale_video(input_filename: str = 'pipe:',

if capture_stdout:
out_kwargs['format'] = format
# an empty moov means it doesn't need to seek and thus works with a pipe.
out_kwargs['movflags'] = 'frag_keyframe+empty_moov'

stream = stream.output(output_filename, **out_kwargs).overwrite_output()
stdout, stderr = stream.run(
Expand Down

0 comments on commit a76a460

Please sign in to comment.