1

I am trying to horizontally flip (i.e. mirror image) a video without re-encoding it using the ffmpeg -display_rotation, -display_hflip, and -display_vflip commands.

If I want to re-encode, this works perfectly:

ffmpeg -i myvideo.mp4 -acodec copy -vf hflip my_flipped_video.mp4

So it seemed natural to me that this should work in the same way:

ffmpeg -display_hflip -i myvideo.mp4 -c copy my_flipped_video.mp4

But using -display_hflip this way results in a video which is upside down. I have tried using a vflip afterwards, to no avail.

To restate - these two commands produce exactly the same output for me.

ffmpeg -display_rotation 180 -i myvideo.mp4 -c copy my_flipped_video-displayrotation.mp4

ffmpeg -display_hflip -i myvideo.mp4 -c copy my_flipped_video-hflip.mp4

Am I fundamentally misunderstanding the operation of -display_hflip? My expectation would be that it worked the same way as the video filter hflip ... that seems like it would be obvious. But it does not. And carefully reading the ffmpeg manual hasn't brought me the answer.

This is my ffmpeg version:

ffmpeg version 7.0.2-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 13.2.0 (Rev5, Built by MSYS2 project)

Thanks.

0 Answers0