Results 1 to 10 of 14

Thread: Rotating avi file using ffmpeg and imagemagick

Threaded View

  1. #1
    Join Date
    Jan 2014
    Beans
    20

    Rotating avi file using ffmpeg and imagemagick

    I am following the example for rotating movies 90 degrees using ffmpeg and imagemagick as suggested in another thread. The question I am asking how can I use ffmpeg to reassemble a movie clip from the images that is compatible with the original movies from which they were derived.

    i am making a movie out of many avi clips. The movies were all shot with the same camera. One of the clips was rotated at a 90 degree angle. I need to rotate it. I've tried many solutions like avidemux, etc. to rotate the films but the video frames become very uneven and the sound is far out of sync. I am trying to export the avi movie to images using ffmpeg, editing them using imagemagick, and then reassembling them as an avi in a mode that matches the orginal movie. After that i hope to add the sound back in like a sound track.

    The question I am asking how can I use ffmpeg to create a movie from the images that is compatible with the originals. The orginal movies have the following specifications:

    Code:
    ffmpeg -i MVI_0183.AVI
    
    Input #0, avi, from 'MVI_0183.AVI':
      Metadata:
        creation_time   : 2003-08-16 11:02:42
        encoder         : CanonMVI01
      Duration: 00:00:03.19, start: 0.000000, bitrate: 2361 kb/s
        Stream #0.0: Video: mjpeg, yuvj422p, 320x240, 15 tbr, 15 tbn, 15 tbc
        Stream #0.1: Audio: pcm_u8, 11024 Hz, 1 channels, u8, 88 kb/s
    In case you are interested, here are my steps to date.

    1. strip individual images out of the movie (images are now 320x240)
    Code:
    ffmpeg -i MVI_0183.AVI image_dump/%d.png
    2. turn them on their side (images are now 240 x 320)
    Code:
    mogrify -rotate 90 image_dump/*.png
    3. Then I made a directory temp inside directory image_dump so that I could preserve the above work and experiment a little. I wanted to crop the bottom off the bottom of the image to make it 240x240 and then add a black border so that the rotated image returned to a 320x240 frame size. When i was satisfied that the images were right, i used this command below:
    Code:
    mogrify -path temp -format png -gravity south -chop 0x80 -background black -extent 320x240 *.png
    4. My next step is to use ffmpeg to reassemble the video. Something like this???
    Code:
    ffmpeg -i temp/%d.png -o output.avi



    FYI. A more complete set of specifications is provided below:





    Code:
    mediainfo MVI_0183.AVI 
    General
    Complete name                            : MVI_0183.AVI
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    File size                                : 922 KiB
    Duration                                 : 3s 200ms
    Overall bit rate                         : 2 361 Kbps
    Mastered date                            : Sat Aug 16 11:02:42 2003
    Writing application                      : CanonMVI01
    
    Video
    ID                                       : 0
    Format                                   : JPEG
    Codec ID                                 : MJPG
    Duration                                 : 3s 200ms
    Bit rate                                 : 2 265 Kbps
    Width                                    : 320 pixels
    Height                                   : 240 pixels
    Display aspect ratio                     : 4:3
    Frame rate                               : 15.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:2
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 1.966
    Stream size                              : 885 KiB (96%)
    
    Audio
    ID                                       : 1
    Format                                   : PCM
    Format settings, Sign                    : Unsigned
    Codec ID                                 : 1
    Duration                                 : 3s 200ms
    Bit rate mode                            : Constant
    Bit rate                                 : 88.2 Kbps
    Channel(s)                               : 1 channel
    Sampling rate                            : 11.024 KHz
    Bit depth                                : 8 bits
    Stream size                              : 34.4 KiB (4%)
    Interleave, duration                     : 800 ms (12.00 video frames)
    Interleave, preload duration             : 1000 ms
    Last edited by rioguia2; February 1st, 2014 at 05:03 AM. Reason: [CODE]

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •