I'm using the following command:
ffmpeg -i port001.jpg -vf "scale=100:-1" /tmp/1/port_converted_100-1.jpg
It is working fine on landscape pics but it automatically rotate the portrait pics. Any idea how to avoid the rotation?
I'm using the following command:
ffmpeg -i port001.jpg -vf "scale=100:-1" /tmp/1/port_converted_100-1.jpg
It is working fine on landscape pics but it automatically rotate the portrait pics. Any idea how to avoid the rotation?
ffmpegThis is ticket #6945: ffmpeg fails at jpeg EXIF orientation.
ffmpeg*jpegtran can be used to losslessly rotate images. You can use it manually to rotate or create a script to rotate based on the Orientation tag.
jpegtran -rotate 90 input.jpg > output.jpg
Note that this will strip some of the exif data. If you want to keep it all add -copy all then remove the now incorrect Orientation tag with exiftool:
exiftool -Orientation="" output.jpg
exifautotranThis tool with automatically re-orient the images according to the Orientation tag:
mkdir images
cp *.jpg images
cd images
exifautotran *.jpg
* If ticket #6945 is fixed then this method will become moot.
You can use exiftool to view the orientation:
$ exiftool -Orientation -S image.jpg
Orientation: Rotate 90 CW
$ exiftool -Orientation -n -S image.jpg
Orientation: 6
ffmpegffmpeg -i input.jpg -vf "scale=100:-1" output
For more fancy scaling see Resizing images with ffmpeg to fit into specific sized box.