When reading a video with ffmpeg-python, if the video metadata contains a "rotate" attribute, it seems that by default ffmpeg transposes the incoming bytes according to the rotation value.
I would like to remove the automatic rotation. I tried the following, with no success:
import ffmpeg
process = (
ffmpeg
.input(filename)
.output('pipe:', format='rawvideo', pix_fmt='yuv420p', loglevel=0, vsync='0')
.global_args('-noautorotate')
.run_async(pipe_stdout=True)
)
The code runs without any issue, but the rotation is not ignored, as I would have expected.
According to this:https://gist.github.com/vxhviet/5faf792f9440e0511547d20d17208a76, the noautorotate argument should be passed before input.
I tried the following:
process = (
ffmpeg
.global_args('-noautorotate')
.input(filename)
.output('pipe:', format='rawvideo', pix_fmt='yuv420p', loglevel=0, vsync='0')
.run_async(pipe_stdout=True)
)
also with no success:
AttributeError: module 'ffmpeg' has no attribute 'global_args'
Any suggestion?
EDIT
Passing noautorotate as kwargs does not work either (size of video after reading is 0)
process = (
ffmpeg
.input(self.file, **{'noautorotate':''})
.output('pipe:', format='rawvideo', pix_fmt='yuv420p', loglevel=1, vsync='0')
.run_async(pipe_stdout=True)
)