(Update) Ruotare video di 90-180-270 gradi con FFmpeg

 

Aggiornamento al post fatto qualche tempo fa, su come riuscire a ruotare un video di 90-180-270 gradi, usando FFmpeg. Nell'esempio precedente si usava il filtro rotate, che adesso non c'è più, ed al suo posto c'è transpose:

 

Filters:
aconvert         Convert the input audio to sample_fmt:channel_layout:packed_fmt.
aformat          Convert the input audio to one of the specified formats.
anull            Pass the source unchanged to the output.
aresample        Resample audio data.
ashowinfo        Show textual information for each audio frame.
earwax           Widen the stereo image.
pan              Remix channels with coefficients (panning)
volume           Change input volume.
abuffer          Buffer audio frames, and make them accessible to the filterchain.
aevalsrc         Generate an audio signal generated by an expression.
amovie           Read audio from a movie source.
anullsrc         Null audio source, return empty audio frames.
abuffersink      Buffer audio frames, and make them available to the end of the filter graph.
anullsink        Do absolutely nothing with the input audio.
blackframe       Detect frames that are (almost) black.
boxblur          Blur the input.
copy             Copy the input video unchanged to the output.
crop             Crop the input video to width:height:x:y.
cropdetect       Auto-detect crop size.
delogo           Remove logo from input video.
deshake          Stabilize shaky video.
drawbox          Draw a colored box on the input video.
drawtext         Draw text on top of video frames using libfreetype library.
fade             Fade in/out input video
fieldorder       Set the field order.
fifo             Buffer input images and send them when they are requested.
format           Convert the input video to one of the specified pixel formats.
frei0r           Apply a frei0r effect.
gradfun          Debands video quickly using gradients.
hflip            Horizontally flip the input video.
hqdn3d           Apply a High Quality 3D Denoiser.
lut              Compute and apply a lookup table to the RGB/YUV input video.
lutrgb           Compute and apply a lookup table to the RGB input video.
lutyuv           Compute and apply a lookup table to the YUV input video.
mp               libmpcodecs wrapper.
negate           Negate input video.
noformat         Force libavfilter not to use any of the specified pixel formats for the input to the next filter.
null             Pass the source unchanged to the output.
overlay          Overlay a video source on top of the input.
pad              Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black).
pixdesctest      Test pixel format definitions.
scale            Scale the input video to width:height size and/or convert the image format.
select           Select frames to pass in output.
setdar           Set the frame display aspect ratio.
setpts           Set PTS for the output video frame.
setsar           Set the pixel sample aspect ratio.
settb            Set timebase for the output link.
showinfo         Show textual information for each video frame.
slicify          Pass the images of input video on to next video filter as multiple slices.
split            Pass on the input to two outputs.
transpose        Transpose input video.
unsharp          Sharpen or blur the input video.
vflip            Flip the input video vertically.
yadif            Deinterlace the input image
buffer           Buffer video frames, and make them accessible to the filterchain.
color            Provide an uniformly colored input, syntax is: [color[:size[:rate]]]
frei0r_src       Generate a frei0r source.
mandelbrot       Mandelbrot fractal renderer
movie            Read from a movie source.
mptestsrc        Generate various test pattern.
nullsrc          Null video source, return unprocessed video frames.
rgbtestsrc       Generate RGB test pattern.
testsrc          Generate test pattern.
buffersink       Buffer video frames, and make them available to the end of the filter graph.
nullsink         Do absolutely nothing with the input video.
 

 

Ruotare video a sinistra:

 

$ ffmpeg -i input.avi -vf "transpose=2" -sameq -y output.avi

 

Ruotare video verso destra:



$ ffmpeg -i input.avi -vf "transpose=3" -sameq -y output.avi

 

Ruotare sotto sopra:

 

$ ffmpeg -i input.avi -vf vflip -y output.avi

 

oppure:

 

$ avconv -i input.avi -vf "vflip" output.avi

 

enjoy 😉