Reputation: 31
I am trying to generate an image from a video file using avconv
function. Everything works fine except of the portrait video files. The generated image is in landscape or let's say it is turn to -90°.
avconv.exe -i video.MOV -r 01 -ss 00:00:05 -t 00:00:01 -f image2 preview-image.jpg
Is there any solution to generate a vertical/portrait image?
I tried to check the video information to figure out if there is a difference between portrait videos and landscape videos, but the dimensions are always as landscape on both video types.
avconv.exe -i video.MOV
avconv version 10.6, Copyright (c) 2000-2014 the Libav developers
built on Mar 9 2015 02:40:51 with gcc 4.8.3 (Gentoo 4.8.3 p1.1, pie-0.5.9)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.MOV':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2016-10-17 16:25:37
Duration: 00:00:13.69, start: 0.000000, bitrate: 4671 kb/s
Stream #0.0(und): Audio: aac, 44100 Hz, mono, fltp, 63 kb/s (default)
Metadata:
creation_time : 2016-10-17 16:25:37
Stream #0.1(und): Video: h264 (High), yuv420p, 1280x720, 4620 kb/s, 30 fps, 600 tbn (default)
Metadata:
creation_time : 2016-10-17 16:25:37
At least one output file must be specified
Any suggestions are welcome. Thanks in advance.
Upvotes: 0
Views: 83
Reputation: 93221
Assuming the Libav devs haven't changed anything significant from ffmpeg, you should run
avconv.exe -i video.MOV -vf transpose=cclock -ss 00:00:05 preview-image.jpg
Recent versions of ffmpeg will autorotate the video, based on metadata.
Upvotes: 1