PDA

View Full Version : [ubuntu] Is There A Way To Rotate The View Of A Video?



ebozzz
December 11th, 2011, 06:17 PM
I apologise but I'm not very experienced dealing with graphics. But, I catch on quick. I hope someone can provide some insight on what I am attempting to do.

I have two videos that were captured with a mobile phone. Unfortunately, the person who the took them did so in a way which left what be considered the top of the video pointing to the left. I know that with still images it is possible to rotate and save them in a more acceptable fashion. Can the same be done for video files? If so, is there a specific application that would be needed to perform the task? Thanks.....

ebozzz
December 11th, 2011, 07:27 PM
Ok, here's an update. I installed avidemux and I can get the video rotated but it seems to kill the audio portion. I'm playing around with PiTiVi now. So far no luck with it....

papibe
December 11th, 2011, 07:31 PM
I know VLC can do that while playing the video. I think you use the option convert/save to create a new rotated video.

Just an idea.
Regards.

ebozzz
December 11th, 2011, 07:34 PM
I know VLC can do that while playing the video. I think you use the option convert/save to create a new rotated video.

Just an idea.
Regards.

I was under the assumption that VLC only allowed you to rotate while playing the video. Let me take a look at that again. Thanks for chiming in....

ebozzz
December 11th, 2011, 07:54 PM
Just tried VLC again. I can get the video rotated very easily while viewing it. I have not been able to save the finished product....

papibe
December 11th, 2011, 08:20 PM
It is tricky. Take a look at this thread (http://forum.videolan.org/viewtopic.php?f=2&t=96070) in the VLC forums (specially the links to the tutorial).

Regards.

ebozzz
December 11th, 2011, 08:24 PM
It is tricky. Take a look at this thread (http://forum.videolan.org/viewtopic.php?f=2&t=96070) in the VLC forums (specially the links to the tutorial).

Regards.

Going back again....:)

andrew.46
December 11th, 2011, 09:46 PM
If you can get a decent modern copy of FFmpeg you can add the following to your commandline:


-vf 'transpose=1'

and this will rotate your video 90 degrees clockwise.

ebozzz
December 11th, 2011, 11:05 PM
If you can get a decent modern copy of FFmpeg you can add the following to your commandline:


-vf 'transpose=1'

and this will rotate your video 90 degrees clockwise.

What would be considered a decent modern copy?

Still working at this. OpenShot and PiTiVi seems to have all of the tools needed if I can ever figure out how to the get the Rotate effect to work....

andrew.46
December 12th, 2011, 01:21 AM
What would be considered a decent modern copy?

Well I guess one that shows the transpose filter as part of the output from:



andrew@skamandros~$ ffmpeg -filters
ffmpeg version N-35564-gfab97ad, Copyright (c) 2000-2011 the FFmpeg developers
built on Dec 9 2011 06:46:42 with gcc 4.5.3
configuration: --prefix=/usr --mandir=/usr/man --enable-postproc --enable-avfilter --enable-pthreads --enable-shared --disable-static --disable-ffserver --disable-avconv --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libvpx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libspeex --enable-zlib --enable-libxvid --enable-libfreetype --enable-x11grab --enable-nonfree --enable-gpl --enable-version3
libavutil 51. 31. 0 / 51. 31. 0
libavcodec 53. 41. 2 / 53. 41. 2
libavformat 53. 24. 0 / 53. 24. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 51. 0 / 2. 51. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
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.
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: ]]
life Create life.
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.


and also has not had the best parts (mp3, aac and h.264 encoding + others) removed by packagers :).

Edit: Perhaps better:



andrew@skamandros~$ [COLOR="Red"]ffmpeg -filters 2>/dev/null | grep transpose
transpose Transpose input video.

ebozzz
December 12th, 2011, 01:56 AM
Well I guess one that shows the transpose filter as part of the output from:



andrew@skamandros~$ ffmpeg -filters
ffmpeg version N-35564-gfab97ad, Copyright (c) 2000-2011 the FFmpeg developers
built on Dec 9 2011 06:46:42 with gcc 4.5.3
configuration: --prefix=/usr --mandir=/usr/man --enable-postproc --enable-avfilter --enable-pthreads --enable-shared --disable-static --disable-ffserver --disable-avconv --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libvpx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libspeex --enable-zlib --enable-libxvid --enable-libfreetype --enable-x11grab --enable-nonfree --enable-gpl --enable-version3
libavutil 51. 31. 0 / 51. 31. 0
libavcodec 53. 41. 2 / 53. 41. 2
libavformat 53. 24. 0 / 53. 24. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 51. 0 / 2. 51. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
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.
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: ]]
life Create life.
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.


and also has not had the best parts (mp3, aac and h.264 encoding + others) removed by packagers :).

Edit: Perhaps better:



andrew@skamandros~$ [COLOR="Red"]ffmpeg -filters 2>/dev/null | grep transpose
transpose Transpose input video.


I'm good. Thanks for the clarification. I've got another option to try now....